The first two of these queries will work.. the third will not. However they differ only by the age searched on. The first 65. the second 67. and third 66. (the third will return no results).
prefix gts: <http://resource.geosciml.org/ontology/timescale/gts#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX time: <http://www.w3.org/2006/time#>
SELECT *
WHERE {
?era gts:rank ?rank .
?era time:hasBeginning/time:inTemporalPosition/time:numericPosition ?begin .
?era time:hasEnd/time:inTemporalPosition/time:numericPosition ?end .
?era rdfs:label ?name .
BIND ( "65."^^xsd:decimal AS ?targetAge )
FILTER ( ?targetAge > xsd:decimal(?end) )
FILTER ( ?targetAge < xsd:decimal(?begin) )
}
returns three expected results...
prefix gts: <http://resource.geosciml.org/ontology/timescale/gts#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX time: <http://www.w3.org/2006/time#>
SELECT *
WHERE {
?era gts:rank ?rank .
?era time:hasBeginning/time:inTemporalPosition/time:numericPosition ?begin .
?era time:hasEnd/time:inTemporalPosition/time:numericPosition ?end .
?era rdfs:label ?name .
BIND ( "67."^^xsd:decimal AS ?targetAge )
FILTER ( ?targetAge > xsd:decimal(?end) )
FILTER ( ?targetAge < xsd:decimal(?begin) )
}
returns three expected results.
prefix gts: <http://resource.geosciml.org/ontology/timescale/gts#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX time: <http://www.w3.org/2006/time#>
SELECT *
WHERE {
?era gts:rank ?rank .
?era time:hasBeginning/time:inTemporalPosition/time:numericPosition ?begin .
?era time:hasEnd/time:inTemporalPosition/time:numericPosition ?end .
?era rdfs:label ?name .
BIND ( "66."^^xsd:decimal AS ?targetAge )
FILTER ( ?targetAge > xsd:decimal(?end) )
FILTER ( ?targetAge < xsd:decimal(?begin) )
}
I am using Blazegraph build version 2.1.1. I can't tell if this is something to do with my SPARQL engine or something in the RDF.
I would love to know if the third query returns expected results for you, so I can know it's an issue with my engine, not the RDF.