query-8b1054275107cf4c2d132a0acd54b7ad
[Housecleaning] Members Geolocation
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#>
SELECT DISTINCT ?w ?wLabel (SAMPLE(?geo) AS ?geo)
WHERE
{
?w wdt:P463 wd:Q105757481 .
OPTIONAL {
{?w wdt:P625 ?geo} UNION {?w wdt:P276 ?ort . ?ort wdt:P625 ?geo .} UNION
{?w wdt:P159 ?hauptverwaltung . ?hauptverwaltung wdt:P625 ?geo .} UNION
{?w wdt:P131 ?verwaltungseinheit . ?verwaltungseinheit wdt:P625 ?geo .}
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "de,en" . }
} GROUP BY ?w ?wLabel
ORDER BY ASC(?wLabel)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?geo"):::projected
v5("?hauptverwaltung")
v4("?ort")
v6("?verwaltungseinheit")
v2("?w"):::projected
v1("?wLabel"):::projected
c8(["bd:serviceParam"]):::iri
c2(["wd:Q105757481"]):::iri
c10(["de,en"]):::literal
v2 --"wdt:P463"--> c2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
subgraph union2[" Union "]
subgraph union2l[" "]
style union2l fill:#abf,stroke-dasharray: 3 3;
v2 -."wdt:P131".-> v6
v6 --"wdt:P625"--> v7
end
subgraph union2r[" "]
style union2r fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P159"--> v5
v5 --"wdt:P625"--> v7
end
union2r <== or ==> union2l
end
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P276"--> v4
v4 --"wdt:P625"--> v7
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P625"--> v7
end
union0r <== or ==> union0l
end
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end
bind1[/"sample(?geo)"/]
v7 --o bind1
bind1 --as--o v7