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

Re: exists

From: Birte Glimm <birte.glimm@comlab.ox.ac.uk>
Date: Wed, 26 May 2010 11:50:03 +0100
Message-ID: <AANLkTinsE44LM4Bu11rDIM-_g9-BvUPrO3GCNoopuHGg@mail.gmail.com>
To: Axel Polleres <axel.polleres@deri.org>
Cc: Olivier Corby <Olivier.Corby@sophia.inria.fr>, SPARQL Working Group <public-rdf-dawg@w3.org>
Axel,
I also tried you examples to test my understanding and I come to the
same results that you have (not that this gives a guarantee the we get
it right ;-) ).
Birte

On 25 May 2010 13:37, Axel Polleres <axel.polleres@deri.org> wrote:
> 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
>>
>>
>
>
>



-- 
Dr. Birte Glimm, Room 306
Computing Laboratory
Parks Road
Oxford
OX1 3QD
United Kingdom
+44 (0)1865 283529
Received on Wednesday, 26 May 2010 10:50:38 GMT

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