what is the {replaced by} for {Sam Houston} has {position held} as {President of the Republic of Texas} ?
Which was the replacement for Sam Houston as President of the Republic of Texas?
Who replaced Sam Houston as President of the Republic of Texas?
SELECT ?h WHERE { ?e property:position_held resource:President_of_the_Republic_of_Texas . ?e property:replaced_by ?h . resource:Sam_Houston property:position_held ?e }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q216547> .
?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/Q16157683> .
?statement <http://www.wikidata.org/entity/P1366> ?value. 
} 

SELECT ?value WHERE { wd:Q216547 p:P39 ?s . ?s ps:P39 wd:Q16157683 . ?s pq:P1366 ?value}