query-29aee150ad24164f4e9482600c5d51c9

rq turtle/ttl

Membership Grids for Scottish Parliament termsits talk page on (Q30580541)Member of the 1st Scottish Parliament Initial version at for Also, to help find cases where two memberships have been combined, and need split: TODO

Use at

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#>
SELECT DISTINCT ?who ?whoLabel ?positionLabel ?start1 ?start2 {
  ?position wdt:P279* wd:Q1711695 .
  ?who p:P39 [ ps:P39 ?position ; pq:P580 ?start1 ; pq:P580 ?start2 ] .
  FILTER (?start2 > ?start1) 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
ORDER BY ?start1 ?whoLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?position") v1("?start1"):::projected v3("?start2"):::projected v5("?who"):::projected v2("?whoLabel"):::projected a1((" ")) c7(["bd:serviceParam"]):::iri c9(["en"]):::literal c2(["wd:Q1711695"]):::iri f0[["?start2 > ?start1"]] f0 --> v3 f0 --> v1 v4 --"p:direct/P279"--> c2 a1 --"p:statement/P39"--> v4 a1 --"p:qualifier/P580"--> v1 a1 --"p:qualifier/P580"--> v3 v5 --"p:P39"--> a1 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end