Re: interesting examples

Expected is not very well defined here?  Expected from the current definition
of SPARQL?  Expected from the two proposals?  Expected from a fixed version of
SPARQL?

I'll expand on my previous message with a new example and what I think the
various setups result in.

peter


On 11/25/2016 03:48 PM, james anderson wrote:
> good morning;
> 
>> On 2016-11-25, at 21:58, Peter F. Patel-Schneider <pfpschneider@gmail.com> wrote:
>>
>> Here are some interesting examples of EXISTS that need to be considered.
> 
> ;;; given a dataset which has the following content,
> 
> * (run-sparql "select * where {{<http://test.org/s> ?p ?o} union { graph ?g {<http://test.org/s> ?p ?o} } }"
>             :repository-id "james/test")
> 
> ((#S(SPOCQ:UNBOUND-VARIABLE :NAME NIL) "o" <http://test.org/p>)
>  (<http://test.org/g> "o" <http://test.org/p>)
>  (<http://test.org/g2> "o2" <http://test.org/p>))
> (?::|g| ?::|o| ?::|p|)
> 
> 
> ;;; with queries corrected and adapted to that data, are these the results to be expected?
> 
> * (run-sparql "
> prefix : <http://test.org/>
> SELECT ?x WHERE {
>  ?x :p 'o' .
>  FILTER ( EXISTS {
>    FILTER ( ?x = :s )
>    } )
>  }
> "
>             :repository-id "james/test")
> 
> ((<http://test.org/s>))
> (?::|x|)
> 
> * (run-sparql "
> prefix : <http://test.org/>
> SELECT ?x WHERE {
>  ?x :p 'o' .
>  FILTER ( EXISTS {
>    SELECT (?y as ?x) WHERE {
>      ?y :p 'o' .
>      }
>    } )
>  }
> "
>             :repository-id "james/test")
> 
> ((<http://test.org/s>))
> (?::|x|)
> 
> * (run-sparql "
> prefix : <http://test.org/>
> SELECT ?x WHERE {
>  ?x :p 'o' .
>  FILTER ( EXISTS {
>    ?x :p 'o' . MINUS { graph :g2 { ?x :p 'o2' . } }
>    } )
>  }
> "
>             :repository-id "james/test")
> 
> NIL
> (?::|x|)
> * (run-sparql "
> prefix : <http://test.org/>
> SELECT * WHERE {
>  :s :p 'o' . MINUS { :s :p 'o' . }
>  }
> "
>             :repository-id "james/test")
> 
> NIL
> NIL
> * (run-sparql "
> prefix : <http://test.org/>
> SELECT ?x WHERE {
>  ?x :p 'o' .
>  FILTER ( EXISTS {
>    :s :p 'o' . MINUS { :s :p 'o' . }
>    } )
>  }
> "
>             :repository-id "james/test")
> 
> NIL
> (?::|x|)
> 
> 
> 
> ---
> james anderson | james@dydra.com | http://dydra.com
> 
> 
> 
> 
> 
> 

Received on Saturday, 26 November 2016 18:48:08 UTC