query-e9b58a6d666695c60ca39cc548bb1d33

rq turtle/ttl

...only those from Berlin or Brandenburg

Use at

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 p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
#defaultView:Map
SELECT DISTINCT ?w ?wLabel ?geo
WHERE 
{
    {
    ?w wdt:P463 wd:Q105757481 .
  } UNION {
    ?p wdt:P31 wd:Q98270496 .
    ?p p:P1416 ?statement .
    ?statement ps:P1416 ?w .
  }
  {?w 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" . }
  FILTER EXISTS {{ ?w wdt:P131+ wd:Q64 } UNION { ?w wdt:P131+ wd:Q1208}}
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?geo"):::projected v5("?hauptverwaltung") v2("?p") v3("?statement") v6("?verwaltungseinheit") v1("?w"):::projected c5(["wd:Q105757481"]):::iri c3(["wd:Q1208"]):::iri c2(["wd:Q64"]):::iri c13(["bd:serviceParam"]):::iri c15(["de,en"]):::literal c7(["wd:Q98270496"]):::iri f0[[" "]] subgraph f0e0["Exists Clause"] subgraph unione00[" Union "] subgraph unione00l[" "] style unione00l fill:#abf,stroke-dasharray: 3 3; e0v1 --"p:direct/P131"--> e0c3 end subgraph unione00r[" "] style unione00r fill:#abf,stroke-dasharray: 3 3; e0v1 --"p:direct/P131"--> e0c2 end unione00r <== or ==> unione00l end e0v1("?w"):::projected e0c3(["wd:Q1208"]):::iri e0c2(["wd:Q64"]):::iri end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> c2 f0 --> c3 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P131"--> c3 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P131"--> c2 end union0r <== or ==> union0l end subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; v2 --"p:direct/P31"--> c7 v2 --"p:P1416"--> v3 v3 --"p:statement/P1416"--> v1 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P463"--> c5 end union1r <== or ==> union1l end subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; subgraph union3[" Union "] subgraph union3l[" "] style union3l fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P131"--> v6 v6 --"p:direct/P625"--> v4 end subgraph union3r[" "] style union3r fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P159"--> v5 v5 --"p:direct/P625"--> v4 end union3r <== or ==> union3l end end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P625"--> v4 end union2r <== or ==> union2l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c13 --"wikibase:language"--> c15 end