query-bf05ce102fdc4dc521c0a7bbb50105e9

rq turtle/ttl

People known to have been killed by an MP

Use at

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 DISTINCT ?victim ?victimLabel ?killer ?killerLabel ?died
WHERE {
          ?victim wdt:P31 wd:Q5 ; wdt:P157 ?killer .    # person was killed by a known person

        { ?killer wdt:P39 [ wdt:P279* wd:Q16707842 ] }  # killer was a UK MP
  UNION { ?killer wdt:P39 [ wdt:P279* wd:Q18015642 ] }  # or a British MP (to 1801)
  UNION { ?killer wdt:P39 [ wdt:P279* wd:Q18018860 ] }  # or an English MP (to 1707)

  OPTIONAL { ?victim wdt:P570 ?died }                   # date of death if known

  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }  # get their names
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?died"):::projected v2("?killer"):::projected v1("?victim"):::projected a1((" ")) a2((" ")) a3((" ")) c8(["wd:Q18018860"]):::iri c5(["wd:Q16707842"]):::iri c13(["en"]):::literal c11(["bd:serviceParam"]):::iri c2(["wd:Q5"]):::iri c7(["wd:Q18015642"]):::iri v1 --"wdt:P31"--> c2 v1 --"wdt:P157"--> v2 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; a3 --"wdt:P279"--> c8 v2 --"wdt:P39"--> a3 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; a2 --"wdt:P279"--> c7 v2 --"wdt:P39"--> a2 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; a1 --"wdt:P279"--> c5 v2 --"wdt:P39"--> a1 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P570".-> v3 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end