query-ed78e4509af83aec314708fbf3205d40
Municipalities in Germany without preferred population
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
SELECT ?muni ?muniLabel ?instanceLabel WHERE {
VALUES ?instance {wd:Q262166 wd:Q42744322} .
?muni p:P31 ?instanceBlock .
?instanceBlock v:P31 ?instance .
FILTER NOT EXISTS {?instanceBlock pq:P582 ?end} .
FILTER NOT EXISTS{
?muni p:P1082 ?populationBlock .
?populationBlock wikibase:rank wikibase:PreferredRank}
SERVICE wikibase:label{bd:serviceParam wikibase:language "de"}
}
ORDER BY ?muniLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?end")
v6("?instance")
v4("?instanceBlock")
v2("?muni"):::projected
v1("?muniLabel"):::projected
v3("?populationBlock")
c10(["de"]):::literal
c8(["bd:serviceParam"]):::iri
c3(["wikibase:PreferredRank"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"p:P1082"--> e0v2
e0v2 --"wikibase:rank"--> e0c3
e0v1("?muni"):::projected
e0v2("?populationBlock"):::projected
e0c3(["wikibase:PreferredRank"]):::iri
end
f0--EXISTS--> f0e0
f0 --> v2
f0 --> c1
f0 --> v3
f0 --> c2
f0 --> c3
v2 --"p:P1082"--> v3
v3 --"wikibase:rank"--> c3
f1[["not "]]
subgraph f1e1["Exists Clause"]
e1v1 --"p:qualifier/P582"--> e1v2
e1v2("?end"):::projected
e1v1("?instanceBlock"):::projected
end
f1--EXISTS--> f1e1
f1 --> v4
f1 --> c4
f1 --> v5
v4 --"p:qualifier/P582"--> v5
bind2[/VALUES ?instance/]
bind2-->v6
bind20(["wd:Q262166"])
bind20 --> bind2
bind21(["wd:Q42744322"])
bind21 --> bind2
v2 --"p:P31"--> v4
v4 --"p:statement/P31"--> v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end