[MarkLogic Dev General] WG: FILTER conditions with xsd constants

Weissenberg, Norbert Norbert.Weissenberg at isst.fraunhofer.de
Thu Jan 7 02:09:24 PST 2016


there is no comment yet on my posting concerning "FILTER conditions with xsd constants", which can be found at

It e.g. deals with problems executing a simple query sample from the Semantics Developer's Guide using ML 8.0-4.
What's wrong?

Best regards,

Von: Weissenberg, Norbert
Gesendet: Montag, 21. Dezember 2015 11:39
An: 'general at developer.marklogic.com'
Betreff: FILTER conditions with xsd constants

I have some difficulties using FILTER conditions with xsd constants. Some samples:

1) The SPARQL query from MarkLogic Semantics Developer's Guide page 92 behaves differently in ML 8.0-3.2 and ML 8.0-4
(both in Query Console, with dbPedia ttl data imported as described):

PREFIX onto: <http://dbpedia.org/ontology/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns>

WHERE {?s rdf:type foaf:Person .
       ?s onto:birthDate ?bd .
       FILTER (?bd > "1999-01-01"^^xsd:date)

This query is in the older 8.0-3.2 version of the guide on page 91, but unchanged.

ML 8.0-3.2 returns:
your query returned an empty sequence

ML 8.0-4 returns:
[1.0-ml] XDMP-SPQLNOINEQ: amped-qconsole:qconsole-sparql($query, (), (), (), ()) -- Inequality operations are not supported on values of unknown type, unsupport type, or schema invalid values: "1999-01-01"^^<http://www.w3.org/2001/XMLSchema/date>
Stack Trace

At line 4 column 15:
In xdmp:eval("import module namespace amped-qconsole = &quot;http://marklogic....", (fn:QName("","query"), "# Semantics Guide page 92&#10;&#10;PREFIX onto: <http://dbpedia...."), <options xmlns="xdmp:eval"<http://dbpedia....%22),%20%3coptions%20xmlns=%22xdmp:eval%22>><database>17903852568952700635</database><modules>25934252216363...</options>)
3. PREFIX onto: <http://dbpedia.org/ontology/>
4. PREFIX foaf: <http://xmlns.com/foaf/0.1/>

2) The following query variant returns birthDates of type xs:gMonthDay (???) in both ML  versions:

PREFIX onto: <http://dbpedia.org/ontology/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns>

       ?s onto:birthDate ?bd .
        FILTER (?bd != "1999-01-01"^^xsd:date)

<http://dbpedia.org/resource/A._E._J._Collins>              "--08-18"^^xs:gMonthDay
<http://dbpedia.org/resource/A._F._M._Ahsanuddin_Chowdhury>      "--07-01"^^xs:gMonthDay

but without the FILTER line the birthDate is okay, but the order of results is changed:

<http://dbpedia.org/resource/%22Dr._Death%22_Steve_Williams>       "1960-05-14"^^xs:date
<http://dbpedia.org/resource/%22Irish%22_Teddy_Mann>       "1951-09-05"^^xs:date

3) The same problems occur when comparing e.g. integers: although they are correctly tagged: (a simple query returns e.g. "30"^^<xsd:integer>),
a FILTER (?d > "3"^^xsd:integer)  in 8.0.4 again returns the error from 1): Inequality operations are not supported on values of unknown type

Best regards and seasons greatings,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20160107/b4475208/attachment.html 

More information about the General mailing list