Re: Issue on comparing BlankNodes in the RDF API

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?

This is why we need the RDF entailments and definitions as per the RDF 
Semantics, it's not really something we can cover without them, consider:

Graph A:  _:0 a :Woman .
           _:0 :name "Jamie" .
Graph B:  _:1 a :Man .
           _:1 :name "Jamie" .

When you look at only the triples, then it would seem reasonable to 
remove [] :name "Jamie" in the merge. When really it is not, because we 
are not saying "something exists that is a Woman", "something exists 
that is a Man" and "something exists with name of Jamie"; but rather 
that "something exists which is a Woman and has a name of Jamie" 
"something exists which is a Man and has a name of Jamie".

Best,

Nathan

Received on Thursday, 28 April 2011 19:45:43 UTC