Hi Erik,

On Thu, Apr 28, 2011 at 05:31:10PM -0700, Erik Wilde wrote:
> 
> hello.
> 
> on http://dret.typepad.com/dretblog/2011/04/atom-content-negotiation.html
> i have posted some thoughts on whether there should eb a way how to
> differentiate between "feed variants", so that publishers could link
> the HTML feed to the XML feed. any feedback would be very welcome,
> both encouraging and critical. commenting on the blog might be
> better visible, and i will take the freedom to link back from the
> blog to the mailing archive if there are interesting follow-up
> mails, unless you don't want me to do so.

Why not just use <atom:link rel='alternate' href='...'/> at both the feed and 
entry levels? 

In our data repository systems (based on AtomPub), both collections and 
collection members are content negotiable resources. I.e., you can retrieve an 
Atom, HTML or JSON representation, by specifying different preferences in the 
Accept request header. In addition to this content negotiation at the 
collection 
or member URI, each variant representation also has a URI, and links are 
provided in entry and feed representations to all variant representations via 
the 'alternate' link relation.

E.g., 

GET /foo
Host: example.org
Accept: application/atom+xml

200 OK
Content-Type: application/atom+xml;type=feed
Content-Location: http://example.org/foo?format=atom
Vary: Accept 

<atom:feed xmlns:atom="http://www.w3.org/2005/Atom";>
  <atom:link rel="self" href="http://example.org/foo"/>
  <atom:link rel="alternate" type="text/html" 
href="http://example.org/foo?format=html"/>
  <atom:link rel="alternate" type="application/json" 
href="http://example.org/foo?format=json"/>
  ...
  <atom:entry>
    <atom:link rel="edit" href="http://example.org/foo/bar"/>
    <atom:link rel="alternate" type="text/html" 
href="http://example.org/foo/bar?format=html"/>
    <atom:link rel="alternate" type="application/json" 
href="http://example.org/foo/bar?format=json"/>
    ...
  </atom:entry>
</atom:feed>

FWIW, this is implemented using a generic content negotiation plugin for 
AtomBeat [1], sorry no documentation as yet.

Cheers,

Alistair

[1] 
http://code.google.com/p/atombeat/wiki/ReleaseNotes#configurable_conneg_plugin 

> 
> thanks and kind regards,
> 
> dret.
> 
> -- 
> erik wilde | mailto:[email protected]  -  tel:+1-510-6432253 |
>            | UC Berkeley  -  School of Information (ISchool) |
>            | http://dret.net/netdret http://twitter.com/dret |
> 

-- 
Alistair Miles
Head of Epidemiological Informatics
Centre for Genomics and Global Health <http://cggh.org>
The Wellcome Trust Centre for Human Genetics
Roosevelt Drive
Oxford
OX3 7BN
United Kingdom
Web: http://purl.org/net/aliman
Email: [email protected]
Tel: +44 (0)1865 287669

Reply via email to