13.2 RSS 1.0: A Quick Introduction


RSS 1.0 is an RDF vocabulary and as such must follow the rules and specifications associated with RDF. However, the developers of RSS 1.0 wanted to constrain the specification's XML syntax in order to simplify the development of tools and technologies to generate and consume RSS. Based on this, RSS always validates as proper RDF, but a non-RSS RDF model won't necessarily validate as proper RSS. Validation is constrained from RSS to RDF, but not the reverse.

Example 13-1 shows a portion of the RSS for my own weblog (generated by the weblogging tool Movable Type, found at http://www.movabletype.org).

Example 13-1. RSS 1.0 generated by Movable Type
 <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl. org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/"> <channel rdf:about="http://weblog.burningbird.net/"> <title>Burningbird</title> <link>http://weblog.burningbird.net/</link> <description></description> <items> <rdf:Seq> <rdf:li rdf:resource="http://weblog.burningbird.net/archives/000472.php" /> <rdf:li rdf:resource="http://weblog.burningbird.net/archives/000471.php" /> </rdf:Seq> </items> </channel> <item rdf:about="http://weblog.burningbird.net/archives/000472.php"> <title>Serendipity, all over again</title> <description>When I wrote the previous posting, &quot;How Green is my  Valley&quot;, I referenced both my old hometown, Kettle Falls, Washington, and a posting by Loren, otherwise known as In a Dark Time.  At the time that I read Loren's weblog,... </description> <link>http://weblog.burningbird.net/archives/000472.php</link> <dc:subject>Virtual Neighborhood</dc:subject> <dc:creator>shelley</dc:creator> <dc:date>2002-08-23T15:07:57-06:00</dc:date> </item> <item rdf:about="http://weblog.burningbird.net/archives/000471.php"> <title>How Green is my Valley</title> <description>The housing complex that I live in is quite large, with small  buildings consisting of a combination of townhomes and flats. One of the nicest  aspects of the place is all the trees and plants and green areas,  including our... </description> <link>http://weblog.burningbird.net/archives/000471.php</link> <dc:subject>Mother Nature</dc:subject> <dc:creator>shelley</dc:creator> <dc:date>2002-08-23T12:49:24-06:00</dc:date> </item> </rdf:RDF> 

In the example, two weblog entries are described. The required RDF enclosing tag is included, and each RSS item is defined first as an RDF container element, and later given a title and description, as well as entry author, subject (category), and date. The content is valid RDF, as you'll find if you run it through the RDF Validator (described in Chapter 3).

However, if you're used to working with RDF, you may notice that the primary element of interest in the document isn't defined using the RDF Description tag, as was demonstrated in many of the examples in previous chapters. Instead, a typed node of channel is used. The RSS Working Group used this approach to simplify processing of the RSS. By using a typed node, standard XML processing can pull information from this RSS file without having to be aware of any more complex RDF mechanisms. Additionally, the use of the typed node also ensures backward compatibility with RSS 0.9 (though not with RSS 0.91 and the other Userland RSS releases).

This RSS feed also makes use of one core RSS module, the specialized Dublin Core module, discussed later in the chapter.



Practical RDF
Practical RDF
ISBN: 0596002637
EAN: 2147483647
Year: 2003
Pages: 131

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net