what is the {replaces} for {Napoleon III} has {position held} as {president of the French Republic} ?
Who was the president of the French Republic after Napoleon III?
Who replaced Napoleon III as president of the French Republic?
SELECT ?c WHERE { ?y property:position_held resource:President_of_the_French_Republic . resource:Napoleon_III property:position_held ?y . ?y property:replaces ?c }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q7721> .
?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/Q191954> .
?statement <http://www.wikidata.org/entity/P1365> ?value. 
} 

SELECT ?value WHERE { wd:Q7721 p:P39 ?s . ?s ps:P39 wd:Q191954 . ?s pq:P1365 ?value}