query-474ee639fb1e6ef480b1b2543a2d423f

rq turtle/ttl

[Housecleaning] (Co-)Applicants Geolocation

Use at

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 
{
     ?p wdt:P31 wd:Q98270496 . 
     ?p wdt:P1416 ?w .
       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; v8("?geo"):::projected v6("?hauptverwaltung") v5("?ort") v2("?p") v7("?verwaltungseinheit") v3("?w"):::projected v1("?wLabel"):::projected c9(["bd:serviceParam"]):::iri c11(["de,en"]):::literal c2(["wd:Q98270496"]):::iri v2 --"wdt:P31"--> c2 v2 --"wdt:P1416"--> v3 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; v3 -."wdt:P131".-> v7 v7 --"wdt:P625"--> v8 end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P159"--> v6 v6 --"wdt:P625"--> v8 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P276"--> v5 v5 --"wdt:P625"--> v8 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P625"--> v8 end union0r <== or ==> union0l end end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end bind1[/"sample(?geo)"/] v8 --o bind1 bind1 --as--o v8