So I’ve spent the last few days trying to get my head around RDFa, and I gotta say, it’s not easy. Excessive complexity is a charge often levelled against RDF and it’s something that RDFa was meant to mitgate. Has it been successful in that? I would say partially, yes.
RDFa is pretty easy to understand when you’re looking at marked up content. Here’s an example of a vcard done up RDFa-style from w3.org:
<p class="contactinfo" about="http://example.org/staff/jo" xmlns:contact="http://www.w3.org/2001/vcard-rdf/3.0#"> <span property="contact:fn"> Jo Smith </span>. <span property="contact:title"> Web hacker </span> at <a rel="contact:org" href="http://example.org"> Example.org </a>. You can contact me <a rel="contact:email" href="mailto:jo@example.org"> via email </a>. </p>
Ok, that’s clear enough. The namespace thing might be a little tricky until it’s explained but even without getting that part… “contact:fn” ok probably full name, “contact:title” job title, “contact:org” organisation… you get the idea.
Manu Sporny put together a RDFa video tutorial which is great introduction to RDFa. It introduces triples and the basics of using vocabularies which really are the foundation of RDFa.
Ok, cool. I start looking at ccREL and I’m seeing all kinds of connections to what we’re doing. “Why don’t we just use ccREL?” I’m thinking. They’re missing a few things we want to include, namely terms to describe the attribution trail so I start digging around Dublin Core and end up at the DCMI Metadata Terms. Ok, why didn’t Creative Commons use this? There’s lots we can use in the DCMI Metadata Terms too but I’m still not seeing anything for maintaining attribution trails in the way we’ve discussed but at least we’ve found a Dublin Core Vocabulary that meets 90% of our needs.
So onto write a RDFa vocabulary document to define the terms we need. Oh look! w3.org even has a chapter titled “3.1 Creating a Custom Vocabulary and Using Compact URIs“. Here’s what they say about creating a custom vocabulary:
Some structured-data concepts, such as
dc:title,dc:date, etc. can be clearly reused from the Dublin Core vocabulary, but other concepts, such as lens settings, camera model, and other photographer parameters, may need to be defined from scratch. For this purpose, Shutr defines a vocabulary namespace URI:
http://shutr.net/vocab/1.0/Shutr can then publish terms such as
http://shutr.net/vocab/1.0/takenWithCamera,http://shutr.net/vocab/1.0/aperture, etc.
Sorry, how exactly does that work? No links, no examples, and hardly even the slightest hint of how to accomplish what’s in the bleeding chapter title! This is where RDFa fails to mitigate the complexity of RDF. Or perhaps they’re just failing to provide documentation. Or perhaps I’m just failing to find it. To boot, this chapter has been removed from the latest version of that document. Now creating vocabularies isn’t mentioned at all.
I see this as a big problem for adoption. To describe the RDFa documentation as daunting is to be generous. Here’s the document describing the RDFa syntax. Betcha haven’t seen a scrollbar handle that short for a while.
Now I don’t mean to be overly-critical here. That document is a monumental achievement and is a fantastic resource serving an important function. But RDFa needs something aimed at helping people who wish to use the tech without necessarily becoming RDFa gurus.
We came across an email thread at lists.whatwg.org where the possibility of including RDFa in HTML5 is discussed. It essentially boils down to:
RDFa: include our attributes please!
HTML5 (mainly Ian Hickson): use the existing tags.
RDFa: but we have namespaces and our structured markup will solve all kinds of problems.
HTML5: users won’t implement it correctly anyhow, look at the mess that metadata is right now.
And rinse, and repeat.
Part of me has to agree with Ian Hickson, especially in light of the difficulty I’ve had digesting this format. Most of the time when I need to learn a new language I’ll hack around with it trying various things. When I’m doing something wrong I get errors and I can refine my process until I get no errors. Then I know that at least I’m getting the syntax right and I can build from there. With RDFa I don’t have that luxury.
I used w3’s validation tool to make sure my markup was well-formed and an RDFa parsor/extractor from http://arc.semsol.org/ to see if RDFa was giving me any love. This is one parser among many (but not that many) that each give a slightly different result when fed the same markup.
Ideally there is an official, litmus test, if it’s green here it’s green everywhere validation suite that will (at the least):
- Validate the vocabulary documents and turn them into a human-readable version of what each term means.
- Validate and parse XHTML/RDFa and extract the RDFa tags so you can see if what you’ve written expresses what you mean.
Without these tools we will see no end of broken and/or poorly implemented RDFa tags.
I have managed to put together the beginnings of a very simple RDFa format that supports the attribution trail we’ve been discussing. I’ll post that in a subsequent entry. I’ll be at Vancouver’s BarCamp this weekend discussing this format and the possibilities surrounding it. Hope to see some of you there.
Add New Comment
Viewing 5 Comments
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Add New Comment
Trackbacks