What is {position held} of {Charles the Bald} that is {replaced by} is {Louis the Stammerer} ?
For which position did Charles the Bald replace Louis the Stammerer?
Charles the Bald replaced Louis the Stammerer in which position?
SELECT ?l WHERE { ?e property:position_held ?l . resource:Charles_the_Bald property:position_held ?e . ?e property:replaced_by resource:Louis_the_Stammerer }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q71231> .
?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/P1366> <http://wikidata.dbpedia.org/resource/Q182840>
} 

SELECT ?obj WHERE { wd:Q71231 p:P39 ?s . ?s ps:P39 ?obj . ?s pq:P1366 wd:Q182840 }