What is {position held} of {Mikhail Gorbachev} that is {replaced by} is {Vladimir Ivashko} ?
What was Midhail Gorbachev's title before being replaced by Vladimir Ivashko?
What position did Mikhail Gorbachev hold before being replaced by Vladimir Ivashko?
SELECT ?n WHERE { ?b property:replaced_by resource:Volodymyr_Ivashko . ?b property:position_held ?n . resource:Mikhail_Gorbachev property:position_held ?b }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q30487> .
?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/Q1065213>
} 

SELECT ?obj WHERE { wd:Q30487 p:P39 ?s . ?s ps:P39 ?obj . ?s pq:P1366 wd:Q1065213 }