Discovery of Activity Streams JSON feed

182 views
Skip to first unread message

Evan Prodromou

unread,
Jun 22, 2011, 4:19:50 PM6/22/11
to Activity Streams
Given an HTML page (say, a user profile page on a social software
site), what's the best way to discover a related Activity Streams JSON
feed?

We're going to use this for StatusNet:

<link rel="alternate feed" type="application/json" href="{URL of
feed}" />

...unless someone has a better idea.

-Evan

James Snell

unread,
Jun 22, 2011, 4:20:36 PM6/22/11
to activity...@googlegroups.com
Works for me.

> --
> 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.
>
>

Will Norris

unread,
Jun 22, 2011, 4:31:19 PM6/22/11
to activity...@googlegroups.com
+1

Martin Atkins

unread,
Jun 22, 2011, 4:38:13 PM6/22/11
to activity...@googlegroups.com

It seems wrong for us to monopolize the whole application/json MIME
type; Activity Streams isn't the only JSON format out there.

I would suggest we follow Atom's lead and establish a new MIME type for
our particular JSON schema:
application/activitystream+json

We probably should've "registered" this in the JSON Activity Streams
spec itself, but I'm sure we could add it in errata now that the spec is
final.

(and we should probably also pursue an official registration with IANA
too, for the sake of completeness.)

James Snell

unread,
Jun 22, 2011, 4:40:49 PM6/22/11
to activity...@googlegroups.com
It's a fairly simple thing to write up a separate draft that does the
IANA registration. I could do so today.

Darren Bounds

unread,
Jun 22, 2011, 6:16:16 PM6/22/11
to activity...@googlegroups.com
I went with the following in Glow:

<link rel="alternate" type="application/stream+json"
href="http://dbounds.glow.io/profile/feed?format=json"/>

> --
> 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.
>
>

--

Thank you,
Darren Bounds

Martin Atkins

unread,
Jun 22, 2011, 6:38:20 PM6/22/11
to activity...@googlegroups.com
On 06/22/2011 03:20 PM, Monica Wilkinson wrote:
> Yes so did I "application/stream+json" similar to what json schema does
> with "application/schema+json"
> See https://skitch.com/ciberch/fgf8n/http-json-schema.org-calendar
>

I have no wish to bikeshed about exactly what the MIME type is, as long
as we don't use application/json.

I think "activitystream" is better than "stream" because you can make
streams of more than just activities, but it doesn't really make much
difference as long as we register it so that others are less likely to
conflict.

Monica Wilkinson

unread,
Jun 22, 2011, 6:20:01 PM6/22/11
to activity...@googlegroups.com
Yes so did I "application/stream+json" similar to what json schema does with "application/schema+json"
See https://skitch.com/ciberch/fgf8n/http-json-schema.org-calendar

Darren Bounds

unread,
Jun 22, 2011, 8:20:51 PM6/22/11
to activity...@googlegroups.com
I'm fine with both as well and would also advocate not using application/json.

Jeff Martin

unread,
Jun 22, 2011, 8:49:34 PM6/22/11
to activity...@googlegroups.com
+1 to not using generic application/json and using something that indicates it conforming to the activity stream spec.

Pelle Wessman

unread,
Jun 23, 2011, 3:29:14 AM6/23/11
to activity...@googlegroups.com
Couldn't we instead register a full relation in the Web Linking registry for a generic activity stream? Like:

<link rel="activitystream" type="application/json" href="http://identi.ca/main/xrd?uri=voxp...@identi.ca" />

The "alternate" relation means that the resource is an alternate representation of the current page - will all referenced streams be that? Linked RSS-feeds often aren't alternate representations of the page but rather more loosely related -  I think the same would be true here.

Also - wouldn't it be good if the relation we choose to use here could also be reused in eg. WebFinger documents which currently also lack a generic way of discovering an activity stream?

Lastly: Anyone thought of instead of directly including the reference to an activity stream feed instead do something like referencing a XRD/WebFinger document through an lrdd-relation like:

