permalink.gif 2003-04-05

permalink.gif Exploring topics in RSS2.0

Sat Apr 05 10:38:33 BST 2003  Permalink 

I've been doing some thinking about how to encode topic information into RSS2.0 feeds.  As a simple test of the Radio callback facility I have implemented a very simplistic protocol.  Within each is a tag

<topic id="topic_id" type="topic-type" source="url">topic nametopic>

for each topic associated with the item (post).  A concrete example (using the rsstopics namespace):

<rsstopics:topic rsstopics:id="the_state" rsstopics:source="" rsstopics:type="generic">the statersstopics:topic>

Whilst this does have the advantage that it's simple and direct it's also a bit silly to invent a new format for topic information when we have two standard culprits available already:

RDF is a general format for describing resources.  A resource in RDF terms is anything which can be uniquely identified by a URI.  An RDF statement (utilizing Dublin Core metadata) that asserts me as the owner of my weblog might look something like:

<rdf:Description rdf:about="">
    <dc:Creator>Matt Mowerdc:Creator>

If you cut away the syntactic fluff what this says is:

Matt Mower is the Creator of

Referring back to the problem at hand, describing what a post (expressed as an RSS item) is about we could come up with something like:

<item rdf:about="permalink">
    <topic id="topic_id" type="topic-type" source="url">topic nametopic>

Which is more or less exactly where we started -- using RDF hasn't altered the solution but it has added some framework around it (in this case adding rdf:about to signal the presence of RDF data within the item).  However we can go a step further.  A useful article by Eric van der Vlist discusses this very subject and refers to the RSS1.0 taxonomy module.

Somewhat counter to what you would expect RSS2.0 does not follow on from RSS1.0, nor does RSS1.0 follow on from the popular RSS0.9x formats.  RSS1.0 is, depending upon your point of view, a step forward or an aberation.  RSS1.0 uses a modular set of RDF based tags to describe items in the RSS feed.  One such module is the Taxonomy module which is intended to allow classification of RSS channels & items.

Using the taxonomy module you create something like:

<item rdf:about="permalink">
            <rdf:li resource="topic-uri-1"/>
            <rdf:li resource="topic-uri-2"/>

Here the element contains a list (using the RDF defined Bag - or unorderer list - container element) of resources indicating topics that describe the item.  Each resource then has a  element that describes the topic.  It  might look something like:

<taxo:topic rdf:about="">

    <dc:title>The Statedc:title>

Although it's a jumble of RDF, the RSS1.0 taxonomy module, Dublic Core, and, a custom rsstopics schema this says exactly the same thing as the original:

<topic id="topic_id" type="topic-type" source="url">topic nametopic>

But do we have to deal with such an ugly mess?  Perhaps not.  Our original choices included the XML Topic Maps format.  This is a complete specification for exchanging topic information.  An example of a topic in XTM format might look something like:

<topic id="the_state">
        <topicRef xlink:href="">
        <baseNameString>The StatebaseNameString>
    <occurence id="the-state-item">
            <topicRef xlink:href="">
        <resourceRef xlink:href="">

Again this encodes the same information, using a standard format and only one required namespace (that of XTM itself).  A URI such as points at a topic in another map (in this case a topic describing the topic-type generic).

The use of XTM comes with a number of advantages with the main one being that there are an increasing number of tools available to process & manipulate it (for example, see  However there also a number of problems with this representation when you attempt to embed it within another XML format such as RSS.

  • It's not clear whether an XTM fragment such as this is valid when used in this way
  • Each time a topic is used we will be duplicating it's details, bloating the markup & potentially creating invalid entries
  • The relation within the element is technically redundant.  The enclosing indicates the occurrence. 

One way to avoid these problems would be to embed the topics within the RSS definition and refer to them from each .  However we still need a way to refer to the topic and XTM doesn't provide this.  If we had a good way to reference topics then we could either embed mini topic map within the RSS file, or just have the in an external file and point to it.  What could we use?  One possibility is RDF.

Using a combination of RDF and XTM would mean something like:

<item rdf:about="">


<item rdf:about="">

In this example the item now refers to an XTM defined topic either elsewhere in the RSS feed (contained within a valid element) or within an external topic map.  The referenced element can further describe the topic (names, types and so on) using all the expressiveness of XTM.  It's also efficient since there is no duplicated information within the feed.

I have described approaches using RDF, XTM and a hybrid of the two.  Each has advantages and disadvantages although I believe the hybrid makes the best use of both formats.

I'd welcome comments and or opinions from interested parties.