query-dcd8d6377fdef5d8271874a58b6ea87d
Propertiesinstance of (P31)subclass of (P279)twinned administrative body (P190)
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 ?itemDescription ?sister_city ?sister_cityLabel
WHERE {
?item wdt:P31/wdt:P279* wd:Q515.
?item wdt:P190 ?sister_city.
SERVICE wikibase:label { bd:serviceParam wikibase:language "de,en". }
FILTER(NOT EXISTS { ?sister_city wdt:P190 ?item. })
}
ORDER BY ?itemDescription
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?item"):::projected
v1("?itemDescription"):::projected
v2("?sister_city"):::projected
a1((" "))
c6(["bd:serviceParam"]):::iri
c4(["wd:Q515"]):::iri
c8(["de,en"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P190"--> e0v2
e0v2("?item"):::projected
e0v1("?sister_city"):::projected
end
f0--EXISTS--> f0e0
f0 --> v2
f0 --> c1
f0 --> v3
v2 --"wdt:P190"--> v3
v3 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c4
v3 --"wdt:P190"--> v2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end