what is the {replaces} for {V. P. Singh} has {position held} as {Chief Minister of Uttar Pradesh} ?
When V.P. Singh left his position as Chief Minister of Uttar Pradesh, who replaced him?
Who replaced V.P. Singh as Chief Minister of Uttar Pradesh?
SELECT ?d WHERE { resource:Vishwanath_Pratap_Singh property:position_held ?t . ?t property:position_held resource:Chief_Minister_of_Uttar_Pradesh . ?t property:replaces ?d }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q315338> .
?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/Q28966983> .
?statement <http://www.wikidata.org/entity/P1365> ?value. 
} 

SELECT ?value WHERE { wd:Q315338 p:P39 ?s . ?s ps:P39 wd:Q28966983 . ?s pq:P1365 ?value}