query-e2d3e165c45704bf98c52ea468e86bd7

rq turtle/ttl

TODO

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 $item $itemLabel $id $osmId $population $area
  {
  {
  $item wdt:P31           wd:Q1221156;  # German state
        wdt:P1388         $id
  }
  UNION
  {
  $item wdt:P31/wdt:P279* wd:Q22721;    # Goverment region (Regierungsbezirk)
        wdt:P1388         $id
  }
  UNION
  {
  $item wdt:P31/wdt:P279* wd:Q106658;   # District of Germany (Kreis/Landkreis)
        wdt:P440          $id
  }

  OPTIONAL {$item wdt:P402  $osmId}
  OPTIONAL {$item wdt:P1082 $population}
  OPTIONAL {$item wdt:P2046 $area}

  FILTER NOT EXISTS {$item wdt:P576 $dissolvedDate}
  SERVICE wikibase:label {bd:serviceParam wikibase:language "de,en"}
  }
ORDER BY $id

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?area"):::projected v3("?dissolvedDate") v1("?id"):::projected v2("?item"):::projected v4("?osmId"):::projected v5("?population"):::projected a1((" ")) a2((" ")) c7(["wd:Q106658"]):::iri c6(["wd:Q22721"]):::iri c13(["bd:serviceParam"]):::iri c3(["wd:Q1221156"]):::iri c15(["de,en"]):::literal f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"wdt:P576"--> e0v2 e0v2("?dissolvedDate"):::projected e0v1("?item"):::projected end f0--EXISTS--> f0e0 f0 --> v2 f0 --> c1 f0 --> v3 v2 --"wdt:P576"--> v3 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; v2 --"wdt:P31"--> a2 a2 --"wdt:P279"--> c7 v2 --"wdt:P440"--> v1 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c6 v2 --"wdt:P1388"--> v1 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c3 v2 --"wdt:P1388"--> v1 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P402".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P1082".-> v5 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P2046".-> v6 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c13 --"wikibase:language"--> c15 end