what is the {replaced by} for {Lee Kuan Yew} has {position held} as {Prime Minister of Singapore} ?
Who took over for Lee Kuan Yew as Singapore's Prime Minister?
Who replaced Lee Kuan Yew as the Prime Minister of Singapore?
SELECT ?j WHERE { ?e property:replaced_by ?j . resource:Lee_Kuan_Yew property:position_held ?e . ?e property:position_held resource:Prime_Minister_of_Singapore }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q131248> .
?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/Q866756> .
?statement <http://www.wikidata.org/entity/P1366> ?value. 
} 

SELECT ?value WHERE { wd:Q131248 p:P39 ?s . ?s ps:P39 wd:Q866756 . ?s pq:P1366 ?value}