What is {position held} of {John Tyler} that is {replaces} is {William Henry Harrison} ?
In what position did John Tyler played while replacing Henry Harrison?
At what role did John Tyler replace William Henry Harrison?
SELECT ?l WHERE { ?d property:replaces resource:William_Henry_Harrison . ?d property:position_held ?l . resource:John_Tyler property:position_held ?d }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q11881> .
?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/Q11869>
} 

SELECT ?obj WHERE { wd:Q11881 p:P39 ?s . ?s ps:P39 ?obj . ?s pq:P1365 wd:Q11869 }