W3C home > Mailing lists > Public > public-socialweb@w3.org > October 2014

Re: Activity Streams and Annotations

From: James M Snell <jasnell@gmail.com>
Date: Thu, 30 Oct 2014 14:39:41 -0700
Message-ID: <CABP7RbeLrtTuWKFc3NR5HoLKrV3dOOboNx3MeN2+Dhd1OynXww@mail.gmail.com>
To: Robert Sanderson <azaroth42@gmail.com>
Cc: "public-socialweb@w3.org" <public-socialweb@w3.org>, Web Annotation <public-annotation@w3.org>
On Thu, Oct 30, 2014 at 2:06 PM, Robert Sanderson <azaroth42@gmail.com> wrote:
>
[snip]
>
>>
>> Let's just focus on a couple of these:
>> {
>>   "@context": "...",
>>   "oa:hasBody": {
>>     "@type": "xsd:string",
>>     "@value": "A simple value"
>>   },
>
>
> As a note, this is not valid in the CG's Open Annotation model (the Body
> must be a resource, not a Literal) and would also not be a valid
> serialization in the ED coming from discussions this week (the Body may be a
> Literal, but must be represented as a simple string rather than with an
> explicit data type).
>


Ok, good to know. When I was looking around I came across a number of
different examples so wasn't exactly sure what direction things were
heading so figured I'd just hand wave that part for now ;-)

>>
>>   "oa:hasTarget": {
>>      "@id": "http://example.org/foo##a+text-fragment
>>   },
>>   "oa:annotatedBy": "acct:sally@example.org",
>>   "oa:annotatedAt": "2014-10-30T12:34:56Z",
>>   "oa:motivatedBy": "oa:editing"
>> }
>>
>> Within Activity Streams, we have two possible ways of moving forward:
>> A. We can use the OA vocabulary within the direct object of an
>> Activity statement:
>
>
> +1
>
> User: Sally
> Action: Created / Uploaded
> Object: Annotation
>
>
>> Which works reasonably well but has some issues. Even more
>> interesting, however, is that we can...
>>
>> B. We can leverage the JSON-LD to map somewhat seamlessly between the
>> Activity Streams and OA Vocabularies:
>>
>>
>> {
>>   "@context": [
>>     "http://asjsonld.mybluemix.net",
>>     {
>>       "oa": "http://www.w3.org/ns/oa#",
>>       "object": "oa:hasBody",
>>       "target": "oa:hasTarget",
>>       "actor": "oa:annotatedBy",
>>       "published": "oa:annotatedAt",
>>       "generator": "oa:serializedBy"
>>     }
>>   ],
>>
>>   "@type": "oa:Annotation",
>>   "actor": "acct:sally@example.org",
>>   "object": {
>>     "@type": "xsd:string",
>>     "@value": "This is a simple annotation"
>>   },
>>   "target": "http://example.org/something##this+is+something",
>>   "oa:motivatedBy": {
>>     "@type": "oa:Motivation",
>>     "@id": "oa:editing"
>>   }
>> }
>
>
> As I understand it, please correct me if I'm wrong, this version amounts to:
>
> User: Sally
> Action: Annotated
> Object: "This is a simple annotation"
> and the target in Activity Streams speak is the indirect object, which
> happens to be the Target in Open Annotation speak.
>

In AS, the target property is used to indicate the object to which the
activity has been directed. I admit that it's a bit convoluted, but
the example above amounts to "Sally posted-as-an-annotation the string
"This is a simple annotation" on <target>". Here, the verb becomes the
idiomatic "posted as an annotation" as opposed to just "created" or
"uploaded", etc. It does require a different way of thinking about the
Activity (the verb becomes a noun) which is often not entirely
intuitive. Activity Streams supports both ways of modeling it so it
really depends on what point of view y'all want to take on the
Activity.

