

Re: Scope of blank node labels in TriG/N-Quads

From: Andy Seaborne <andy.seaborne@epimorphics.com>
Date: Thu, 06 Sep 2012 11:57:05 +0100
Message-ID: <50488181.3070806@epimorphics.com>
To: public-rdf-wg@w3.org

On 06/09/12 09:34, Ivan Herman wrote:
> (I did not participate in yesterday's discussion because there was a
> terrible noise around our building, it even made it difficult to
> follow the call:-(
> I must admit that I was also a little bit uneasy about the shared
> bnode issue, like Richard was (though not that strongly, my vote was
> a -0 :-). However... my understanding is (Andy, correct me if I am
> wrong) that SPARQL has already made a decision, ie, that a blank node
> id in a SPARQL query/select/update pattern is scoped to the whole
> pattern, regardless of possible GRAPH usage.
> Although we have not (yet) made a formal decision that TriG should be
> as compatible to SPARQL as Turtle is, I do believe that should be the
> case. Ie, if the answer to my previous question is yes, then I firmly
> believe we should do the same for TriG.
> Ivan


The result set example is clear-cut because there is no other scope than 
file and there is no info about which graph a result came from (which is 
a meaningless concept anyway).

The grammar isn't so clear - query has always had a restriction:

The same blank node label may not be used in two separate basic graph 
patterns with a single query.
but that bans the same label, not makes it have different meanings.

It's there because entailment works on BGPs - a share bNode would be a 
shared variable across BGPs-with-entailment.  That's meaningless for 
more powerful entailment regimes.  Underlying that is the idea that same 
label would mean the same bNode.

There are places bNodes (labels or otherwise) are not allowed in SPARQL 
Update - SPARQL-WG spent much more time of banning the things than 
allowing them :-)

DELETE DATA { _:a :p :o }
# Fresh bNode - can't be in the data.

There's a syntax test for shared bNodes in update:

   GRAPH<g1> { _:b1 :p :o }
   GRAPH<g2> { _:b1 :p :o }

but it's only syntax, showing you can use the same label twice in SPARQL 
Update, not what it means.

There is a test about shared bNodes (recording the result would have 
much easier if we had a format with labels across graphs).

So shared bNodes are recognized.  I don't think anyone has considered 
graph stores that can't be serialized (dumped, or part extracted for 

[Note to self - eventually add some text to grammar section to be 
explicit about this]


c.f. concatenating two Turtle files - it's not the same as reading one 
file then reading the other.
Received on Thursday, 6 September 2012 10:57:38 GMT
