What is {position held} of {John Curtin} that is {replaced by} is {Kim Beazley} ?
Kim Beazly replaced John Curtin in which position?
What position did Kim Beazly replace John Curtin in?
SELECT ?v WHERE { ?l property:position_held ?v . resource:John_Curtin property:position_held ?l . ?l property:replaced_by resource:Kim_Beazley }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q23375> .
?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> ?obj .
?statement <http://www.wikidata.org/entity/P1366> <http://wikidata.dbpedia.org/resource/Q2266155>
} 

SELECT ?obj WHERE { wd:Q23375 p:P39 ?s . ?s ps:P39 ?obj . ?s pq:P1366 wd:Q2266155 }