query-ed845ab8137eeca2f7954690d2b9df50
Propertiescountry of citizenship (P27)instance of (P31)country (P17)
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 DISTINCT ?item ?itemLabel ?instanceLabel ?itemDescription WHERE {
?item wdt:P27 wd:Q31.
?item wdt:P31 ?instance.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
FILTER(?instance != wd:Q5)
MINUS { ?item wdt:P17 wd:Q31.}
}
ORDER BY ?itemLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?instance")
v3("?item"):::projected
v1("?itemLabel"):::projected
c6(["bd:serviceParam"]):::iri
c8(["#91;AUTO_LANGUAGE#93;"]):::literal
c3(["wd:Q31"]):::iri
f0[["?instance != 'wd:Q5'"]]
f0 --> v2
v3 --"wdt:P27"--> c3
v3 --"wdt:P31"--> v2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P17"--> c3
end