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

Namespacing RDFa attributes in custom XML vocabularies

From: Alan Jeffrey <ajeffrey@bell-labs.com>
Date: Mon, 21 Jun 2010 11:12:04 -0500
Message-ID: <4C1F8F54.8070105@bell-labs.com>
To: <public-rdfa@w3.org>
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/"
     <ns2:example2 ns2:rel="http://ex.com/bar"

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/"
     <ns2:example2 rel="http://ex.com/bar"

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

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"


Best wishes,

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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:04:46 UTC