what is the {end time} for {Aktobe} has {head of government} as {Bekbol Saghyn} ?
On which date did Aktobe replace Bekbol Saghyn as head of government?
When did Aktobe become head of government instead of Bekbol Saghyn?
SELECT ?o WHERE { resource:Aktobe property:head_of_government ?l . ?l property:end_time ?o . ?l property:head_of_government resource:Bekbol_Saghyn }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q477232> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P6> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q21232760> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q477232 p:P6 ?s . ?s ps:P6 wd:Q21232760 . ?s pq:P582 ?value}