我正在尝试获取特定日期之间的所有记录。日期字段以这种格式显示:2012-01-31
。我认为它是类型:<http://www.w3.org/2001/XMLSchema#date>
请问如何修改下面的查询以提取日期大于 2012-01-31 的记录?
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX lrppi: <http://landregistry.data.gov.uk/def/ppi/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX lrcommon: <http://landregistry.data.gov.uk/def/common/>
SELECT ?county ?postcode ?amount ?date
WHERE
{
?transx lrppi:pricePaid ?amount .
?transx lrppi:transactionDate ?date .
?transx lrppi:propertyAddress ?addr.
?addr lrcommon:postcode "PL6 8RU"^^xsd:string .
?addr lrcommon:postcode ?postcode .
# Cant get this line to work
# ?date lrppi:transactionDate ?date . FILTER ( ?date >= "1327968000"^^xsd:date )
OPTIONAL {?addr lrcommon:county ?county .}
}
ORDER BY ?postcode
如果你想玩这个,你可以在这里输入你的查询:http: //landregistry.data.gov.uk/landregistry/sparql/sparql.html