RSS-Data

Jeremy Allaire points out:



In some respects, RSS is a great message envelope for asynchronous data, but without an over-the-wire data format.



which is true enough for RSS 2.0, but isn't the case for RSS 1.0, as it has a data format (RDF/XML) and even better, sophisticated data model provided by RDF.

But Jeremy proposes using RSS 2.0 with the data format of XML-RPC. My first impression is that this is really awful! XML-RPC has been outmoded by both SOAP and simpler RESTful approaches, it's data model is an unnecessary complication; RSS 2.0 doesn't lend itself to extension very well. Combining them sounds like a recipe for hard work/little gain.

Anyway Les Orchard has made an example of data from Amazon expressed first in namespaced RSS 2.0, then in RSS-Data.

Jeremy's main arguments about not using RDF follow the tired lines of complexity, hard to read etc. Below is Les's Amazon example, expressed in RDF.

This looks very similar to the RSS 2.0 example, but is expressed within a well-defined data model. So it's doing what Jeremy suggests is simpler in Les's +XML-RPC example, which I've copied at the bottom.

<rdf:RDF xmlns:syn="http://purl.org/rss/1.0/modules/syndication/"

    xmlns:content="http://purl.org/rss/1.0/modules/content/"

    xmlns:dcterms="http://purl.org/dc/terms/"

    xmlns:dc="http://purl.org/dc/elements/1.1/"

    xmlns:rss="http://purl.org/rss/1.0/"

    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

    xmlns:az="http://www.amazon.com/gp/aws/landing.html">

<rss:channel rss:about="">

    <rss:title>Testing Amazon Namespace</rss:title>

    <rss:items>

    <rdf:Seq>

        <rdf:li rdf:resource="#N40000D"/>

    </rdf:Seq>

    </rss:items>

</rss:channel>

<rss:item rdf:about="#N40000D">

<rss:title>Harry Potter and the Goblet of Fire (Book 4)</rss:title>

    <az:ProductInfo>

        <az:Details url="http://www.amazon.com/exec/obidos/ASIN/0439139597/0xdecafbad-20″>

            <az:Asin>0439139597</az:Asin>

            <az:ProductName>Harry Potter and the Goblet of Fire (Book 4)</az:ProductName>

            <az:Catalog>Book</az:Catalog>

            <az:Authors rdf:parseType="Resource">

            <az:Author>J. K. Rowling</az:Author>

            <az:Author>Mary GrandPr</az:Author>

            </az:Authors>

            <az:ReleaseDate>08 July, 2000</az:ReleaseDate>

            <az:Manufacturer>Scholastic</az:Manufacturer>

            <az:ImageUrlSmall>http://images.amazon.com/images/P/0439139597.01.THUMBZZZ.jpg</az:ImageUrlSmall>

            <az:ImageUrlMedium>http://images.amazon.com/images/P/0439139597.01.MZZZZZZZ.jpg</az:ImageUrlMedium>

            <az:ImageUrlLarge>http://images.amazon.com/images/P/0439139597.01.LZZZZZZZ.jpg</az:ImageUrlLarge>

            <az:Availability>Usually ships within 24 hours</az:Availability>

            <az:ListPrice>$25.95</az:ListPrice>

            <az:OurPrice>$18.16</az:OurPrice>

            <az:UsedPrice>$3.97</az:UsedPrice>

        </az:Details>

    </az:ProductInfo>

</rss:item>

</rdf:RDF>

Here's Les's RSS-Data version:

<rss version="2.0"
  xmlns="http://blogs.law.harvard.edu/tech/rss"
 
xmlns:sdl="http://radio.weblogs.com/0113297/2003/10/01.html#a237">
  <channel>
    <title>Testing Amazon Namespace</title>
    <item>
      <title>A Sample Item</title>
      <sdl:data>
        <sdl:struct>
          <sdl:member>
            <sdl:name>url</sdl:name>
            <sdl:value>
             
<sdl:string>http://www.amazon.com/exec/obidos/ASIN/0439139597/0xdecafbad-20</sdl:string>
            </sdl:value>
          </sdl:member>
          <sdl:member>
            <sdl:name>Asin</sdl:name>
           
