what is the {replaces} for {Mohammed Omar} has {position held} as {Emir of Afghanistan} ?
Who was Mohammed Omar's replacement as the Emir of Afghanistan?
Who replaced Mohammed Omar as the Emir of Afghanistan?
SELECT ?u WHERE { ?t property:position_held resource:Emir_of_Afghanistan . ?t property:replaces ?u . resource:Mohammed_Omar property:position_held ?t }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q193968> .
?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/Q17323614> .
?statement <http://www.wikidata.org/entity/P1365> ?value. 
} 

SELECT ?value WHERE { wd:Q193968 p:P39 ?s . ?s ps:P39 wd:Q17323614 . ?s pq:P1365 ?value}