RSS1-tutorial

From RDFaWiki

Jump to: navigation, search

PLEASE NOTE THIS IS A WORK IN PROGRESS ... COMMENTS AND ADDITIONS WELCOME

Delivering RSS 1.0 in XHTML+RDFa

In the following a possible representation of RSS 1.0 in XHTML+RDFa is shown. As an example we use an RSS 1.0 feed of a certain user from a popular open micro blogging site. Further, there is an online converter available (Simple RSS2RDFa Transcoder) where you can play around yourself.

First, as with every XHTML+RDFa document, we prepare the skeleton:

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:foaf="http://xmlns.com/foaf/0.1/"
      xmlns:dc="http://purl.org/dc/elements/1.1/"
      xmlns:cc="http://web.resource.org/cc/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
      xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
      xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
      xmlns:rss="http://purl.org/rss/1.0/">
<head>
 <title>XHTML+RDFa from http://identi.ca/mhausenblas/all/rss</title>
</head>
...
</body>
</html>

Next, the channel its properties is rendered as follows:

<div about="http://identi.ca/mhausenblas/all/rss" typeof="rss:channel">
 <h1 property="rss:title">mhausenblas and friends</h1>
 <div>
  <span property="rss:description">Feed for friends of mhausenblas</span>
 </div>
 <div rel="rss:items">
  <div rel="rdf:Seq">
   <span rel="rdf:li" resource="http://identi.ca/notice/268352"></span>
   <span rel="rdf:li" resource="http://identi.ca/notice/268328"></span>
   ...  
  </div>
 </div> 

Finally, every single item is represented as so:

<div about="http://identi.ca/notice/268352">
 <a href="http://identi.ca/notice/268352">
  <span property="rss:title">dave: [FriendFeed]: Utah Open Source Conference, later this month ...</span>
  <span property="rss:link" content="http://identi.ca/notice/268352"></span>
 </a>
 <span property="dc:creator">Dave Winer</span><span property="dc:date">2008-08-11T01:54:08+00:00</span>
 <p property="rss:description">dave's status on Monday, 11-Aug-08 01:54:08 UTC</p>
</div>

Feedback

  • "rdf:li" is not a proper predicate - it's just RDF/XML syntactic sugar. TobyInk 22:58, 1 June 2009 (UTC)