<sdl:value><sdl:string>0439139597</sdl:string></sdl:value>
          </sdl:member>
          <sdl:member>
            <sdl:name>ProductName</sdl:name>
            <sdl:value>
              <sdl:string>
                Harry Potter and the Goblet of Fire (Book 4)
              </sdl:string>
            </sdl:value>
          </sdl:member>
          <sdl:member>
            <sdl:name>Catalog</sdl:name>
           
<sdl:value><sdl:string>Book</sdl:string></sdl:value>
          </sdl:member>
          <sdl:member>
            <sdl:name>Authors</sdl:name>
            <sdl:value>
              <sdl:array>
                <sdl:data>
                  <sdl:value>J. K. Rowling</sdl:value>
                  <sdl:value>Mary GrandPr</sdl:value>
                </sdl:data>
              </sdl:array>
            </sdl:value>
          </sdl:member>
          <sdl:member>
            <sdl:name>ReleaseDate</sdl:name>
            <sdl:value>
             
<sdl:dateTime.iso8601>2000-07-08T00:00:00</sdl:dateTime.iso8601>
            </sdl:value>
          </sdl:member>
          <sdl:member>
            <sdl:name>Manufacturer</sdl:name>
           
<sdl:value><sdl:string>Scholastic</sdl:string></sdl:value>
          </sdl:member>
          <sdl:member>
            <sdl:name>ImageUrlSmall</sdl:name>
            <sdl:value>
             
<sdl:string>http://images.amazon.com/images/P/0439139597.01.THUMBZZZ.jpg</sdl:string>
            </sdl:value>
          </sdl:member>
          <sdl:member>
            <sdl:name>ImageUrlMedium</sdl:name>
            <sdl:value>
             
<sdl:string>http://images.amazon.com/images/P/0439139597.01.MZZZZZZZ.jpg</sdl:string>
            </sdl:value>
          </sdl:member>
          <sdl:member>
            <sdl:name>ImageUrlLarge</sdl:name>
            <sdl:value>
             
<sdl:string>http://images.amazon.com/images/P/0439139597.01.LZZZZZZZ.jpg</sdl:string>
            </sdl:value>
          </sdl:member>
          <sdl:member>
            <sdl:name>Availability</sdl:name>
            <sdl:value><sdl:string>Usually ships within
24 hours</sdl:string></sdl:value>
          </sdl:member>
          <sdl:member>
            <sdl:name>ListPrice</sdl:name>
           
<sdl:value><sdl:string>$25.95</sdl:string></sdl:value>
          </sdl:member>
          <sdl:member>
            <sdl:name>OurPrice</sdl:name>
           
<sdl:value><sdl:string>$18.16</sdl:string></sdl:value>
          </sdl:member>
          <sdl:member>
            <sdl:name>UsedPrice</sdl:name>
           
<sdl:value><sdl:string>$3.97</sdl:string></sdl:value>
          </sdl:member>
        </sdl:struct>
      </sdl:data>
    </item>
  </channel>
</rss>

Which would you say is easier to read?

(and legibility is probably the weakest argument against using RSS 1.0)

Jeremy Allaire's Radio

PS. Roger sees the advantage of a common data model, but fails to see the ugliness of XML-RPC. There are already tools to do the handling of what he calls 'random' data in RDF (i.e. stuff from vocabularies unknown to the aggregator), an example is the BrownSauce browser (this is avtually one of the key benefits of RDF over vanilla XML, that the framework allows you to meaningfully mix material described in different schemas). I couldn't see a live version of BrownSauce running anyware (is there one?) so as an alternative demonstration, take a look at the graph the RDF Validator creates. This is structurally rich, yet the validator knows nothing about the Amazon namespace. The same kind of result as Jeremy and Roger are pointing to, without the horrid syntax, and with a completely extensible model and format.

I made a little mistake above, az:Authors needed the attribute rdf:parseType="Resource", now corrected

[Danny Ayers]

Danny Ayers
1970-01-01T01:00:00Z

Related
Comments
Edit