query-b1dfb2dc077f204e90434e0f3ba42c39
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 bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
SELECT ?organisation ?organisationLabel ?coords WHERE {
?organisation wdt:P31 wd:Q33506.
?organisation wdt:P17 wd:Q145 .
OPTIONAL {?organisation wdt:P131 ?county1. }
OPTIONAL {?organisation wdt:P7959 ?county2. }
filter(!BOUND(?county1) && !BOUND(?county2))
?organisation wdt:P625 ?coords.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?coords"):::projected
v1("?county1")
v2("?county2")
v3("?organisation"):::projected
c2(["wd:Q33506"]):::iri
c9(["bd:serviceParam"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c4(["wd:Q145"]):::iri
f0[["not bound(?county1)not bound(?county2)"]]
f0 --> v1
f0 --> v2
v3 --"wdt:P31"--> c2
v3 --"wdt:P17"--> c4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P131".-> v1
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P7959".-> v2
end
v3 --"wdt:P625"--> v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end