query-c9e515dba2024aa617e0d3070b2edfe7
TODO
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 ?country ?countryLabel
WHERE
{
?item wdt:P31 wd:Q1785071 .
OPTIONAL {?item wdt:P17 ?country.}
MINUS {?item wdt:P17 ?new_country . ?new_country wdt:P31 wd:Q3624078 . FILTER NOT EXISTS {?new_country wdt:P31 wd:Q3024240} }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?country"):::projected
v1("?item"):::projected
v3("?new_country")
c4(["wd:Q3024240"]):::iri
c2(["wd:Q1785071"]):::iri
c5(["wd:Q3624078"]):::iri
c7(["bd:serviceParam"]):::iri
c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v1 --"wdt:P31"--> c2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P17".-> v2
end
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
f1[["not "]]
subgraph f1e0["Exists Clause"]
e0v1 --"wdt:P31"--> e0c2
e0v1("?new_country"):::projected
e0c2(["wd:Q3024240"]):::iri
end
f1--EXISTS--> f1e0
f1 --> v3
f1 --> c1
f1 --> c4
v3 --"wdt:P31"--> c4
v1 --"wdt:P17"--> v3
v3 --"wdt:P31"--> c5
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end