Verb extension is definitely an important topic that's been on my mind
quite a bit lately. The main challenge is bootstrapping the the use
and comprehension of new verbs. One mechanism that I have been
considering is allowing URI-based verbs to be dereferenced in order to
discover information about the verb.
For instance, taking an example from one of the links you mention...
"Nikolaus Completed CPR Training"
There currently is no "completed" verb in the base schema... There are
two options for representing the "completed" verb within the JSON
Activity Stream:
1. "verb":"completed"
2. "verb":"
http://example.org/scorm/verbs/completed"
That is, either a simple label or as a fully-qualified IRI.
Using option 1, there's no real way to bootstrap the us of the verb.
An implementation either knows what it means or it doesn't. There's
really nothing else that can be done. Using option 2, however, we can
make it so that if an implementation does a GET request on the URL, it
can fetch a document that describes the verb...
GET /scorm/verbs/completed HTTP/1.1
Host:
example.org
Returns...
HTTP/1.1 200 OK
Content-Type: application/json
{
"objectType": "verb",
"id":"
http://example.org/scorm/verbs/completed",
"displayName": "Completed",
"summary": "Indicates that the actor completed the task identified
by the object",
"verbs": ["
http://example.org/scorm/verbs/read", "play"]
}
This adds a degree of complexity to the overall model, yes, but it
allows verbs to be introduced in a decentralized way and allows
implementations to evolve, learning new verbs as they are used.
You also show the example:
1. Nikolaus Read Hamlet
2. Nikolaus Completed Hamlet
And ask how a system can know that these are potentially aliases of
one another. Note the "verbs" field in the example verb object I give
above. Here, we can list other verbs for which the defined verb can be
considered an alias. These can be extension verbs or registered verbs.
If they are extension verbs, the same GET discovery model can be
applied unless the verb is already known to the system.
It more detail is required, then we can provide more explicit detail:
{
"objectType": "verb",
"id":"
http://example.org/scorm/verbs/completed",
"displayName": "Completed",
"summary": "Indicates that the actor completed the task identified
by the object",
"alias-of": ["
http://example.org/scorm/verbs/read"],
"specialization-of": ["play"]
}
e.g. alias-of defines that "completed" is an alias of "read" but a
more specific form of "play"... This is just a strawman example but
hopefully the idea is clear.
Note that that I'm using the basic Activity stream object syntax to
represent the verb information. If an organization wish to, it can
publish and syndicate collections of extension verbs using the same
basic collection syntax used for Activity streams...
{
"totalItems": 2,
"items": [
{"objectType":"verb", ...},
{"objectType":"verb", ...}
]
}
It would even be possible to create an activity stream ABOUT verbs...
{
"totalItems": 2,
"items": [
{"verb":"created",
"actor":{"displayName":"tin can"},
"object":{"objectType":"verb",...}},
...
]
}
In this way, libraries of extension verbs can be defined and pushed in
to supporting implementations at once, providing a natural
extensibility model.
- James
> --
> You received this message because you are subscribed to the Google Groups "Activity Streams" group.
> To post to this group, send email to
activity...@googlegroups.com.
> To unsubscribe from this group, send email to
activity-strea...@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/activity-streams?hl=en.
>