Namespacing RDFa attributes in custom XML vocabularies

Hi everyone,

We're looking at using RDFa in custom XML vocabularies, primarily as a 
standardized way of expressing hyperlink relations, but also with an eye 
to producing linked data.

One issue we've hit with RDFa 1.1, as implemented on check.rdfa.info, is 
around namespacing.  RDFa requires that RDFa attributes be in the 
default anonymous namespace, for example:

   <example xmlns="http://ex.com/" about="http://ex.com/foo"
     rel="http://ex.com/bar" href="http://ex.com/baz"/>

is fine, but the same document in a named namespace is not:

   <ns:example xmlns:ns="http://ex.com/" ns:about="http://ex.com/foo"
     ns:rel="http://ex.com/bar" ns:href="http://ex.com/baz"/>

By itself, this presents some problems (e.g. with XML-manipulation tools 
that generate named namespaces) but we could probably work our way round 
it.  The problem comes when we reuse namespaces, for example:

   <ns1:example1 xmlns:ns1="http://ex1.com/" xmlns:ns2="http://ex2.com/"
     ns1:about="http://ex.com/foo">
     <ns2:example2 ns2:rel="http://ex.com/bar"
       ns2:href="http://ex.com/baz"/>
   </ns1:example1>

Now we have two RDFa-enabled namespaces ns1: and ns2:, but there's no 
way to build a valid XML document which combines the RDFa from both 
vocabularies.  We could do it by introducing a shared vocabulary:

   <ns1:example1 xmlns="http://ex0.com/"
     xmlns:ns1="http://ex1.com/" xmlns:ns2="http://ex2.com/"
     about="http://ex.com/foo">
     <ns2:example2 rel="http://ex.com/bar"
       href="http://ex.com/baz"/>
   </ns1:example1>

but this requries the two vocabularies to agree on a common RDFa 
namespace, which may not be possible, as they may have been written 
independently.

One possible solution to this would be a standardized RDFa namespace, 
which would be understood by RDFa processors, for example:

   <example xmlns="http://ex.com/" xmlns:rdfa="http://w3c.org/ns/rdfa#"
     rdfa:about="http://ex.com/foo" rdfa:rel="http://ex.com/bar"
     rdfa:href="http://ex.com/baz"/>

Thoughts?

Best wishes,

Alan Jeffrey.

Received on Tuesday, 22 June 2010 13:00:55 UTC