<link rel="lrdd" href="http://identi.ca/main/xrd?uri=voxp...@identi.ca" />

That way one could easily reference activity streams with a wide range of relations - both generic ones as the one we discuss here and more specific ones for more specific kind of streams.

Evan Prodromou

unread,
Jun 23, 2011, 11:11:16 AM6/23/11
to Activity Streams
OK, we're going with rel=alternate, type=application/schema+json

I love it when things work out this way.

-Evan

Evan Prodromou

unread,
Jun 23, 2011, 11:15:51 AM6/23/11
to Activity Streams
Linked RSS and Atom feeds are rel=alternate, even if they're not an
exact representation of the contents of the page.

http://dev.w3.org/html5/spec/Overview.html#rel-alternate

"The alternate keyword is used with the type attribute set to the
value application/rss+xml or the value application/atom+xml
The keyword creates a hyperlink referencing a syndication feed
(though not necessarily syndicating exactly the same content as the
current page)."

-Evan

Evan Prodromou

unread,
Jun 23, 2011, 11:45:59 AM6/23/11
to Activity Streams
YIKES! I meant, "application/stream+json".

Sorry about that.

Chris Messina

unread,
Jun 23, 2011, 1:08:23 PM6/23/11
to activity...@googlegroups.com
Please take a look at this page and consider updating it with additional thoughts/proposals:


Chris

--
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.




--
Chris Messina
Open Web Advocate, Google


This email is:   [ ] shareable    [X] ask first   [ ] private

Michiel de Jong

unread,
Jun 23, 2011, 6:19:44 AM6/23/11
to activity...@googlegroups.com
Disclaimer: I'm only writing what i think, in case it helps with the
discussion. If it doesn't, then just ignore me. :)

On Thu, Jun 23, 2011 at 9:29 AM, Pelle Wessman <voxp...@gmail.com> wrote:
> <link rel="activitystream" type="application/json"
> href="http://identi.ca/main/xrd?uri=voxp...@identi.ca" />
>
> The "alternate" relation means that the resource is an alternate
> representation of the current page - will all referenced streams be that?
> Linked RSS-feeds often aren't alternate representations of the page but
> rather more loosely related -  I think the same would be true here.

I agree with you. Reading
http://www.w3.org/TR/html40/struct/links.html#h-12.3.3 and
http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#rel-alternate
it seems to me that we're overusing the 'alternate' keyword here,
because activitiystreams grew beyond being just an alternative
representation of a user's static profile page. 'alternate' makes
sense as a word in the case of the same document in a print-format, or
in a different natural language. But a person's activitystream is not
an alternative representation of that person's online profile.

It sort of depends, I guess. If the original page is already a sort of
stream (as is the case with a blog and with a microblog), then it
makes sense. But the changelog of a wikipedia page is not an
alternative representation of that same page, because the original
page itself has the character of a snapshot and not of a stream. It's
a subjective line to draw, I think.

Does anybody know how to sensibly formulate a link from a static page
(not a blog or "streamy" page) to the activitystream of its changelog?
Good point, Pelle!

>
> Also - wouldn't it be good if the relation we choose to use here could also
> be reused in eg. WebFinger documents which currently also lack a generic way
> of discovering an activity stream?

Yeah, it's like this beautiful Woody Allen quote: "we are, in fact,
the sum total of our choices". Except we're not! :)

Like saying, what you do and what you are is the same thing. But I
agree with you here that these two things are different. There's a
difference between "me, now", and "news about me, over time". A
separation between the two concepts would be a definite "nice to
have", I think.

>
> Lastly: Anyone thought of instead of directly including the reference to an
> activity stream feed instead do something like referencing a XRD/WebFinger
> document through an lrdd-relation like:
>
> <link rel="lrdd" href="http://identi.ca/main/xrd?uri=voxp...@identi.ca" />

