query-923d853c726e738099cce3185b4841c8
Ministers of Education in the European Union SELECT ?who ?how2 # ?else ?how WHERE {
at least he/she is a human
?who wdt:P31 wd:Q5 .
who how wd:Q458 showed a few results, so relations are more indirect/deep
?who ?how ?else .
?else ?how2 ?wd:Q458 .
based on results, likely to be wdt:P39
?who wdt:P39 ?else .
manually removing frequent positions using next line of code untill we find something similar
FILTER(?else NOT IN (wd:Q27169, wd:Q8882, wd:Q1780232, wd:Q2298177, wd:Q165055, wd:Q7925068))
based on results, presumably wd:Q5190728
?who wdt:P39 wd:Q5190728.
wd:Q5190728 ?how2 wd:Q458 .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}
LIMIT 1000 # used to speed up queries
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#>
# Ministers of Education in the European Union
SELECT ?who ?how2 # ?else ?how
WHERE
{
#at least he/she is a human
?who wdt:P31 wd:Q5 .
# who how wd:Q458 showed a few results, so relations are more indirect/deep
# ?who ?how ?else .
# ?else ?how2 ?wd:Q458 .
# based on results, likely to be wdt:P39
# ?who wdt:P39 ?else .
# manually removing frequent positions using next line of code untill we find something similar
# FILTER(?else NOT IN (wd:Q27169, wd:Q8882, wd:Q1780232, wd:Q2298177, wd:Q165055, wd:Q7925068))
# based on results, presumably wd:Q5190728
?who wdt:P39 wd:Q5190728.
wd:Q5190728 ?how2 wd:Q458 .
# SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}
# LIMIT 1000 # used to speed up queries
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?how2"):::projected
v1("?who"):::projected
c5(["wd:Q458"]):::iri
c2(["wd:Q5"]):::iri
c4(["wd:Q5190728"]):::iri
v1 --"wdt:P31"--> c2
v1 --"wdt:P39"--> c4
c4 -->v2--> c5