query-be2e523a3056e10fbe4a5eaf725d0a2a
People born in Kosovo, but educated elsewhere22 results (table)
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 ?school ?schoolLabel ?countryLabel {
{
SELECT ?item (SAMPLE(?school) AS ?school) {
?item wdt:P31 wd:Q5;
wdt:P19 ?place;
wdt:P69 ?school .
?place (wdt:P17|wdt:P131)* wd:Q1246 .
MINUS { ?school (wdt:P17|wdt:P131)* wd:Q1246 } .
#?school wdt:P17 wd:Q183 . # no results
} GROUP BY ?item
} .
OPTIONAL { ?school wdt:P17 ?country } .
SERVICE wikibase:label { bd:serviceParam wikibase:language "sq,sr,en" } .
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?country")
v1("?item"):::projected
v2("?place")
v4("?school"):::projected
c9(["bd:serviceParam"]):::iri
c2(["wd:Q5"]):::iri
c11(["sq,sr,en"]):::literal
c6(["wd:Q1246"]):::iri
v1 --"wdt:P31"--> c2
v1 --"wdt:P19"--> v2
v1 --"wdt:P69"--> v4
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P131"--> c6
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P17"--> c6
end
union0r <== or ==> union0l
end
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
v4 --"wdt:P131"--> c6
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v4 --"wdt:P17"--> c6
end
union1r <== or ==> union1l
end
end
bind2[/"sample(?school)"/]
v4 --o bind2
bind2 --as--o v4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P17".-> v4
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end