what is the {replaces} for {Macbeth, King of Scotland} has {position held} as {monarch of Scotland} ?
Who took over from Macbeth as the new Monarch of Scotland?
Who replaced Macbeth, King of Scotland as the Monarch of Scotland?
SELECT ?p WHERE { ?f property:position_held resource:King_of_Scotland . ?f property:replaces ?p . resource:Macbeth property:position_held ?f }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q244403> .
?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/Q18810063> .
?statement <http://www.wikidata.org/entity/P1365> ?value. 
} 

SELECT ?value WHERE { wd:Q244403 p:P39 ?s . ?s ps:P39 wd:Q18810063 . ?s pq:P1365 ?value}