Как я могу отфильтровать количество результатов (количество забастовок) до определенного года (1970)? Мое решение дает неожиданные результаты. В запросе я записал альтернативы, которые пробовал, и их результаты.
Решения, упомянутые другими ([1], [2]) не решил проблему.
Конечная точка: https://api.druid.datalegend.net/datasets/rlzijdeman/ClariahTech2017/containers/clariahTech2017/sparql
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX gg: <http://www.gemeentegeschiedenis.nl/gg-schema#>
PREFIX strikes: <https://iisg.amsterdam/vocab/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?muni ?sdate (COUNT(?muni) as ?muniCount)
WHERE {
?strike strikes:place ?splace .
?strike strikes:date ?sdate .
?muni rdf:type gg:Municipality .
?muni rdfs:label ?ggplace .
FILTER regex(?splace, ?ggplace)
### TASK: Filter results above to strikes in 1970 only
# solution 1: extract year and FILTER on 1970
# FILTER ( year(?sdate) = 1970 )
### Virtuoso 22003 Error SR586: Incomplete RDF box as argument 0 for year().
# solution 2: filter on ?sdate
# FILTER ( ?sdate >= '1970-01-01'^^xsd:date && ?sdate <= '1970-12-31'^^xsd:date )
### Virtuoso 2201B Error SR098: regexp error at '? [Arnhem ( Gelderland )]' column 0 (nothing to repeat)
####### Why? This was no problem under solution 1 ?!
####### Also: note that each of these works seperately, but not together(!):
# FILTER ( ?sdate >= '1970-01-01'^^xsd:date )
# FILTER ( ?sdate <= '1970-12-31'^^xsd:date )
}
LIMIT 10