what is the {replaces} for {Thomas Sankara} has {position held} as {Prime Minister of Burkina Faso} ?
Who has replaced Thomas Sankara?
which replaces for thomas sankara has position held as prime minister of burkina faso?
SELECT ?a WHERE { resource:Thomas_Sankara property:position_held ?b . ?b property:position_held resource:Prime_Minister_of_Burkina_Faso . ?b property:replaces ?a }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q202155> .
?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/Q28133105> .
?statement <http://www.wikidata.org/entity/P1365> ?value. 
} 

SELECT ?value WHERE { wd:Q202155 p:P39 ?s . ?s ps:P39 wd:Q28133105 . ?s pq:P1365 ?value}