query-291ec030dab462e64ebd448e6aea3350
Durée des mandats des premiers ministres
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 ?ministere ?ministereLabel ?datedebut ?datefin ?image ?duree_mandat WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
?item p:P39 ?statement.
?statement ps:P39 ?ministere.
?ministere (wdt:P279*) wd:Q1587677 ;
wdt:P17 wd:Q142.
?statement pq:P580 ?datedebut.
?statement pq:P582 ?datefin.
BIND( (?datefin - ?datedebut) AS ?duree_mandat )
OPTIONAL { ?item wdt:P18 ?image. }
FILTER(YEAR(?datedebut) >= 1945).
}
ORDER BY DESC (?duree_mandat)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?datedebut"):::projected
v6("?datefin"):::projected
v7("?duree_mandat"):::projected
v7("?image"):::projected
v3("?item"):::projected
v5("?ministere"):::projected
v4("?statement")
c5(["fr"]):::literal
c9(["wd:Q1587677"]):::iri
c3(["bd:serviceParam"]):::iri
c11(["wd:Q142"]):::iri
f0[["year-from-dateTime(?datedebut) >= '1945^^xsd:integer'"]]
f0 --> v2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c3 --"wikibase:language"--> c5
end
v3 --"p:P39"--> v4
v4 --"p:statement/P39"--> v5
v5 --"p:direct/P279"--> c9
v5 --"p:direct/P17"--> c11
v4 --"p:qualifier/P580"--> v2
v4 --"p:qualifier/P582"--> v6
bind1[/"?datefin - ?datedebut"/]
v6 --o bind1
v2 --o bind1
bind1 --as--o v7
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:direct/P18".-> v7
end