query-ddc2899a044694242534f24a2d234238
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
SELECT ?item ?itemLabel ?p937Label ?coord ?layer {
?item p:P106 ?p106stm .
?p106stm ps:P106 wd:Q3809586 .
OPTIONAL { ?p106stm pq:P937 ?p937 . ?p937 wdt:P625 ?coord . }
OPTIONAL { ?p106stm pq:P582 ?p582 }
BIND(IF(!BOUND(?p582),'without end date',CONCAT('end year ',STR(YEAR(?p582)))) AS ?layer)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?p582)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?coord"):::projected
v2("?item"):::projected
v6("?layer"):::projected
v3("?p106stm")
v1("?p582")
v4("?p937")
c8(["bd:serviceParam"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c3(["wd:Q3809586"]):::iri
v2 --"p:P106"--> v3
v3 --"p:statement/P106"--> c3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P937".-> v4
v4 --"p:direct/P625"--> v5
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P582".-> v1
end
bind0[/"if(not bound(?p582),'without end date',concat('end year ',str(year-from-dateTime(?p582))))"/]
v1 --o bind0
bind0 --as--o v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end