Re: adding dawg:monotonicity and extensible data types to SPARQL query

> 
> Data:
> :x :p "45"^^:dtype .
> 
> Query:
> ASK { OPTIONAL { :x :p ?v . FILTER ( ?v < "67"^^:dtype ) }
>        FILTER (bound(?v))
> 
> 

Typo : that should be "not bound" (!bound(?v))

---------------

More fully: if the data is:

== Data 1:
@prefix : <http://example/> .
:x1 :p "45"^^:dtype .

== Query 1:
PREFIX : <http://example/>

SELECT ?x {
       ?x :p ?w .
       OPTIONAL { ?x :p ?v . FILTER ( ?v < "67"^^:dtype ) }
       FILTER (!bound(?v))
     }

-------
| x   |
=======
| :x1 |
-------

Optional RHS fails (error on comparison), ?v2 is not bound so the second 
filter passes.

But with a known datatype (or learn datatype :dtype is datatype xsd:integer 
with a different IRI):

== Data 2:
@prefix : <http://example/> .
:x1 :p 45 .

== Query:

PREFIX : <http://example/>

SELECT ?x {
       ?x :p ?w .
       OPTIONAL { ?x :p ?v . FILTER ( ?v < 67 ) }
       FILTER (!bound(?v))
     }

-----
| x |
=====
-----

The filter in the OPTIONAL is now true, ?v is bound and hence the second 
filter fails.

	Andy

Received on Tuesday, 22 August 2006 16:34:31 UTC