query-5923aa695603c8ed18dbc8b12b66fb6b
TODO
Use at
- https://query.wikidata.org/sparql
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 ?item ?itemLabel ?ministerLabel ?start WHERE {
?minister wdt:P31 wd:Q294414 ;
wdt:P361 wd:Q930729 .
?item p:P39 ?m.
?m ps:P39 ?minister; pq:P580 ?start .
OPTIONAL { ?m pq:P582 ?end }
FILTER(!BOUND(?end)|| ?end > NOW())
SERVICE wikibase:label { bd:serviceParam wikibase:language "sv,en". }
}
ORDER BY ?start
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?end")
v4("?item"):::projected
v5("?m")
v3("?minister")
v1("?start"):::projected
c10(["bd:serviceParam"]):::iri
c2(["wd:Q294414"]):::iri
c4(["wd:Q930729"]):::iri
c12(["sv,en"]):::literal
f0[["(not bound(?end) || ?end > NOW())"]]
f0 --> v2
v3 --"p:direct/P31"--> c2
v3 --"p:direct/P361"--> c4
v4 --"p:P39"--> v5
v5 --"p:statement/P39"--> v3
v5 --"p:qualifier/P580"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:qualifier/P582".-> v2
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end