Tim Bray’s RPV syntax for RDF
Frustrated with the existing XML syntax for RDF, Tim Bray has proposed an alternative syntax which, he claims, is more readable and easier to use than the existing syntax. As an experiment I tried to convert my RSS feed into RPV to see how much simpler it would be.
The first obstacle was representing the <items> element which defines the sequence of items in a channel (i.e. reverse chronological). I can't see how to replicate this in RPV.
The second problem was the inconvenience of the RPV syntax when expressing properties from disparate namespaces. I settled on having multiple <R> elements grouping the seperate properties. The alternative is to include the full namespace uri in the p attribute of each <PV> element which makes it particularly unreadable.
Also, I couldn't see from the spec how to make a property value refer to a resource. For example in the RDF version, the generatorAgent refers to a resource about which I could make additional assertions such as web page uri or agent name. I can't see how to do this in RPV.
RSS 1.0 file using current RDF syntax:
<?xml version="1.0" encoding="iso-8859-1"?> <rdf:RDF 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:admin="http://webns.net/mvcb/" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns="http://purl.org/rss/1.0/"><channel rdf:about="http://blog.iandavis.com/"> <title>Internet Alchemy</title> <link>http://blog.iandavis.com/</link> <description>Internet Alchemy is a place for a meeting of Internet minds. Just about anything goes here, so long as it’s pushing the boundaries of Internet knowledge.</description> <dc:language>en</dc:language> <admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=2.21" /> <sy:updatePeriod>daily</sy:updatePeriod> <sy:updateFrequency>2</sy:updateFrequency> <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
<items> <rdf:Seq> <rdf:li rdf:resource="http://blog.iandavis.com/2002/11/rddlWithRDF.html" /> <rdf:li rdf:resource="http://blog.iandavis.com/2002/11/foafInMyRSS.html" /> </rdf:Seq> </items>
</channel>
<item rdf:about="http://blog.iandavis.com/2002/11/rddlWithRDF.html"> <title>RDDL With RDF</title> <description>Tim Bray has announced a new draft of the RDDL spec for describing documents associated with a namespace. Interestingly, this…</description> <link>http://blog.iandavis.com/2002/11/rddlWithRDF.html</link> <dc:subject>RDF</dc:subject> <dc:creator><foaf:Person><foaf:name>Ian Davis</foaf:name><foaf:homepage rdf:resource="http://blog.iandavis.com/iand/"/><foaf:mbox_sha1sum rdf:value="69e31bbcf58d432950127593e292a55975bc55fd" /><rdfs:seeAlso rdf:resource="http://blog.iandavis.com/iand/foaf.rdf" /></foaf:Person></dc:creator> <dc:date>2002-11-11T17:30:03</dc:date> <dc:format rdf:resource="http://www.isi.edu/in-notes/iana/assignments/media-types/text/html" /> </item>
<item rdf:about="http://blog.iandavis.com/2002/11/foafInMyRSS.html"> <title>FOAF in My RSS</title> <description>I’ve been experimenting with adding FOAF information to my RSS 1.0 feed. This has been discussed before but I’m trying…</description> <link>http://blog.iandavis.com/2002/11/foafInMyRSS.html</link> <dc:subject>RSS</dc:subject> <dc:creator><foaf:Person><foaf:name>Ian Davis</foaf:name><foaf:homepage rdf:resource="http://blog.iandavis.com/iand/"/><foaf:mbox_sha1sum rdf:value="69e31bbcf58d432950127593e292a55975bc55fd" /><rdfs:seeAlso rdf:resource="http://blog.iandavis.com/iand/foaf.rdf" /></foaf:Person></dc:creator> <dc:date>2002-11-11T10:29:02</dc:date> <dc:format rdf:resource="http://www.isi.edu/in-notes/iana/assignments/media-types/text/html" /> </item>
</rdf:RDF>
Equivalent RSS 1.0 file using RPV syntax:
<rss xmlns="http://www.rdf.net/rpv/"> <!-- RSS Channel properties --> <R r="http://blog.iandavis.com/" pBase="http://purl.org/rss/1.0/"> <PV p="title">Internet Alchemy</PV> <PV p="description">Internet Alchemy is a place for a meeting of Internet minds. Just about anything goes here, so long as it's pushing the boundaries of Internet knowledge.</PV> </R><!– Dublin Core properties –> <R r="http://blog.iandavis.com/" pBase="http://purl.org/dc/elements/1.1/"> <PV p="language">en</PV> </R>
<!– Admin module properties –> <R r="http://blog.iandavis.com/" pBase="http://webns.net/mvcb/"> <PV p="generatorAgent" v="http://www.movabletype.org/?v=2.21" /> </R>
<!– Syndication module properties –> <R r="http://blog.iandavis.com/" pBase="http://purl.org/rss/1.0/modules/syndication/"> <PV p="updatePeriod>daily</PV> <PV p="updateFrequency>2</PV> <PV p="updateBase>2000-01-01T12:00+00:00</PV> </R>
<R r="http://blog.iandavis.com/2002/11/rddlWithRDF.html" pBase="http://purl.org/rss/1.0/"> <PV p="title">RDDL With RDF</PV> <PV p="description">Tim Bray has announced a new draft of the RDDL spec for describing documents associated with a namespace. Interestingly, this…</PV> <PV p="link">http://blog.iandavis.com/2002/11/rddlWithRDF.html</PV> </R>
<R r="http://blog.iandavis.com/2002/11/rddlWithRDF.html" pBase="http://purl.org/dc/elements/1.1/"> <PV p="subject>RDF</PV> <PV p="date>2002-11-11T17:30:03</PV> <PV p="format v="http://www.isi.edu/in-notes/iana/assignments/media-types/text/html" /> </R>
<R r="http://blog.iandavis.com/2002/11/foafInMyRSS.html" pBase="http://purl.org/rss/1.0/"> <PV p="title">FOAF in My RSS</PV> <PV p="description">I’ve been experimenting with adding FOAF information to my RSS 1.0 feed. This has been discussed before but I’m trying…</PV> <PV p="link">http://blog.iandavis.com/2002/11/foafInMyRSS.html</PV> </R>
<R r="http://blog.iandavis.com/2002/11/rddlWithRDF.html" pBase="http://purl.org/dc/elements/1.1/"> <PV p="subject>RSS</PV> <PV p="date>2002-11-11T10:29:02</PV> <PV p="format v="http://www.isi.edu/in-notes/iana/assignments/media-types/text/html" /> </R>
</rss>
Finally, maybe I've been working with RDF for too long, but the existing RDF seems easier to read for me. I don't have to keep looking around for context when I'm looking at property names.
My conclusion is that RPV is interesting as a simple property/value syntax. The problem is that you don't need RDF for that, just use standard XML, which would be clearer:
<rss:channel> <rss:title>Internet Alchemy</rss:title> <rss:description>Blah blah</rss:description> </rss:channel>
So I'm not sure what RPV buys you over this simple XML. It doesn't seem to address the same problem as RDF. There are other proposals for alternate RDF syntaxes such as A strawman Unstriped syntax for RDF in XML and Simplified Syntax for RDF. Leigh Dodds wrote an article a while back which discusses some of the issues: Instant RDF?