query-1a986826d51c2f09400c6fda737cfc00
Optimization request: African coups and attempts
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?coup ?coupLabel ?success ?time ?countryLabel WHERE {
?coup wdt:P31 ?type .
filter(?type in (wd:Q45382, wd:Q25906438, wd:Q4460509))
bind (?type != wd:Q25906438 as ?success)
?coup wdt:P17 ?country.
?country wdt:P30 wd:Q15.
optional {?coup wdt:P585 ?time}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
} order by desc(?time)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?country")
v3("?coup"):::projected
v4("?success"):::projected
v1("?time"):::projected
v2("?type")
c10(["bd:serviceParam"]):::iri
c12(["en"]):::literal
c7(["wd:Q15"]):::iri
list0c1(["wd:Q45382"]):::iri
list0c2(["wd:Q25906438"]):::iri
list0c3(["wd:Q4460509"]):::iri
list0c1 --o f0
list0c2 --o f0
list0c3 --o f0
f0[[" in "]]
f0 --> v2
v3 --"wdt:P31"--> v2
bind1[/"?type != 'wd:Q25906438'"/]
v2 --o bind1
bind1 --as--o v4
v3 --"wdt:P17"--> v5
v5 --"wdt:P30"--> c7
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P585".-> v1
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end