what is the {replaced by} for {Albus Dumbledore} has {position held} as {headmaster of Hogwarts} ?
Who succeeded Dumbledore as Hogwart's headmaster?
Who replaced Albus Dumbledore as headmaster of Hogwarts?
SELECT ?d WHERE { ?p property:replaced_by ?d . ?p property:position_held resource:Headmaster_of_Hogwarts . resource:Albus_Dumbledore property:position_held ?p }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q712548> .
?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/Q2473303> .
?statement <http://www.wikidata.org/entity/P1366> ?value. 
} 

SELECT ?value WHERE { wd:Q712548 p:P39 ?s . ?s ps:P39 wd:Q2473303 . ?s pq:P1366 ?value}