Re: exists

I would like to draw the attention on  the fact that, due to different 
scoping rules between patterns and filters, we may obtain unexpected 
results.
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}}
}


Olivier

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