query-374d19b470995f03ae612f3b95cc4f4b
what on earth happened to MPs who died in office? Here, 1854... SELECT ?mp ?mpLabel ?died ?mannerLabel ?causeLabel ?casualtyLabel ?placeLabel WHERE { ?membership wdt:P279 wd:Q16707842 . # all UK MPs ?mp p:P39 ?positionStatement . ?positionStatement ps:P39 ?membership . ?positionStatement pq:P1534 wd:Q5247364 . # ie only those coded as end cause: death in office ?mp wdt:P570 ?died . optional { ?mp wdt:P509 ?cause . } optional { ?mp wdt:P1196 ?manner . } optional { ?mp wdt:P1347 ?casualty . } # military deaths are coded strangely optional { ?mp wdt:P20 ?place . } FILTER (?died >= "1854-01-01T00:00:00Z"^^xsd:dateTime) . FILTER (?died <= "1854-12-31T00:00:00Z"^^xsd:dateTime) . SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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#>
# what on earth happened to MPs who died in office? Here, 1854...
SELECT ?mp ?mpLabel ?died ?mannerLabel ?causeLabel ?casualtyLabel ?placeLabel
WHERE {
?membership wdt:P279 wd:Q16707842 . # all UK MPs
?mp p:P39 ?positionStatement . ?positionStatement ps:P39 ?membership .
?positionStatement pq:P1534 wd:Q5247364 . # ie only those coded as end cause: death in office
?mp wdt:P570 ?died .
optional { ?mp wdt:P509 ?cause . }
optional { ?mp wdt:P1196 ?manner . }
optional { ?mp wdt:P1347 ?casualty . } # military deaths are coded strangely
optional { ?mp wdt:P20 ?place . }
FILTER (?died >= "1854-01-01T00:00:00Z"^^xsd:dateTime) .
FILTER (?died <= "1854-12-31T00:00:00Z"^^xsd:dateTime) .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}