So yesterday morning, I saw that Tim Bray had ranted a bit about how ugly RDF is and his replacement for the spec with something he calls RPV, which stands for Resource Property Value. It uses the same Sematic Web concepts, but in a much clearer syntax. I've been struggling with this stuff for months now, so seeing this really turned on some lights inside my skull. I REALLY like it! I can see immediately its value, unlike the horror that is RDF. I was thinking about it all day in fact...
However, at first I only *sorta* got it because Tim's markup is still a little unclear. To help me understand it a bit more, I pulled the text from his example into an editor and replaced the element names with their full names (resource instead of just R for example) and made it all lowercase. This allowed me to "see" it a lot better and made a huge improvement. So I zipped off a quick email to Tim and suggested that he think about modifying RPV to look more like this:
<rpv xmlns="http://www.rdf.net/rpv/"> <resource id="Dave" pbase="http://www.example.com/terms/"> <property id="fullName">Dave Beckett</property> <property id="homePage">http://purl.org/net/dajobe</property> </resource> <resource id="http://www.w3.org/TR/rdf-syntax-grammar"> <property id="http://www.example.com/terms/editor">#Dave</property> <property id="http://purl.org/dc/elements/1.1/title"> RDF/XML Syntax Specification (Revised) </property> </resource> </rpv>
I figured Tim would blow the email off because he's the XML god and I'm just some nut. But he actually responded and agreed that it made the original RPV markup a bit more understandable, but pointed out that in the editor property above it isn't clear whether #Dave is a link or a string. This of course makes sense.
So after all day off line thinking about it when I wasn't messing with my real work, I decided to send another sample back to Tim (because I'm like that. ;-) ). Here's what I wrote to him:
...if you take for a moment your argument that readability and writeability is key for adoption of a new technology (which I totally agree with) then I would say that making the syntax as compatible to HTML as possible would be the quickest path to success since there are already a bajillion people who can read/write that syntax with ease. Right?
So on this draft, I simply changed "id" for "name" (which is just like the <a> tag) and then added hrefs for values that are not explicitly stated. (I guess if both the href and the value are present, the value become "meta data" for the link similar to what the <a> tag does.)
Suddenly you have VERY readable markup! Whether it's the Semantic Web or not, I'm not sure, but I bet you a lot more people would grok the idea if you showed them this:
<rpv xmlns="http://www.rdf.net/rpv/"> <resource name="Dave" pbase="http://www.example.com/terms/"> <property name="fullName">Dave Beckett</property> <property name="homePage">http://purl.org/net/dajobe</property> </resource> <resource href="http://www.w3.org/TR/rdf-syntax-grammar"> <property name="http://www.example.com/terms/editor" href="#Dave" /> <property name="http://purl.org/dc/elements/1.1/title"> RDF/XML Syntax Specification (Revised) </property> </resource> </rpv>
The key is that I'm really not sure if I've got enough control over the Semantic Web concepts to know if that's right, but I definitely like how it looks. I could see me exporting data from a DB or incorporating a dozen different data structures right now into that format. Anyone who's ever downloaded Moblogger knows that I have a "settings.xml" document that works on the same idea of labeling properties with their names. The idea of having a property link to another resource is cool as hell.
This morning it looks like Tim likes some of what I was thinking (thanks Tim!!), but still keeps his original attribute names of r and p, but does use the word "value". I'm not sure exactly what his reasoning is (and I'm sort of afraid of emailing and bugging him again. ;-)). My thoughts is that having a attribute which is the same initial as the element doesn't add to the descriptiveness of the markup. It might be concise, but it's not descriptive and leaves the writer/developer of the doc (or reader) with questions as to why exactly there's both an r and a p, for example can I have a property with both an r and a p? It's as annoying as having a namespace the same name as the root element (RDF:rdf anyone?).
Anyways, this is a nice diversion from the XHTML hell I'm in right now, but without distracting me too far away from XML. I'll leave it to the experts to hash out now.