W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > April 2011

Re: Issue on comparing BlankNodes in the RDF API

From: Ivan Herman <ivan@w3.org>
Date: Fri, 29 Apr 2011 11:29:52 +0200
Cc: nathan@webr3.org, RDFa WG <public-rdfa-wg@w3.org>, Manu Sporny <msporny@digitalbazaar.com>
Message-Id: <A2B2FB80-3CC5-4157-97C0-66E0F5C5EE0C@w3.org>
To: Benjamin Adrian <benjamin.horak@gmail.com>

On Apr 28, 2011, at 21:33 , Benjamin Adrian wrote:

> Am 28.04.2011 20:31, schrieb Nathan:
> 
>>> So what is the problem?
>> 
>> I checked my libs (after wondering why this wasn't a problem for me) and
>> found that I had implemented as follows:
>> 
>>  this.value = "_:b".concat(++api.BlankNode.NEXTID)
>> 
>> that's inside the blank node constructor, then the equality test just
>> checks if the values are equal.
>> 
>> this gaurantees that each blank node in the environment has a unique id,
>> and that two blank nodes are equal within that environment if they have
>> the same id.
>> 
>> certainly never had any problems with it (and I have used the code
>> heavily), and it's also the way tabulator is implemented.
>> 
>> likewise as per Ivan's note on references, two blank nodes are the same
>> with a normal == test, since they can only be the same blank node if
>> they are references to the same object.
> 
> This means if we assume two graphs:
> 
> graph A: _:0 rdfs:label "Nathan" .
> graph B: _:1 rdfs:label "Nathan" .
> 
> The graphs are unequal. When merging A and B the resulting graph C is:
> 
> graph C: _:0 rdfs:label "Nathan" .
>         _:1 rdfs:label "Nathan" .
> 
> I don't know, is this conform to the RDF semantics?

Not that I am an absolute master of Semantics, but...

If you just look at RDF and you do not consider any entailment then, yes, the merge of A and B is the graph C. It is correct that the graph C entails, under Simple RDF Entailment, both A and B, and it is also true that A and B are equivalent graphs. It is also true that the graph C is non lean, as it is called in the RDF Semantics. But these come from the fact that you used Simple RDF entailment in the process.

But... the RDF Interfaces we are talking about are silent of entailment. We are just encoding basic graphs. And I believe this is the way it should be; entailment can be implemented _on top_ of the RDF Interfaces by implementations. By the way

"The general problem of determining simple entailment between arbitrary RDF graphs is decideable but NP-complete."

Welcome to the nasty nature of blank nodes...

Ivan

> 
> Ben
> 
> 
> 


----
Ivan Herman, W3C Semantic Web Activity Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
PGP Key: http://www.ivan-herman.net/pgpkey.html
FOAF: http://www.ivan-herman.net/foaf.rdf
Received on Friday, 29 April 2011 09:28:51 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:19:51 UTC