Merge/incorporate Activity Streams into OpenSocial
From OpenSocial
Contents |
Background
Activity Streams offers several advantages over the existing activities as they are currently defined in OpenSocial. For example:
- Activity Streams is more complete, and extensible
- Establishing a set of Noun/Verb conventions that could provide some consistency when used with OpenSocial based Social networks
Mapping ActivityStreams to OpenSocial
The ActivityStream specification is currently independent from OpenSocial's infrastructure (e.g. Person object and its service). Since much overlap exists between ActivityStreams and OpenSocial, we should consider how to handle these two parallel services, and what, if anything, should be mapped to the other. This section provides a detailed mapping between OpenSocial Activities & MediaItems and ActivityStreams to illustrate overlap and differences between the two specifications.
Click here for a detailed diagram that shows the mapping between OpenSocial and ActivityStreams.
OpenSocial data specification: http://opensocial-resources.googlecode.com/svn/spec/1.1/Social-Data.xml
ActivityStreams JSON specification: http://activitystrea.ms/head/json-activity.html
OpenSocial APIs with ActivityStreams
This section documents the ActivityStream proposal merged with the OpenSocial specification.
Click here for the full list of specification documents.
Prototype Implementation
We have completed a prototype implementation of ActivityStreams in Apache Shindig. The implementation is based on the draft JSON specification for ActivityStreams: http://activitystrea.ms/head/json-activity.html.
This implementation has been merged into Apache Shindig's trunk under the 'extras' directory. The SVN repository is here: https://svn.apache.org/repos/asf/shindig/trunk
Functionality
- Support REST end-points comparable to existing Activity service
- Support JavaScript API comparable to existing Activity service
- osapi calls (e.g. osapi.activitystreams.create(...))
- OSML
- Templating
- Continued support for Activities for backwards compatability
- ActivityStreams are additional mechanism for managing activities
- Can create, update, retrieve, and delete Activities
- Can create, update, retrieve, and delete ActivityStreams
Technical Approach (Apache Shindig)
- Write ActivityStream and ActivityStreamObject interfaces and implementing classes
- Add new ActivityStream service and handler
- Update GUICE bindings to support JavaScript calls
- Update REST end-points to support ActivityStream service
- Add database table to persist ActivityStreams
- Implement support for OSML and Templating
- Support mapping between Activities and ActivityStreams (TBD)
- Write unit tests to test functionality
- Write sample gadgets to demonstrate functionality
Implementation
- (done) Write ActivityStream and ActivityStreamObject interfaces and implementing classes
- (done) Add new ActivityStream service and handler
- (done) Write ActivityStreamHandler and ActivityStreamService class
- (done) Update SampleModule and SocialApiGuiceModule to properly handle binding to ActivityStreamHandler
- (done) Implement ActivityStream support in gadget API (e.g. osapi.activitystreams.create(...))
- (done) Map ActivityStream objects to List<ActivityStreamObject> within ActivityStream entries
- (done) Complete ActivityStream service CRUD
- (done) Finish enum types in ActivityStream
- (done) Persist ActivityStreams in JSON database
- OSML & Templating support
- Pipelining support
- Unit tests
- Sample gadgets
- (done) basic demo
- More realistic gadget
Use Cases
Some use cases to consider are:
- Push an ActivityStream to the wire from an OpenSocial container
- Pull an ActivityStream off the wire; update Person location based on ActivityStream actor location.
- Work with ActivityStreams in JavaScript; create structure and access fields
- Work with ActivityStreams in Java; create objects with accessor/mutator fields.
Additions to the data model
There are a number of potential additions to the data model, suitable for inclusion in the definition of an Activity. These include but are not restricted to -
- Interest list - a list of people to whom an event should be 'sent'
- Access list - a list of people who can 'discover' an event
- Viewer/Editor gadget reference - for rendering (typically the target of) an activity in place
These are dealt with in more detail here : ActivityEvent Data Model Enhancements
Proposals
Tags
ActivityStreams would benefit from a tagging mechanism, in which key words can be attached directly to an Activity entry and/or an entry's object. Since an Activity entry must have exactly one object, it makes sense that tags be placed in an entry or its object, but not both. The Activity entry maintains metadata surrounding its object, such as the actor's ID, the time the activity occurred, and a representative title for the activity. The Activity's object contains information about the main object of the activity. Since tags are conceptually applied to the objects/targets of activities and not the metatdata surrounding those activities, the Activity's object is well-suited to maintain the tags field.
Proposal: Add a 'tags' field to the Object construct of ActivityStreams.
Example:
"id": "myEntryId123", "permalink": "http://www.myactivityentry.com", "postedTime": "2010-04-27T06:02:36+0000", "title": "New Article", "body": "The Minion Just Released a New Article!", "actor": { "id": "john.doe", "displayName": "John Doe" }, "verb": ["post"], "object": { "id": "myObjectId123", "displayName": "The Mac n ator", "permalink": "http://www.theminion.com/macnator", "objectType": ["article"], "tags": ["news", "funny", "fake", "geeky"] }
Some questions:
- Would inclusion of tags in both the entry and the entry's object be redundant?
- Are there separate use cases for the inclusion of tags in Activity entrys and entries' objects?
- What is the relationship between stream tags (i.e. a collection of Activity entries) and entries' tags?
Concerns
- IP of Activity Strea.ms is an issue. Have the contributors executed a CLA or the OWF Non-Assert?
- What's the relationship between PoCo status and ActivityStreams status?
