W3C home > Mailing lists > Public > semantic-web@w3.org > January 2010

Re: Turtle null prefix and namespaces

From: Damian Steer <pldms@mac.com>
Date: Mon, 18 Jan 2010 12:21:27 +0000
Message-ID: <4B545247.6020303@mac.com>
To: Richard Light <richard@light.demon.co.uk>
CC: semantic-web@w3c.org
On 18/01/10 12:02, Richard Light wrote:
> Hi,
> In writing a Turtle parser which serializes to RDF/XML, I'm hitting
> issues where RDF/XML can't represent some Turtle constructs. No
> surprises there, but I would welcome guidance on one specific issue.
> The null prefix construct (qname where the prefixname is empty), e.g.:
> @prefix : <http://example.org/> .
> ...
> :a1 :b1 :c1 .
> has the air of a default namespace about it. The temptation is to put:
> <rdf:RDF xmlns="http://example.org/" ...
> at the head of the output, output the triple as:
> <rdf:Description rdf:about="a1"><a2 rdf:resource="a3"/></rdf:Description>

That doesn't work, as you suspect, but for a different reason.

URI references, such as a1 and a3 above, are resolved relative to the 
base of the document. Namespaces are not relevant to them.

I think your best bet is to output the full URI in those cases. For 
properties (a2) using the default namespace is mostly fine. (There are 
some nasty corner cases, but you rarely see them in practice)

Received on Monday, 18 January 2010 12:22:50 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:48:05 UTC