What is {position held} of {Klement Gottwald} that is {replaces} is {Edvard Beneš} ?
Edvard Benes was replaced by Klement Gottwald, what position was he replaced by?
From what position was Klement Gottwald replaced by Edvard Beneš?
SELECT ?g WHERE { ?q property:replaces resource:Edvard_Beneš . ?q property:position_held ?g . resource:Klement_Gottwald property:position_held ?q }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q296054> .
?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/P1365> <http://wikidata.dbpedia.org/resource/Q152274>
} 

SELECT ?obj WHERE { wd:Q296054 p:P39 ?s . ?s ps:P39 ?obj . ?s pq:P1365 wd:Q152274 }