Re: interesting examples

james - did you manage to get

https://github.com/w3c/sparql-exists/blob/gh-pages/tests/

to run?

The tests are the same manifest format as for SPARQL with an modest 
extension that

  qt:data   <exists-graph.trig>

loads TriG (inc named graphs) not just default graph.

	Andy


On 25/11/16 23:48, 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 20:03:19 UTC