query-48f08d702ab1c35b6dd6c32658921468
Query for current minister of active ministries of the Republic of KazakhstanThis query returns the active ministers of the active ministries of the Republic of Kazakhstan. The query should give 21 + 1 result (21 active ministers + the prime minister).
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 DISTINCT ?organization ?organizationLabel ?person ?personLabel
WHERE {
?minister wdt:P279* wd:Q83307;
wdt:P1001 wd:Q232;
wdt:P2389 ?organization.
OPTIONAL {
?person wdt:P39 ?minister.
FILTER NOT EXISTS { ?person p:P39 ?positionStatement. ?positionStatement ps:P39 ?minister. ?positionStatement pq:P582 ?endTime. }
}
FILTER NOT EXISTS { ?organization wdt:P576 ?dissolved. }
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;
v2("?dissolved")
v6("?endTime")
v5("?minister")
v1("?organization"):::projected
v3("?person"):::projected
v4("?positionStatement")
c14(["en"]):::literal
c6(["wd:Q83307"]):::iri
c12(["bd:serviceParam"]):::iri
c8(["wd:Q232"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"p:direct/P576"--> e0v2
e0v2("?dissolved"):::projected
e0v1("?organization"):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> v2
v1 --"p:direct/P576"--> v2
v5 --"p:direct/P279"--> c6
v5 --"p:direct/P1001"--> c8
v5 --"p:direct/P2389"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:direct/P39".-> v5
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
end