query-118ebc0fa81e584e343c77b2d8989c3e
Propertiesinstance of (P31)country (P17)coordinate location (P625)dissolved, abolished or demolished date (P576)
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?countryLabel
WHERE
{
#?item wdt:P31 wd:Q1311958.
?item wdt:P31 wd:Q12280.
#OPTIONAL { ?item wdt:P17 ?country. }
?item wdt:P17 wd:Q183.
FILTER NOT EXISTS { ?item wdt:P625 ?coords. }
FILTER NOT EXISTS { ?item wdt:P31 wd:Q27464969. }
FILTER NOT EXISTS { ?item wdt:P576 ?demol. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "de,en". } # Helps get the label in your language, if not, then en language
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?coords")
v2("?demol")
v1("?item"):::projected
c9(["bd:serviceParam"]):::iri
c3(["wd:Q27464969"]):::iri
c5(["wd:Q12280"]):::iri
c7(["wd:Q183"]):::iri
c11(["de,en"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P576"--> e0v2
e0v2("?demol"):::projected
e0v1("?item"):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> v2
v1 --"wdt:P576"--> v2
f1[["not "]]
subgraph f1e1["Exists Clause"]
e1v1 --"wdt:P31"--> e1c2
e1v1("?item"):::projected
e1c2(["wd:Q27464969"]):::iri
end
f1--EXISTS--> f1e1
f1 --> v1
f1 --> c2
f1 --> c3
v1 --"wdt:P31"--> c3
f2[["not "]]
subgraph f2e2["Exists Clause"]
e2v1 --"wdt:P625"--> e2v2
e2v2("?coords"):::projected
e2v1("?item"):::projected
end
f2--EXISTS--> f2e2
f2 --> v1
f2 --> c4
f2 --> v3
v1 --"wdt:P625"--> v3
v1 --"wdt:P31"--> c5
v1 --"wdt:P17"--> c7
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end