media types are an important part of web architecture, and they even have (some) structure; the very obvious type/subtype syntax, and the maybe not as obvious "+" convention in types such as application/atom+xml. however, while that allows you to expose the fact that something is Atom and that Atom is based on XML, it does not allow you to talk about what the published entries are.
let's assume you have a collection of items that is exposed via feeds and managed in whatever back-end storage works well for you. you want to be a good web citizen and publish it as HTML, XML, JSON, and RDF. you also want to be a good web service citizen and publish any updates via feeds, so that consumers are notified whenever the collection changes. what is the best web pattern to do that? currently, there are two main approaches:
- publish different feeds. in this case, each content type is published in a different feed. one problem is that these feeds are not interlinked, so it is not possible to switch feeds easily. another problem is that there is no way how to advertise these feeds in a way that marks them as being content type variants of the same content.
- link content variants. in our suggestions for
Web Services for Recovery.gov
, we had just one feed that would embed reports in HTML, and an XML version would be linked in each entry as analternateversion. this clearly makes HTML primary and XML secondary, and if all you're interested in is XML, it forces you toGETall HTML, only to ignore it and thenGETthe XML.
both approaches have advantages and disadvantages, and both are not very pretty. in addition, when adding more advanced feed-based services such as updates and push, well-defined handling of content types across the whole landscape becomes more important.
i am wondering what the more popular approach is, and why. i am also wondering whether it might be worth the effort to have a small extension that would make this more reliable in the sense that there would be a link relation for interlinking feeds that carry the same content, but using different content types. it could be as simple as having such a link on the feed level:
<link rel="alternate-content" href="..." content-type="application/xml"/>
is that something that would be worth doing? it could become more sophisticated (and complicated) by allowing other feed parameters
to be negotiated, such as feed formats (here's an RSS version of me
), feed variants (here is the feed with breaking news only
, here's the feed with abstracts only
), and probably a variety of other things. currently, i would be tempted to do the simple version only, but i am really curious to find out in which cases these problems already have been solved, in which way they have been solved, and whether standardizing this might provide some value.
[[ a pointer to this entry has been posted to the atom-syntax mailing list. ]]