SemWebDev Weblog

Musings on my ideal syntax for RDF-in-HTML

Sun Jun 24 2007 at 17:06

Looking again at the bnode comparison of µf, eRDF and RDFa I’ve been thinking about the relative advantages and disadvantages of eRDF and RDFa a bit. The great thing about GRDDL of course, is that if I come up with a syntax of my own that I prefer, I can just write a stylesheet and get on with it. I don’t need to evangelise it, or even document it.

Whether or not it’s worth the extra effort (over using an established syntax like eRDF or RDFa) is another matter of course ;).

I think my dream syntax would mainly be quite similar to eRDF, but enabling a few of the things that RDFa does.

What I like about eRDF

The main thing I like about eRDF is that all visible text and images are described with class-names. The class names, moreover, don’t contain any characters that need to be escaped in CSS. This is actually an extremely clever feature of eRDF. It encourages good separation of style and content; you can start with your content, mark it up with html and eRDF, and then when you come to style it, you have a lot of hooks to style something according to what it is.

I just read a post to public-rdf-in-xhtml-tf by someone concerned about @class being used for semantics instead of presentation. I\'ve seen this argument play out in a few places, and I\'d just like to add, not only is @class for semantics in the html spec, not only is it good practice for maintainability and so on, it\'s good practise for design.

A principle of good design is creating visual similarities between similar types of information; so it\'s a good idea to style, say, e-mail addresses the same way, and if you can use .foaf-mbox as your style hook, then so much easier for you. When I write CSS, semantic class-names make it easy for me to style elements by the type of information they contain, which helps the user visually identify them, and helps make the design consistent and clean. eRDF class names are even better because they come from shared vocabularies, which are easier to remember, understand, and re-use across projects than the ad hoc conventions I\'d use otherwise.

What I like about RDFa

The main things I like about RDFa are:

A mix of eRDF and RDFa ?

So what I want is a syntax that:

What would your ideal RDF-in-HTML syntax be like?

RDF-in-HTML RDFa eRDF