query-e49a36718cbc5b30bf58920929586904

rq turtle/ttl

| Query: Recent changes | Find images | TABernacle | PetScan | WDQS . Manual changes to the list will be removed on the next update! a botThis list is periodically updated by Manually update list 2023-03-28 2014-11-20 Nicola Sturgeon First Minister of Scotland 2023-03-27 2014-11-21 John Swinney Deputy First Minister of Scotland 2021-05-20 2016-05-18 Fergus Ewing Cabinet Secretary for the Rural Economy and Connectivity 2018-06-26 2021-05-20 2014-11-21 2018-06-26 Michael MathesonHumza Yousaf Cabinet Secretary for Justice 2018-06-26 2016-05-18 Shona Robison Cabinet Secretary for Health and Sport 2020-02-06 2016-05-18 Derek Mackay Cabinet Secretary for Finance and the Constitution 2021-05-20 2016-05-18 Roseanna Cunningham Cabinet Secretary for Environment, Climate Change and Land Reform 2021-05-18 2023-03-28 2016-05-18 2021-05-18 John SwinneyShirley-Anne Somerville Cabinet Secretary for Education and Skills 2018-06-26 2016-05-18 Keith Brown Cabinet Secretary for Economy, Jobs and Fair Work 2020-02-17 2016-05-18 Fiona Hyslop Cabinet Secretary for Culture, Tourism and External Affairs 2021-05-20 2018-06-26 2018-06-26 2016-05-18 Aileen CampbellAngela Constance Cabinet Secretary for Communities, Social Security and Equalities ?mem_end ?mem_start ?who Article End of automatically generated list.--- The underlying query behind this report is:

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 ?position ?positionLabel ?cabinet_start ?cabinet_end ?who ?whoLabel ?mem_start ?mem_end WHERE {
  BIND (wd:Q24083746 AS ?cabinet) 
  ?cabinet wdt:P2670 ?position; wdt:P571 ?cabinet_start .
  OPTIONAL { ?cabinet wdt:P576 ?cabinet_end } .
  BIND(if(BOUND(?cabinet_end), ?cabinet_end, NOW()) as ?effective_cabinet_end)

  OPTIONAL {
    ?who p:P39 ?mem .
    ?mem ps:P39 ?position ; pq:P580 ?mem_start .
    OPTIONAL { ?mem pq:P582 ?mem_end }
    BIND(if(BOUND(?mem_end), ?mem_end, NOW()) as ?effective_end)
    FILTER((?effective_end > ?cabinet_start) && (?mem_start < ?effective_cabinet_end))
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY ?positionLabel ?mem_start

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?cabinet") v8("?cabinet_end"):::projected v4("?cabinet_start"):::projected v9("?effective_cabinet_end") v12("?effective_end") v10("?mem") v11("?mem_end"):::projected v2("?mem_start"):::projected v7("?position"):::projected v1("?positionLabel"):::projected v9("?who"):::projected c9(["bd:serviceParam"]):::iri c11(["en"]):::literal bind0[/"'wd:Q24083746'"/] bind0 --as--o v6 v6 --"p:direct/P2670"--> v7 v6 --"p:direct/P571"--> v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v6 -."p:direct/P576".-> v8 end bind1[/"if(bound(?cabinet_end),?cabinet_end,NOW())"/] v8 --o bind1 bind1 --as--o v9 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v9 -."p:P39".-> v10 v10 --"p:statement/P39"--> v7 v10 --"p:qualifier/P580"--> v2 subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v10 -."p:qualifier/P582".-> v11 end bind2[/"if(bound(?mem_end),?mem_end,NOW())"/] v11 --o bind2 bind2 --as--o v12 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end