Overloading atom:category

Long on my list of things to do is to write an Atom extension to define privacy, security and visibility permissions associated with a entry. Why? Because I am looking for a logical way to represent in LiveJournal via the Atom Syndication Format and Publishing Protocol that a journal entry is visible only to friends, to family, to friends and family, to myself or to the whole world. Plus, I need a way of a representing “custom friend groups” as well so that I can represent than an entry is only visible to my work colleagues.

For the longest time I have only thought of this in terms of defining new extension elements for Atom, but a recent comment by James Snell in the Atom Syntax Mailing List turned on a light bulb for me.

With the category approach, I can group entries by Task, by File, by Event, etc. Note also that we’re making judicious use of the category scheme to differentiate the various types of categories. For instance, we have a type scheme, we have a visibility scheme (e.g. private, public), we have a status scheme (e.g. completed, not-completed), we have a tag scheme, etc.

I suppose I have been hindered by my own perception of what a “category” means, probably because of my own biases with the blogging software I use which utilizes the term “category” quite a bit to refer to a location within a rigid heirarchy.

James’ implementation (Roller I suppose) appears to take a more (perhaps) enlighened approach to using the category element within Atom feeds. Because the Atom specification assigns no meaning to the content of the category element, there is an inherent opporuntity for implementors to assign any meaning they choose.

In this case the category element is an excellent way to assign meaningful attributes to a entry, even if it is not my desire to have those attributes rendered by third party readers or aggregators. Or maybe it is my intention, but consumers of my feeds may need to be cognicent of the fact that not all categories are intended to be rendered in the same way.

A “Security” or “Privacy” extension element now feels like overkill because it is dawning on me that everthing I want to represent in my Atom feed is already nacent in the core specification and all I need to do is be more creative in leveraging it. So perhaps this is what an Atom entry for LiveJournal could look like:

  <link rel="alternate" type="text/html" href="http://community.livejournal.com/lj_dev/715256.html"/>
  <title>Google Summer of Code</title>
  <category term="soc" scheme="http://www.sixapart.com/ns/types#tag" />
  <category term="amused" scheme="http://www.sixapart.com/ns/metadata#mood" />
  <category term="Public" scheme="http://www.sixapart.com/ns/control#security" />
  <content type="html">LiveJournal is another Google Summer of Code mentor this year...</content>

Presto, category becomes a mechanism for me to add all sorts of meaningful meta data about a journal entry. I am starting to really like this idea…

Leave a comment

what will you say?

Recent Comments