database - SPARQL date filter query for RDF -
i querying using sparql, works fine. when add data filter doesn't throw error doesn't filter. final part should able query between 2 dates:
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix owl: <http://www.w3.org/2002/07/owl#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix xsd: <http://www.w3.org/2001/xmlschema#> prefix hotel: <http://users.jyu.fi/~mimomuki/everything/hotel#> select * { ?room hotel:hascity ?sender; hotel:hasfirstday ?firstday filter ( ?firstday >= "2016-09-01"^^xsd:date ) }
if want compare dates, may want ensure proper data type of operands in filter expression. can casting both values xsd:datetime
filter ( xsd:datetime(?firstday) >= xsd:datetime("2016-09-01") )
Comments
Post a Comment