query-6e478b9d10721552d6a70b3e547371b7

rq turtle/ttl

Vollständige Prüfung aller Kreisstadtrelationen

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 ?capital ?capitalKey ?capitalLabel ?districtLabel ?districtKey ?district ?classLabel WHERE {
  ?capital p:P1376 ?capitalBlock . 
  ?capitalBlock v:P1376 ?district .
  ?district wdt:P440 ?districtKey
  FILTER NOT EXISTS {?capitalBlock pq:P582 ?end1} .
  ?district p:P31 ?instanceBlock . 
  ?instanceBlock v:P31 ?class .
  FILTER NOT EXISTS {?instanceBlock pq:P582 ?end2} .
  ?class wdt:P279 wd:Q106658 .
  ?district wdt:P36 ?capital .
  ?capital wdt:P439 ?capitalKey .
  ?capital p:P31 ?dcBlock . 
  ?dcBlock v:P31 wd:Q134626 .
  FILTER NOT EXISTS {?dcBlock pq:P582 ?end3}
  SERVICE wikibase:label{bd:serviceParam wikibase:language "de"}
}
ORDER BY ?capitalKey

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?capital"):::projected v6("?capitalBlock") v1("?capitalKey"):::projected v11("?class") v2("?dcBlock") v9("?district"):::projected v10("?districtKey"):::projected v7("?end1") v5("?end2") v3("?end3") v4("?instanceBlock") c8(["wd:Q106658"]):::iri c15(["de"]):::literal c11(["wd:Q134626"]):::iri c13(["bd:serviceParam"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"p:qualifier/P582"--> e0v2 e0v1("?dcBlock"):::projected e0v2("?end3"):::projected end f0--EXISTS--> f0e0 f0 --> v2 f0 --> c1 f0 --> v3 v2 --"p:qualifier/P582"--> v3 f1[["not "]] subgraph f1e1["Exists Clause"] e1v1 --"p:qualifier/P582"--> e1v2 e1v2("?end2"):::projected e1v1("?instanceBlock"):::projected end f1--EXISTS--> f1e1 f1 --> v4 f1 --> c1 f1 --> v5 v4 --"p:qualifier/P582"--> v5 f2[["not "]] subgraph f2e2["Exists Clause"] e2v1 --"p:qualifier/P582"--> e2v2 e2v1("?capitalBlock"):::projected e2v2("?end1"):::projected end f2--EXISTS--> f2e2 f2 --> v6 f2 --> c1 f2 --> v7 v6 --"p:qualifier/P582"--> v7 v8 --"p:P1376"--> v6 v6 --"p:statement/P1376"--> v9 v9 --"p:direct/P440"--> v10 v9 --"p:P31"--> v4 v4 --"p:statement/P31"--> v11 v11 --"p:direct/P279"--> c8 v9 --"p:direct/P36"--> v8 v8 --"p:direct/P439"--> v1 v8 --"p:P31"--> v2 v2 --"p:statement/P31"--> c11 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c13 --"wikibase:language"--> c15 end