what is the {replaced by} for {Lal Bahadur Shastri} has {position held} as {Minister of Home Affairs} ?
Who was successor of Lal Bahadur Shastri as the Minister of Home Affairs?
Who replaced Lal Bahadur Shastri as the Minister of Home Affairs?
SELECT ?o WHERE { ?d property:replaced_by ?o . ?d property:position_held resource:Minister_of_Home_Affairs . resource:Lal_Bahadur_Shastri property:position_held ?d }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q244689> .
?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/Q3440901> .
?statement <http://www.wikidata.org/entity/P1366> ?value. 
} 

SELECT ?value WHERE { wd:Q244689 p:P39 ?s . ?s ps:P39 wd:Q3440901 . ?s pq:P1366 ?value}