query-2460217a3cb6222dd4f649b14b780bcd

rq turtle/ttl

Gemeinden, denen die Zuordnung eines Landkreis fehlt

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX v: <http://www.wikidata.org/prop/statement/>
SELECT ?muni ?key ?muniLabel ?instanceLabel ?ruralKey ?ruralLabel ?rural WHERE {
  VALUES ?instance {wd:Q262166 wd:Q42744322} .
  ?muni p:P31 ?instanceBlock . 
  ?instanceBlock v:P31 ?instance .
  FILTER NOT EXISTS {?instanceBlock pq:P582 ?end} .
  ?muni wdt:P439 ?key .
  BIND (SUBSTR(?key,6,3) AS ?keyEnd) . FILTER(?keyEnd!="000") .
  BIND (SUBSTR(?key,1,5) AS ?ruralKey) .
  ?rural wdt:P440 ?ruralKey
  FILTER NOT EXISTS {?muni wdt:P131 ?rural}
  SERVICE wikibase:label{bd:serviceParam wikibase:language "de"}
}
ORDER BY ?key

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?end") v7("?instance") v5("?instanceBlock") v1("?key"):::projected v8("?keyEnd") v2("?muni"):::projected v3("?rural"):::projected v8("?ruralKey"):::projected c11(["de"]):::literal c9(["bd:serviceParam"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"p:direct/P131"--> e0v2 e0v1("?muni"):::projected e0v2("?rural"):::projected end f0--EXISTS--> f0e0 f0 --> v2 f0 --> c1 f0 --> v3 v2 --"p:direct/P131"--> v3 f1[["?keyEnd != '000'"]] f1 --> v8 f2[["not "]] subgraph f2e1["Exists Clause"] e1v1 --"p:qualifier/P582"--> e1v2 e1v2("?end"):::projected e1v1("?instanceBlock"):::projected end f2--EXISTS--> f2e1 f2 --> v5 f2 --> c3 f2 --> v6 v5 --"p:qualifier/P582"--> v6 bind3[/VALUES ?instance/] bind3-->v7 bind30(["wd:Q262166"]) bind30 --> bind3 bind31(["wd:Q42744322"]) bind31 --> bind3 v2 --"p:P31"--> v5 v5 --"p:statement/P31"--> v7 v2 --"p:direct/P439"--> v1 bind4[/"substring(?key,'6^^xsd:integer','3^^xsd:integer')"/] v1 --o bind4 bind4 --as--o v8 bind5[/"substring(?key,'1^^xsd:integer','5^^xsd:integer')"/] v1 --o bind5 bind5 --as--o v8 v3 --"p:direct/P440"--> v8 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end