Re: Turtle comments

On 15/07/11 16:57, Eric Prud'hommeaux wrote:
>>> >  >  Is it legal to define a prefix twice?  What does it mean if you do?
>>> >  >
>>> >  >  @prefix foo:<http://foo.com/ns#>
>>> >  >  @prefix foo:<http://bar.com/ns#>
>>> >  >
>>> >  >  What does foo:bar mean?
>> >
>> >  Ah, yes. MMm... turtle does handle it but it's very much an anti
>> >  pattern. Worth mentioning as an anti pattern that doesn't break
>> >  parsing? Is mentioned in section 3 "Subsequent @prefix may re-map the
>> >  same local name." ... it doesn't remap the local part does it? It
>> >  remaps the prefix.
> This is a question I hoped to get the WG to answer.
> http://dvcs.w3.org/hg/rdf/raw-file/01b18ef38e10/rdf-turtle/index.html#namespaces
> takes a conservative stance and says
>    [[
>    assign a namespace name (IRI_REF) for the prefix (PNAME_NS)
>    ]]
> which I take to not prohibit overriding or duplicating prefix declarations.

Add also:

@base <http://example/a/b/c> .

<s> <p> <o> .

@base <http://example/d/e/f> .

<s> <p> <o> .

Allowing multiple declarations of a prefix or base to mean "replace 
active definition" helps when concatenting files or other fragments of 
Turtle.

(only labelled bnodes get in the way of concatenation of valid fragment)

 Andy

Received on Friday, 15 July 2011 16:22:19 UTC