query-c9c7fad65d6885bada31122b27de5735

rq turtle/ttl

All UK and pre-Union MPs, including Ireland and Scotland

NB this omits the Commonwealth period which we don't yet model

SELECT distinct ?person1 ?person1Label WHERE { { ?person1 wdt:P31 wd:Q5 ; wdt:P39 [ wdt:P279 wd:Q16707842 ] } # UK MP UNION { ?person1 wdt:P31 wd:Q5 ; wdt:P39 [ wdt:P279 wd:Q18015642 ] } # British MP UNION { ?person1 wdt:P31 wd:Q5 ; wdt:P39 [ wdt:P279* wd:Q18018860 ] } # English MP UNION { ?person1 wdt:P31 wd:Q5 ; wdt:P1614 [] } # or in HoP but without an item SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
# look for articles (sitelinks) in English ("en") OPTIONAL { ?article schema:about ?person1 . ?article schema:inLanguage "en" . ?article schema:isPartOf https://en.wikipedia.org/ } # but select items with no such article FILTER (!BOUND(?article)) }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#All UK and pre-Union MPs, including Ireland and Scotland
#NB this omits the Commonwealth period which we don't yet model

SELECT distinct ?person1 ?person1Label
WHERE {
 { ?person1 wdt:P31 wd:Q5 ; wdt:P39 [ wdt:P279* wd:Q16707842 ] } # UK MP
 UNION { ?person1 wdt:P31 wd:Q5 ; wdt:P39 [ wdt:P279* wd:Q18015642 ] } # British MP
 UNION { ?person1 wdt:P31 wd:Q5 ; wdt:P39 [ wdt:P279* wd:Q18018860 ] } # English MP
 UNION { ?person1 wdt:P31 wd:Q5 ; wdt:P1614 [] } # or in HoP but without an item
 SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }  
 # look for articles (sitelinks) in English ("en")
  OPTIONAL {
    ?article schema:about ?person1 .
    ?article schema:inLanguage "en" .
    ?article schema:isPartOf <https://en.wikipedia.org/>
  }
  # but select items with no such article
  FILTER (!BOUND(?article))
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?article") v2("?person1"):::projected a4((" ")) a1((" ")) a2((" ")) a3((" ")) c7(["wd:Q18018860"]):::iri c4(["wd:Q16707842"]):::iri c12(["en"]):::literal c16([https://en.wikipedia.org/]):::iri c10(["bd:serviceParam"]):::iri c2(["wd:Q5"]):::iri c6(["wd:Q18015642"]):::iri f0[["not bound(?article)"]] f0 --> v1 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; subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c2 v2 --"wdt:P1614"--> a4 end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c2 a3 --"wdt:P279"--> c7 v2 --"wdt:P39"--> a3 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c2 a2 --"wdt:P279"--> c6 v2 --"wdt:P39"--> a2 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c2 a1 --"wdt:P279"--> c4 v2 --"wdt:P39"--> a1 end union0r <== or ==> union0l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."schema:about".-> v2 v1 --"schema:inLanguage"--> c12 v1 --"schema:isPartOf"--> c16 end