what is the {replaces} for {Louis XII of France} has {position held} as {King of France} ?
[]
Who replaced Louis XII of France as the King of France?
SELECT ?j WHERE { resource:Louis_XII_of_France property:position_held ?w . ?w property:replaces ?j . ?w property:position_held resource:King_of_France }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q58514> .
?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/Q18384454> .
?statement <http://www.wikidata.org/entity/P1365> ?value. 
} 

SELECT ?value WHERE { wd:Q58514 p:P39 ?s . ?s ps:P39 wd:Q18384454 . ?s pq:P1365 ?value}