query-19c0825eeadc3966f16a98525328841d
Die 294+2 als Kreisstadt markierten Gemeinden
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
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 ?dc ?dcLabel ?muniInstanceLabel WHERE {
VALUES ?muniInstance {wd:Q262166 wd:Q42744322} .
?dc p:P31 ?muniBlock .
?muniBlock v:P31 ?muniInstance .
FILTER NOT EXISTS {?muniBlock pq:P582 ?end1} .
?dc p:P31 ?captialBlock .
?captialBlock v:P31 wd:Q134626 .
FILTER NOT EXISTS {?captialBlock pq:P582 ?end2}
SERVICE wikibase:label{bd:serviceParam wikibase:language "de"}
}
ORDER BY ?muniLabel DESC(?instanceLabel) ?muni
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?captialBlock")
v9("?dc"):::projected
v7("?end1")
v5("?end2")
v2("?instanceLabel")
v3("?muni")
v6("?muniBlock")
v8("?muniInstance")
v1("?muniLabel")
c8(["de"]):::literal
c6(["bd:serviceParam"]):::iri
c4(["wd:Q134626"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"p:qualifier/P582"--> e0v2
e0v1("?captialBlock"):::projected
e0v2("?end2"):::projected
end
f0--EXISTS--> f0e0
f0 --> v4
f0 --> c1
f0 --> v5
v4 --"p:qualifier/P582"--> v5
f1[["not "]]
subgraph f1e1["Exists Clause"]
e1v1 --"p:qualifier/P582"--> e1v2
e1v2("?end1"):::projected
e1v1("?muniBlock"):::projected
end
f1--EXISTS--> f1e1
f1 --> v6
f1 --> c1
f1 --> v7
v6 --"p:qualifier/P582"--> v7
bind2[/VALUES ?muniInstance/]
bind2-->v8
bind20(["wd:Q262166"])
bind20 --> bind2
bind21(["wd:Q42744322"])
bind21 --> bind2
v9 --"p:P31"--> v6
v6 --"p:statement/P31"--> v8
v9 --"p:P31"--> v4
v4 --"p:statement/P31"--> c4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end