query-50bd774767258eb1b9148c643d536533

rq turtle/ttl

Country of Constituency? that information. haveI wanted to run reports based on which MPs were elected to constituencies in Scotland, Wales, Northern Ireland, or England, but I'm not so sure we actually set on them (with wildly inconsistent types of entry where it is set): (P131)located in the administrative territorial entity Only 57 of the constituencies have a

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 ?item ?itemLabel ?territory ?territoryLabel {
  ?item wdt:P31 wd:Q27971968 .
  FILTER NOT EXISTS { ?item wdt:P576 [] }
  OPTIONAL { ?item wdt:P131 ?territory }
  SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' }
}
ORDER BY ?itemLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?item"):::projected v1("?itemLabel"):::projected v3("?territory"):::projected a1((" ")) c6(["bd:serviceParam"]):::iri c3(["wd:Q27971968"]):::iri c8(["en"]):::literal f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"wdt:P576"--> e0a1 e0v1("?item"):::projected e0a1((" ")):::projected end f0--EXISTS--> f0e0 f0 --> v2 f0 --> c1 f0 --> a1 v2 --"wdt:P576"--> a1 v2 --"wdt:P31"--> c3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P131".-> v3 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end