query-67dc8d9ce1f17358ded950f53fbfe0ff
title:Prime Ministers of Canada SELECT ?pm ?pmLabel ?genderLabel ?dob ?pobLabel ?dod ?podLabel ?height ?assumedOffice ?endOffice ?ordinal WHERE { # Get all Premiers ?pm p:P39 ?posheld. # with position held
# Check on the position as Prime Minister of Canada ?posheld ps:P39 wd:Q839078 ; # Position held is in Prime Minister of Canada pq:P580 ?assumedOffice . # should have a starttime
OPTIONAL { ?posheld pq:P1545 ?ordinal . } # but not necessarily an ordinal OPTIONAL { ?posheld pq:P582 ?endOffice . } # but not necessarily an endtime
OPTIONAL{ ?pm wdt:P21 ?gender . } # get gender OPTIONAL{ ?pm wdt:P569 ?dob . } # get date of birth OPTIONAL{ ?pm wdt:P19 ?pob . } # get place of birth OPTIONAL{ ?pm wdt:P570 ?dod . } # get date of death OPTIONAL{ ?pm wdt:P20 ?pod . } # get place of death OPTIONAL{ ?pm wdt:P2048 ?height . } # get height
SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title:Prime Ministers of Canada
SELECT ?pm ?pmLabel ?genderLabel ?dob ?pobLabel ?dod ?podLabel ?height ?assumedOffice ?endOffice ?ordinal WHERE {
# Get all Premiers
?pm p:P39 ?posheld. # with position held
# Check on the position as Prime Minister of Canada
?posheld ps:P39 wd:Q839078 ; # Position held is in Prime Minister of Canada
pq:P580 ?assumedOffice . # should have a starttime
OPTIONAL { ?posheld pq:P1545 ?ordinal . } # but not necessarily an ordinal
OPTIONAL { ?posheld pq:P582 ?endOffice . } # but not necessarily an endtime
OPTIONAL{ ?pm wdt:P21 ?gender . } # get gender
OPTIONAL{ ?pm wdt:P569 ?dob . } # get date of birth
OPTIONAL{ ?pm wdt:P19 ?pob . } # get place of birth
OPTIONAL{ ?pm wdt:P570 ?dod . } # get date of death
OPTIONAL{ ?pm wdt:P20 ?pod . } # get place of death
OPTIONAL{ ?pm wdt:P2048 ?height . } # get height
SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en". }
}