W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > March 2010

Re: Another way other than @profile, @vocab or @map

From: Toby Inkster <tai@g5n.co.uk>
Date: Sat, 20 Mar 2010 22:43:14 +0000
To: Manu Sporny <msporny@digitalbazaar.com>
Cc: RDFa WG <public-rdfa-wg@w3.org>
Message-ID: <1269124995.8745.26.camel@ophelia2.g5n.co.uk>
On Fri, 2010-03-19 at 22:05 -0400, Manu Sporny wrote:
> Mark's UK consultation work is one use case that demonstrates[1] that
> mixing vocabularies to create RDFa Profiles/Argots are helpful. [...]
> 
> Digital Bazaar (my company) would like to mix the Music Ontology with
> the Good Relations Ontology in a way that bloggers could express music
> for purchase without having to invent a new vocabulary, and making it
> as easy to use (correctly) as a Microformat[3]. 

These are laudable goals, but in my mind not enough to justify the RDFa
profiles approach. There's more than one way to do this.

Let's take a simple case of mixing two well known RDF vocabularies: FOAF
and Dublin Core. We wish to note that a foaf:Document has a dc:title.

In RDFa 1.0, this might be:

	<html xmlns="http://www.w3.org/1999/xhtml"
	      xmlns:dc="http://purl.org/dc/terms/"
	      xmlns:foaf="http://xmlns.com/foaf/0.1/"
	      xml:lang="en">
	  <head typeof="foaf:Document">
	    <title property="dc:title">Foo</title>
	  </head>
	  ...
	</html>

So, how could we allow these terms from different vocabularies to be
used in RDFa 1.1 without as much fuss? Firstly, we define a mechanism
for setting a default prefix - I'll use the attribute @vocab in this
example:

	<html xmlns="http://www.w3.org/1999/xhtml"
	      vocab="http://example.com/my-vocab#"
	      xml:lang="en">
	  <head typeof="Document">
	    <title property="title">Foo</title>
	  </head>
	</html>

So what have we achieved? We end up with these two triples:

	<>
	  <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
	    <http://example.com/my-vocab#Document> .
	<>
	  <http://example.com/my-vocab#title>
	    "Foo"@en .

Not quite what we wanted, but still... suppose the vocab document at
<http://example.com/my-vocab> contains the following triples:

	<http://example.com/my-vocab#Document>
	  <http://www.w3.org/2000/01/rdf-schema#subClassOf>
	    <http://xmlns.com/foaf/0.1/Document> .
	<http://example.com/my-vocab#title>
	  <http://www.w3.org/2000/01/rdf-schema#subPropertyOf>
	    <http://purl.org/dc/terms/title> .

Then by strapping an RDFS processor on to our RDFa pipeline, we can add
the following two triples to our RDFa output:

	<>
	  <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
	    <http://xmlns.com/foaf/0.1/Document> .
	<>
	  <http://purl.org/dc/terms/title>
	    "Foo"@en .

Which were the triples we wanted.

Yes, I realise RDFS reasoning is not necessarily a simple thing to
implement, but given a choice between:

1. default prefixes: perform very RDFa1.0-like parsing, then, if you
want to, perform (perhaps only limited) RDFS reasoning later on in the
toolchain.

2. profiles: add recursive HTTP fetching, parsing and RDF querying to
the RDFa parser itself.

I'm still not convinced that #2 is really the simplest option. I'm not
saying that I can't be convinced, just that I'm not convinced so far.

Bundling multiples ontologies/vocabularies is a great idea, but @profile
is not the only way to do it, and not necessarily the best way to do it.

-- 
Toby A Inkster
<mailto:mail@tobyinkster.co.uk>
<http://tobyinkster.co.uk>
Received on Saturday, 20 March 2010 22:44:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 27 April 2012 04:55:06 GMT