W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > April to June 2010

Re: exists

From: Olivier Corby <Olivier.Corby@sophia.inria.fr>
Date: Wed, 26 May 2010 10:17:36 +0200
Message-ID: <4BFCD920.1040506@sophia.inria.fr>
To: SPARQL Working Group <public-rdf-dawg@w3.org>
I would like to draw the attention on  the fact that, due to different 
scoping rules between patterns and filters, we may obtain unexpected 
In the example below, the first query returns a result while the second 
query fails.
So, if I check the existence of a pattern it succeeds but if I check the 
pattern itself, it fails.

:Jules :memberOf :abc
:Jules :related  :Jim
:Jim   :memberOf :def

select * where {
?x n:memberOf ?org .
filter(exists {{?x n:related ?y} minus {?y n:memberOf ?org}})

select * where {
?x n:memberOf ?org .
{{?x n:related ?y} minus {?y n:memberOf ?org}}

Received on Wednesday, 26 May 2010 08:18:13 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:01:00 UTC