I've become pretty convinced (ok, entirely convinced) that
ActivityStreams in JSON should be our top priority.
{
"id": "http://www.bestsite.com/willy9/stream",
"language" : "en-US",
"displayName" : "Willy Wonka's Activity Stream on The Best Site",
"subject" :
{
"id": "http://bestsite.com/user/608201527",
"displayName" : "Willy Wonka",
"image" : "http://www.bestsite.com/willy9/picture",
"permalinkUrl" : "http://www.bestsite.com/willy9",
"objectType": ["http://activitystrea.ms/schema/1.0/person"]
},
"generator" :
{
"permalinkUrl" : "http://www.bestsite.com",
"displayName" : "The Best Site"
},
"entries":
[{
"id": "http://bestsite.com/activity/608201527_118700288155735",
"permalinkUrl" : "http://www.bestsite.com/608201527/posts/118700288155735",
"postedTime": "2010-04-27T06:02:36+0000",
"title" : "Willy Wonka just RSVPed for Mozilla Labs Night - April 2010",
"actor" : { "id": "http://bestsite.com/user/608201527"},
"verb" : ["http://activitystrea.ms/schema/1.0/rsvp-yes"],
"object" :
{
"id": "http://www.meetup.com/Mozilla-Labs-Meetup/calendar/13194973/",
"displayName" : "Mozilla Labs Meetup (Mountain View, CA)",
"permalinkUrl" : "http://www.meetup.com/Mozilla-Labs-Meetup/calendar/13194973/i3/site",
"objectType": ["http://activitystrea.ms/schema/1.0/event", "http://events.com/schema/1.0/meetup"],
"dtStart" : "2010-04-29T06:02:00+0000",
"location" : {
"id": "http://www.mozilla.org/locations/mtv",
"displayName" : "Mozilla Office in Mountain View, CA",
"streetAddress": "650 Castro St",
"locality" : "Mountain View",
"region": "CA",
"country" : "US"
}
},
"serviceProvider" :
{
"permalinkUrl" : "http://www.meetup.com",
"displayName" : "Meetup",
"icon" : "http://photos-b.ak.fbcdn.net/photos-ak-sf2p/v43/97/2403839689/app_2_2403839689_2546.gif"
}
},
{
"id": "http://bestsite.com/activity/608201527_118700288155740",
"permalinkUrl" : "http://www.bestsite.com/608201527/posts/118700288155740",
"postedTime": "2010-04-25T06:02:36+0000",
"title" : "Willy Wonka uploaded a photo to the Incredible Shots album on Flickr",
"actor" : { "id": "http://bestsite.com/user/608201527"},
"verb" : ["http://activitystrea.ms/schema/1.0/post"],
"object" :
{
"displayName" : "Burning Tree",
"permalinkUrl" : "http://www.flickr.com/willy/photo/29382938293",
"objectType": ["http://activitystrea.ms/schema/1.0/photo"],
"thumbnail" : "http://www.flickr.com/willy/photo/29382938293/small.jpg",
"fullImage" : "http://www.flickr.com/willy/photo/29382938293/large.jpg"
},
"target" :
{
"permalinkUrl" : "http://www.flickr.com/willy/album/2323232",
"displayName" : "Incredible Shots",
"thumbnail" : "http://www.flickr.com/willy/photo/29382938293/small.jpg",
"objectType": ["http://activitystrea.ms/schema/1.0/photo-album"]
},
"serviceProvider" :
{
"permalinkUrl" : "http://www.flickr.com",
"displayName" : "Flickr",
"icon" : "http://www.flickr.com/favicon.ico"
}
}]
}
Also, is the general idea that activitystream json would be layered
into something like json-c [3]
On 04/29/2010 04:28 AM, Ed Summers wrote:I'm completely comfortable with requiring consuming software to understand the activity streams JSON format in order to process activity streams serialized in JSON.
On Thu, Apr 29, 2010 at 1:28 AM, Martin Atkins<ma...@degeneration.co.uk> wrote:
JSON consumers favors data structures that don't require post-processing
in order to do the expected operations. A links array is unfortunate
because it requires consumers to scan the list to find the links they
are interested in and it does not make explicit the cardinality of each
link type.
So in your tight binding solution would there be any way to
automatically detect typed hyperlinks? Clients would have to be custom
written to process JSON from a particular source? Is this
intentionally getting away from REST's notion of Hypertext as the
Engine of Application State [1,2].
Also, is the general idea that activitystream json would be layered
into something like json-c [3]
To be clear, the proposal is not to remove links entirely but rather to put them in named properties such as "permalinkUrl" and "imageLink". So no, you can't just say "what all are the links in this thing?" without knowing what links you are looking for, but I'm not convinced that it's a problem.
Martin Atkins wrote:
To be clear, the proposal is not to remove links entirely but rather to put them in named properties such as "permalinkUrl" and "imageLink". So no, you can't just say "what all are the links in this thing?" without knowing what links you are looking for, but I'm not convinced that it's a problem.Who maintains the registry of these things? How do you map from the existing registries to this new registry? How do I know that my library is going to pass through my new, experimental or private links to my code (will all libraries pass through all unknown fields of all unknown structures to clients? In C++ and Java?) Do we have to invent new named properties like pubsubhubbbUri? Are we going to argue about whether links should be named xxxLink or xxxUri or xxxUrl?These are all pretty much solved with links. Because they're constrained, even C libraries can pass them through without problems. It's hard to get them wrong or do things that are _too_ crazy. Activity Streams should not be trying to re-invent this wheel.
That would mean that every external spec needs to lobby the JSON Activty Stream spec to get included. PubSubHubbub and Salmon would be the first two. This is of course on top of the other registrations they have to do already. Isn't that a bit silly?
On Thu, Apr 29, 2010 at 12:37 PM, John Panzer <jpa...@google.com> wrote:That would mean that every external spec needs to lobby the JSON Activty Stream spec to get included. PubSubHubbub and Salmon would be the first two. This is of course on top of the other registrations they have to do already. Isn't that a bit silly?The case for JSON activity streams is different than the case for Atom activity streams. For Atom we already had parsers that handled things like parsing a collection of links with types and we were just extending what was already there. For JSON the beauty is we don't have to shoehorn anything. JSON has such low barrier of entry that its not like people have to worry about writing parsers and have to reuse code to extract links.
If we want to leverage the benefits of a compact and simple JSON response from an api then modeling if after atom is not the answer.
Martin's feedback is valuable. Consumers can loop through an array finding the appropriate rel type or just read the appropriate property directly
On 04/30/2010 04:01 PM, John Panzer wrote:Comments are objects.
o Why not use the basic Activity structure for comments? Comments are
activities too.
There is an implied activity that the comment was posted, but I don't really see any point in including that activity here explicitly since you can infer all of its important properties from the object alone.
--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.