query-8f1b8681eada90eca62fe4c3583b2596
MPs with science awards SELECT DISTINCT ?personLabel ?person ?awardLabel ?award WHERE { ?person wdt:P166 ?award . # this person had won some kind of award ?award wdt:P31/wdt:P279* wd:Q11448906 . # and that award is a type of science award
{ ?person wdt:P39 [ wdt:P279* wd:Q16707842 ] } # UK MP
UNION { ?person wdt:P39 [ wdt:P279 wd:Q18015642 ] } # British MP (1707-1800) UNION { ?person wdt:P39 [ wdt:P279 wd:Q18018860 ] } # English MP (pre-1707)
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } }
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#>
#MPs with science awards
SELECT DISTINCT ?personLabel ?person ?awardLabel ?award WHERE {
?person wdt:P166 ?award . # this person had won some kind of award
?award wdt:P31/wdt:P279* wd:Q11448906 . # and that award is a type of science award
{ ?person wdt:P39 [ wdt:P279* wd:Q16707842 ] } # UK MP
UNION { ?person wdt:P39 [ wdt:P279* wd:Q18015642 ] } # British MP (1707-1800)
UNION { ?person wdt:P39 [ wdt:P279* wd:Q18018860 ] } # English MP (pre-1707)
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?award"):::projected
v1("?person"):::projected
a1((" "))
a2((" "))
a3((" "))
a4((" "))
c10(["bd:serviceParam"]):::iri
c8(["wd:Q18018860"]):::iri
c5(["wd:Q16707842"]):::iri
c4(["wd:Q11448906"]):::iri
c12(["en"]):::literal
c7(["wd:Q18015642"]):::iri
v1 --"wdt:P166"--> v2
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c4
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
a4 --"wdt:P279"--> c8
v1 --"wdt:P39"--> a4
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
a3 --"wdt:P279"--> c7
v1 --"wdt:P39"--> a3
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
a2 --"wdt:P279"--> c5
v1 --"wdt:P39"--> a2
end
union0r <== or ==> union0l
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end