what is the {replaced by} for {Peter Damian} has {position held} as {cardinal-bishop} ?
Peter Damian was replaced by which cardinal-bishop?
Who replaced Peter Damian as the cardinal-bishop?
SELECT ?z WHERE { ?y property:position_held resource:cardinal-bishop . ?y property:replaced_by ?z . resource:Peter_Damian property:position_held ?y }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q258369> .
?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/Q1729113> .
?statement <http://www.wikidata.org/entity/P1366> ?value. 
} 

SELECT ?value WHERE { wd:Q258369 p:P39 ?s . ?s ps:P39 wd:Q1729113 . ?s pq:P1366 ?value}