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

Re: exists

From: Axel Polleres <axel.polleres@deri.org>
Date: Tue, 25 May 2010 13:37:38 +0100
Cc: "SPARQL Working Group" <public-rdf-dawg@w3.org>
Message-Id: <146453FC-6579-410A-A874-BADCCCF201F6@deri.org>
To: Olivier Corby <Olivier.Corby@sophia.inria.fr>
I would assume that existing bindings should prevail in an exists
pattern... i.e. before computing the filter, you replace all variables with all existing (non-null) bindings...
do you see any problem with that?


just thinking out loud... would that also work with unbounds from optionals?
seems not to be a problem... e.g.

let't assume graph:

g1:
 a p b
 a q p

q1:
> select ?x ?y where {
> ?x p ?y OPTIONAL { ?y q ?z}
> filter( ! exists {?y q ?z })


would return {?x/a ?y/b}, whereas

q2:
> select ?x ?y where {
> ?x p ?y OPTIONAL { ?y q ?z}
> filter( ! exists {?v q ?z FILTER(?y != ?v) })

would return the empty solution set {}

on graph

g2:
 a p b
 b q p

in reverse, q1 would return {} and q2 would return  {?x/a ?y/b}, yes?

Axel


  

On 25 May 2010, at 12:44, Olivier Corby wrote:

> What is the scope of variables in nested exists pattern?
> For example, is the inner ?x the same as the outer ?x
> 
> 
> select * where {
> ?x p ?y
> filter(! exists {?y q ?z
>                         filter(! exists {?x r ?z})
>                       })
> 
> }
> 
> 
> Olivier
> 
> 
Received on Tuesday, 25 May 2010 12:38:13 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:42 GMT