query-15b6cf6037b9cd851602aa5469435fc8
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?locationLabel ?countryLabel ?startdate ?enddate WHERE {
?item wdt:P31 wd:Q20437094. #is an installation
?item p:P608 ?statement. # has P608 data
optional {?statement pq:P276 ?location.}
optional {?statement pq:P17 ?country.}
optional {?statement pq:P580 ?startdate.}
optional {?statement pq:P582 ?enddate.}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} order by ?itemLabel ?startdate
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?country")
v7("?enddate"):::projected
v3("?item"):::projected
v1("?itemLabel"):::projected
v5("?location")
v2("?startdate"):::projected
v4("?statement")
c9(["bd:serviceParam"]):::iri
c2(["wd:Q20437094"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v3 --"p:direct/P31"--> c2
v3 --"p:P608"--> v4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:qualifier/P276".-> v5
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:qualifier/P17".-> v6
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:qualifier/P580".-> v2
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:qualifier/P582".-> v7
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end