what is the {end time} for {Kwame Nkrumah} has {position held} as {Prime Minister of Ghana} ?
Kwame Nkruman was Prime Minister of Ghana during what years?
When did Kwame Nkruman hold the position as Prime Minister of Ghana?
SELECT ?w WHERE { resource:Kwame_Nkrumah property:position_held ?k . ?k property:position_held resource:Prime_Minister_of_Ghana . ?k property:end_time ?w }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q8620> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P39> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q3657870> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q8620 p:P39 ?s . ?s ps:P39 wd:Q3657870 . ?s pq:P582 ?value}