what is the {replaced by} for {Hussain Muhammad Ershad} has {position held} as {president of Bangladesh} ?
Which President of Bangledesh replaced Hussain Muhammad Ershad?
what is the replaced by for Hussain Muhammad Ershad has position held as president of Bangladesh ?
SELECT ?v WHERE { ?q property:replaced_by ?v . ?q property:position_held resource:President_of_Bangladesh . resource:Hussain_Muhammad_Ershad property:position_held ?q }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q461816> .
?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/Q596123> .
?statement <http://www.wikidata.org/entity/P1366> ?value. 
} 

SELECT ?value WHERE { wd:Q461816 p:P39 ?s . ?s ps:P39 wd:Q596123 . ?s pq:P1366 ?value}