query-23df7e81e2ab6492631caa496f0a4304
Die 294+2 Kreisstädte mit ihren Landkreisen
Use at
- https://query.wikidata.org/sparql
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 ?capitalLabel ?districtLabel ?district WHERE {
?capital p:P1376 ?capitalBlock .
?capitalBlock v:P1376 ?district .
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
SERVICE wikibase:label{bd:serviceParam wikibase:language "de"}
}
ORDER BY ?capitalLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?capital"):::projected
v4("?capitalBlock")
v1("?capitalLabel"):::projected
v8("?class")
v7("?district"):::projected
v5("?end1")
v3("?end2")
v2("?instanceBlock")
c7(["wd:Q106658"]):::iri
c11(["de"]):::literal
c9(["bd:serviceParam"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"p:qualifier/P582"--> e0v2
e0v2("?end2"):::projected
e0v1("?instanceBlock"):::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
e1v1("?capitalBlock"):::projected
e1v2("?end1"):::projected
end
f1--EXISTS--> f1e1
f1 --> v4
f1 --> c1
f1 --> v5
v4 --"p:qualifier/P582"--> v5
v6 --"p:P1376"--> v4
v4 --"p:statement/P1376"--> v7
v7 --"p:P31"--> v2
v2 --"p:statement/P31"--> v8
v8 --"p:direct/P279"--> c7
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end