Chapter 6. RSS 1.0 (RDF Site Summary)

Live in fragments no longer. Only connect, and the beast and the monk, robbed of the isolation that is life to either, will die.

?E. M. Forster, Howards End

Now that we're steeped in metadata and RDF syntax, it's time to move on to RSS 1.0. This standard, released in December 2000, brought about two major changes to the RSS world: the reintroduction of RDF and with it an introduction of namespaces .

The reintroduction of RDF requires key changes in the syntax of RSS, but it also introduces the advantages and concepts we dealt with in Chapter 5. Namespaces are the XML solution to the classic language problem of one word meaning two things in different contexts. Take "windows," for example. In the context of houses, "windows" are holes in the wall through which we can look. In the context of computers, "Windows" is a trademark of the Microsoft Corporation and refers to their range of operating systems. The context within which the name has a particular meaning is called its namespace.

In XML, we can distinguish between the two meanings by assigning a namespace and placing the namespace's name in front of the element name, separated by a colon, like this:

<computing:windows>This is an operating system</computing:windows>
   
<building:windows>This is a hole in a wall</building:windows>

Namespaces solve two problems. First, they allow you to distinguish between different meanings for words that are spelled the same way, which means you can use useful words more than once for different meanings. Second, they allow you to group together words that are related to each other ? using a computer to look through an XML document for all elements with a certain namespace is easy.

RSS 1.0 uses namespaces to allow for modularization. The modularization of RSS 1.0 means that developers can add new features to RSS 1.0 documents without changing the core specification. In RDF terms, this means we have included another vocabulary.

Modularization has great advantages over RSS 0.9x's method for including new elements. For starters, anyone can create a module: there are no standards issues or any need for approval, bar making sure that the namespace you use has not been used before. And, it means RSS 1.0 is potentially far more powerful that RSS 0.9x, with modules adding features for syndicating details of streaming media, Wikis, real-world events, and much more, not to mention the simplicity of adding the hundreds of vocabularies that already exist in the RDF community.

We'll look at many different modules in Chapter 7, but in the meantime, Example 6-1 shows a sample RSS 1.0 document that uses four additional modules: Dublin Core, Syndication, Company, and Text Input.

Example 6-1. A sample RSS 1.0 document
<?xml version="1.0" encoding="utf-8"?>
   
<rdf:RDF  xmlns="http://purl.org/rss/1.0/"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
  xmlns:co="http://purl.org/rss/1.0/modules/company/"
  xmlns:ti="http://purl.org/rss/1.0/modules/textinput/"
>   
   
<channel rdf:about="http://meerkat.oreillynet.com/?_fl=rss1.0">
  <title>Meerkat</title>
  <link>http://meerkat.oreillynet.com</link>
  <description>Meerkat: An Open Wire Service</description>
  <dc:publisher>The O'Reilly Network</dc:publisher>
  <dc:creator>Rael Dornfest (mailto:rael@oreilly.com)</dc:creator>
  <dc:rights>Copyright &#169; 2000 O'Reilly &amp; Associates, Inc.</dc:rights>
  <dc:date>2000-01-01T12:00+00:00</dc:date>
  <sy:updatePeriod>hourly</sy:updatePeriod>
  <sy:updateFrequency>2</sy:updateFrequency>
  <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
   
  <image rdf:resource="http://meerkat.oreillynet.com/icons/meerkat-powered.jpg" />
  <textinput rdf:resource="http://meerkat.oreillynet.com" />
   
  <items>
    <rdf:Seq>
      <rdf:li rdf:resource="http://c.moreover.com/click/here.pl?r123" />
    </rdf:Seq>
  </items>
</channel>
   
<image rdf:about="http://meerkat.oreillynet.com/icons/meerkat-powered.jpg">
  <title>Meerkat Powered!</title>
  <url>http://meerkat.oreillynet.com/icons/meerkat-powered.jpg</url>
  <link>http://meerkat.oreillynet.com</link>
</image>
   
<textinput rdf:about="http://meerkat.oreillynet.com">
  <title>Search Meerkat</title>
  <description>Search Meerkat's RSS Database...</description>
  <name>s</name>
  <link>http://meerkat.oreillynet.com/</link>
  <ti:function>search</ti:function>
  <ti:inputType>regex</ti:inputType>
</textinput>
   
<item rdf:about="http://c.moreover.com/click/here.pl?r123">
  <title>XML: A Disruptive Technology</title>
  <link>http://c.moreover.com/click/here.pl?r123</link>
  <dc:description>This the description of the article</dc:description>
  <dc:publisher>The O'Reilly Network</dc:publisher>
  <dc:creator>Simon St.Laurent (mailto:simonstl@simonstl.com)</dc:creator>
  <dc:rights>Copyright &#169; 2000 O'Reilly &amp; Associates, Inc.</dc:rights>
  <dc:subject>XML</dc:subject>
  <co:name>XML.com</co:name>
  <co:market>NASDAQ</co:market>
  <co:symbol>XML</co:symbol>
</item>
</rdf:RDF>