> As confusing as it sounds, I think these are the other way round, and the
> as:target is actually the oa:body. If the verb is "annotated", and
> example.org/something is "Something" in natural language:
>
> Sally annotated Something with "This is a simple annotation"
> Actor Verb Object [preposition] Target
>
> Whereas the version above seems more like:
> Sally created a comment with the value "This is a simple annotation" about
> Something
>
>
> Option C.
>
> Instead, we could represent the annotation as an activity that the user
> takes on the target resource, with the body of the annotation as the extra
> information.  We could map the motivation to the verb, and keep the class as
> Annotation...
>
> {
>   "@type": "oa:Annotation",
>   "verb" : "oa:commenting",
>   "actor": "acct:sally@example.org",
>   "object": "http://example.org/something##this+is+something",   //
> oa:target
>   "target": "This is a simple annotation"  // oa:body
> }
>
> User: Sally
> Action: commenting [on]
> Object: http://example.org/something
> [IndirectObject: "This is a simple annotation"]
>
> And thus the English sentence:
> Sally commented on Something with "This is a simple annotation"
>

Yes, this is absolutely possible but the object and target would be switched.

> Equivalently, for some of the other motivations:
>  * Sally bookmarked Something
>  * Sally identified Something as SomethingElse
>  * Sally replied to Something with "a simple reply"
>  * Sally highlighted Something
>  * Sally classified Something as a SomethingElse
>  * Sally described Something as "a simple description"
>
>
> Also, some questions that I couldn't figure out from AS-core and
> AS-vocabulary:
>
> 1. Can there be multiple objects and targets?
> We allow multiple bodies and multiple targets in the current specification,
> without using the multiplicity constructs and just by repeating the
> predicate (in RDF terms).  In JSON(-LD) terms, the values of object and
> target would be arrays.
>

Yes.

> 2. Can there be a target without an object?
> If not, as body is optional, option B would not work for bookmark or
> highlight.
>

In the case of "bookmark" and "highlight" (as used in this context),
there typically is not a target to which the action is performed. So
those would typically end up as "object"... e.g.

{
  "actor": "acct:sally@example.org",
  "verb": "oa:bookmarking",
  "object": "http://example.org/foo"
}

But that would violate the @context mapping above so it gets a bit
tricky. This is where the Activity Vocabulary gets a bit murky because
it has really been designed to model actions in relation to direct and
indirect objects which can shift depending on exactly how the verb is
being used and has been defined. Given this possible ambiguity then,
Option A is looking more and more attractive ;-), especially in that
it provides a much cleaner layering between the vocabularies.

> 3.  Can there be a class /and/ a verb as above in option C, to support the
> class and motivation?  And if so, should the AS-core spec describe the
> precedence between the two?

Yes, but the WG is currently evaluating this further. As I've
mentioned, there are cases where it is extremely helpful to model the
verbs as nouns (e.g. rather than "Sally liked a thing" it's "Sally
created a Like about a thing", treating the Like as a resource in it's
own right). We have to think about this particular bit more, however,
because there are strengths and weaknesses in both points of view.

>
> The rationale for both at once is that the resource is an Annotation, and it
> was created with some intent.  For example, the annotation created with the
> intent to describe the target is not /itself/ a Description... it links the
> description in the body to the resource that it describes.
>

Absolutely. I'll be stewing over this a bit more over the next couple
of days. Generally we have two paths forward on this:

1. Model the Annotation as "Just another objectType" layered on top of
Activity Streams (my Option A above); or

2. Map oa:Annotation onto the Activity Vocabulary which would likely
require some tweaks here and there to either vocabulary to make it
work.

The "Right Answerâ„¢" is likely some mix of these two but for right now,
the first choice is probably the path of least resistance.

>
> Thanks again James, and if you're still at TPAC (and get this on Thursday
> afternoon) and would like to discuss, I'm happy to jump out of the Digital
> Publishing IG to do so.
>

I actually just walked through the door back at home in Fresno just a
short while ago but will definitely have time to kick this around in
email over the next couple of days. If necessary we can see about
jumping into IRC as well.

- James

> Rob
>
> --
> Rob Sanderson
> Technology Collaboration Facilitator
> Digital Library Systems and Services
> Stanford, CA 94305
Received on Thursday, 30 October 2014 21:40:31 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:26:13 UTC