that seems confusing to me, because then the lrdd of the page is
hardlinked to be the same as the lrdd of voxp...@identi.ca. So if you
then add a 'hair colour' element to the lrdd of voxp...@identi.ca,
then this page with the lrdd link in it suddenly becomes a web page
with a hair colour. :) Would you want to do this on pages that
describe a person, or on pages that are authored by a specific person?
If I write a webpage about you, would I point it to your webfinger or
to my own one? I think rel='lrdd' leaves that unclear.

> That way one could easily reference activity streams with a wide range of
> relations - both generic ones as the one we discuss here and more specific
> ones for more specific kind of streams.

Yes, specific activitystreams! What's happening with that? Is there a
way to represent filtered versions of an activitystream, for instance
only a shortlist of verbs you're interested in?

Disclaimer (repeated): I'm only writing what i think, in case it helps
with the discussion. If it doesn't, then just ignore me. :)


Cheers!
Michiel

Pelle Wessman

unread,
Jun 24, 2011, 4:14:51 AM6/24/11
to activity...@googlegroups.com
Aren't those two the only exceptions to the "alternate"-relation? Probably caused by the way people have "misused" the "alternate"-relation for feed discovery in the past.

I see a few problems with using the "alternate"-relation:

* We use it in a way it has been specified that only Atom and RSS-feeds should use it.
* We use it for historic reasons rather than semantic reasons.
* We use it in a way not really usable in other places like host-meta/WebFinger.
* We rely purely on mime-types to discover whether something is an activitystream or not.
* We don't get a type-agnostic way of referencing related activitystreams.

Any reason not to use something like this instead?

<link rel="activitystream" type="application/json" href="http://www.example.com/xml/index.json" />
<link rel="activitystream" type="application/atom+xml" href="http://www.example.com/xml/index.atom" />

/ Pelle

Pelle Wessman

unread,
Jun 24, 2011, 4:26:17 AM6/24/11
to activity...@googlegroups.com
Regarding the "lrdd"-relation: It's defined here http://tools.ietf.org/html/draft-hammer-hostmeta-16#section-6.3 and yes, you would probably only link it to a WebFinger-document on a user profile or similar. On other pages you would probably either refer to the user profile through an "author"-relation or do a lrdd link to a non-WebFinger lrdd-document.

/ Pelle

Martin Atkins

unread,
Jun 24, 2011, 11:42:37 AM6/24/11
to activity...@googlegroups.com
On 06/24/2011 01:14 AM, Pelle Wessman wrote:
>
> <link rel="activitystream" type="application/json"
> href="http://www.example.com/xml/index.json" />
> <link rel="activitystream" type="application/atom+xml"
> href="http://www.example.com/xml/index.atom" />
>

Registering a new "rel" keyword seems fine, but we should probably call
it "activities" instead of "activitystream", for consistency with how
link relations are normally named.

So,

<link
rel="activities"
type="application/activitystream+json"
href="http://www.example.com/xml/index.json" />

means:

The resource "http://www.example.com/xml/index.json" contains the
activities for this page in application/activitystream+json format.

(I'm not presumptuous enough to think that Activity Streams JSON will be
the last JSON schema for activities, so I think we should still use a
more specific type than application/json; in the normal case rel
keywords should be orthogonal to types.)

Pelle Wessman

unread,
Aug 10, 2011, 6:19:44 PM8/10/11
to activity...@googlegroups.com
Tantek has quite an interesting and related thought in this area that also highlights that the usage of "alternate" alone might not always be the right choice:

http://tantek.com/2011/222/t2/site-feed-link-from-post-page-try-rel-home-alternate

In addition to possibly using rel="home alternate" (or a similar solution), would perhaps rel="author alternate" also be interesting to the federated social web's usage of Activity Streams? Perhaps something to discuss together with the Microformats community?

(Sorry for posting many suggestions in this thread - I just want to understand the reasoning behind it and how it should be used)

/ Pelle
Reply all
Reply to author
Forward
0 new messages