What is {position held} of {George V} that is {replaces} is {Edward VII} ?
What position did Edward VIII, who was replaced by George V, have?
What position did George V hold that replaced Edward VII?
SELECT ?f WHERE { resource:George_V property:position_held ?e . ?e property:replaces resource:Edward_VII . ?e property:position_held ?f }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q269412> .
?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> ?obj .
?statement <http://www.wikidata.org/entity/P1365> <http://wikidata.dbpedia.org/resource/Q20875>
} 

SELECT ?obj WHERE { wd:Q269412 p:P39 ?s . ?s ps:P39 ?obj . ?s pq:P1365 wd:Q20875 }