query-b26853cff662ecaa3b30ec4a5dbd53f0

rq turtle/ttl

People who sat in the Commons and in a foreign parliament

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 ?person ?personLabel ?positionLabel ?countryLabel
WHERE {
        { ?person wdt:P39 [ wdt:P279* wd:Q16707842 ] }  # person was a UK MP
  UNION { ?person wdt:P39 [ wdt:P279* wd:Q18015642 ] }  # or a British MP (to 1801)
  UNION { ?person wdt:P39 [ wdt:P279* wd:Q18018860 ] }  # or an English MP (to 1707)
  ?person wdt:P39 ?position .          # who held some position
  ?position wdt:P279* wd:Q486839 .       # which is a subclass of member of parliament
  ?position wdt:P17 ?country .           # and which applies to a country which is
  FILTER ( ?country != wd:Q145 )           # not UK & NI
  FILTER ( ?country != wd:Q174193 )        # not UK & Ireland
  FILTER ( ?country != wd:Q161885 )        # not GB
  FILTER ( ?country != wd:Q215530 )        # not Kingdom of Ireland
  FILTER ( ?country != wd:Q844250 )        # not Lordship of Ireland
  FILTER ( ?country != wd:Q179876 )        # not Kingdom of England
  FILTER ( ?country != wd:Q230791 )        # not Kingdom of Scotland
  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; v1("?country") v2("?person"):::projected v3("?position") a1((" ")) a2((" ")) a3((" ")) c12(["wd:Q18018860"]):::iri c9(["wd:Q16707842"]):::iri c18(["en"]):::literal c13(["wd:Q486839"]):::iri c16(["bd:serviceParam"]):::iri c11(["wd:Q18015642"]):::iri f0[["?country != 'wd:Q230791'"]] f0 --> v1 f1[["?country != 'wd:Q179876'"]] f1 --> v1 f2[["?country != 'wd:Q844250'"]] f2 --> v1 f3[["?country != 'wd:Q215530'"]] f3 --> v1 f4[["?country != 'wd:Q161885'"]] f4 --> v1 f5[["?country != 'wd:Q174193'"]] f5 --> v1 f6[["?country != 'wd:Q145'"]] f6 --> 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; a3 --"wdt:P279"--> c12 v2 --"wdt:P39"--> a3 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; a2 --"wdt:P279"--> c11 v2 --"wdt:P39"--> a2 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; a1 --"wdt:P279"--> c9 v2 --"wdt:P39"--> a1 end union0r <== or ==> union0l end v2 --"wdt:P39"--> v3 v3 --"wdt:P279"--> c13 v3 --"wdt:P17"--> v1 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c16 --"wikibase:language"--> c18 end