- From: Marcelo Arenas <marcelo.arenas1@gmail.com>
- Date: Wed, 25 Apr 2012 09:31:51 +0200
- To: Enrico Franconi <franconi@inf.unibz.it>
- Cc: Juan Sequeda <juanfederico@gmail.com>, David McNeil <dmcneil@revelytix.com>, Richard Cyganiak <richard@cyganiak.de>, W3C RDB2RDF <public-rdb2rdf-wg@w3.org>
On Wed, Apr 25, 2012 at 12:29 AM, Enrico Franconi <franconi@inf.unibz.it> wrote: > > On 25 Apr 2012, at 00:25, Juan Sequeda wrote: > > Sure. Take any implementation of sparql and try the query :) > > > Well, it doesn't sound like a proof :-) > Do you have an evidence from the spec? I really missed that. > cheers > --e. > I agree with you that, logically speaking, inequality should not succeed when ?x and ?y are bound to distinct blank nodes. But the semantics of inequality (!=) is not defined in that way in SPARQL. The semantics of (A != B) in SPARQL is defined as the negation of RDFterm-equal(A, B). Function RDFterm-equal is defined in: http://www.w3.org/TR/rdf-sparql-query/#func-RDFterm-equal The definition of this function says that if A and B are blank nodes, then RDFterm-equal(A, B) is true if A and B "are the same blank node". As far as I understand, this means that (_:b1 != _:b2) should be true given that RDFterm-equal(_:b1, _:b2) should be false. As far as I know, this is the value that you obtain in any SPARQL implementation. Cheers, Marcelo > Juan Sequeda > www.juansequeda.com > > On Apr 25, 2012, at 12:22 AM, Enrico Franconi <franconi@inf.unibz.it> wrote: > > > On 25 Apr 2012, at 00:01, Juan Sequeda wrote: > >> In other words, SPARQL may give different (but equivalent) answers to >> equivalent graphs. > > > I disagree. If you compute the core (the result of removing redundant blank > nodes aka lean rdf graph), you get same answers. But if you dont compute > it, you get different answers. > > For example: > > ASK{ > ?x <IOU#BORROWER> "Alice". > ?x <IOU#AMOUNT> 10. > ?y <IOU#BORROWER> "Alice". > ?y <IOU#AMOUNT> 10. > FILTER (?x != ?y) > } > > Will return true on a non lean rdf graph (per the example below) and would > return false on a lean rdf graph. > > > Interesting. Are you sure? If this is true, I completely missed this aspect > of SPARQL: logically speaking, inequality should NOT succeed when ?x and ?y > are bound to distinct bnodes, since you can not actually prove that they map > to distinct individuals. > Anyway, what happens in SPARQL is that a BGP (for which the property I > stated above holds for sure) is evaluated against the data, and the result > of this evaluation is subsequently consumed by the SPARQL algebra. The > algebra contains quite cumbersome aspects, and it treats (erroneously) > bnodes mainly as constants. > > cheers > --e. > > > > on the le > >> >> Check out my PODS-2006 invited talk slides at >> <http://www.inf.unibz.it/~franconi/papers/franconi-slides-pods-2006.pdf>. >> cheers >> --e. >> >> On 24 Apr 2012, at 22:13, Juan Sequeda wrote: >> >> This is a non lean RDF graph and per the RDF semantics, they are >> equivalent. >> >> Gotta love the RDF semantics. >> >> So, even though they are equivalent per RDF semantics, we still maintain >> the cardinality. But if we query in SPARQL, we get two different things. >> Therefore, there is a mismatch between the semantics of SPARQL and RDF. >> Interesting, eh? >> >> Juan Sequeda >> www.juansequeda.com >> >> On Apr 24, 2012, at 9:53 PM, David McNeil <dmcneil@revelytix.com> wrote: >> >> On Tue, Apr 24, 2012 at 1:44 PM, Richard >> Cyganiak <richard@cyganiak.de> wrote: >> _:1 <IOU#BORROWER> "Alice". >> _:1 <IOU#AMOUNT> 10. >> _:2 <IOU#BORROWER> "Alice". >> _:2 <IOU#AMOUNT> 10. >> >> Maybe I don't understand blank nodes properly. I thought the graph above >> was asserting the existence of two unique resources (since there are two >> blank node IDs). >> >> Thanks. >> -David >> >> > > >
Received on Wednesday, 25 April 2012 07:32:21 UTC