What is {position held} of {Pepin of Herstal} that is {replaces} is {Wulfoald} ?
At what role did Wulfoald took the place of Pepin Herstal?
What position of Pepin Herstal replaced Wulfoald?
SELECT ?o WHERE { ?d property:replaces resource:Wulfoald . ?d property:position_held ?o . resource:Pepin_of_Herstal 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/Q91392> .
?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/Q980925>
} 

SELECT ?obj WHERE { wd:Q91392 p:P39 ?s . ?s ps:P39 ?obj . ?s pq:P1365 wd:Q980925 }