What is {position held} of {Carlos Andrés Pérez da costa} that is {replaced by} is {Luis Herrera Campins} ?
What year did Luis Herrera Campins replace Andres Perez da costa and what position did he hold?
When Carlos Andres Perez da costa was replaced by Luis Herrera Campins, what position did he hold?
SELECT ?k WHERE { resource:Carlos_Andrés_Pérez property:position_held ?c . ?c property:replaced_by resource:Luis_Herrera_Campins . ?c property:position_held ?k }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q295790> .
?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/Q455661>
} 

SELECT ?obj WHERE { wd:Q295790 p:P39 ?s . ?s ps:P39 ?obj . ?s pq:P1366 wd:Q455661 }