what is the {replaces} for {Albert Gallatin} has {position held} as {United States senator} ?
Who took Alber Gallatin's place as U.S. senator?
Who replaced Albert Gallatin as the United States senator?
SELECT ?z WHERE { ?r property:replaces ?z . resource:Albert_Gallatin property:position_held ?r . ?r property:position_held resource:United States senator }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q500046> .
?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/Q13217683> .
?statement <http://www.wikidata.org/entity/P1365> ?value. 
} 

SELECT ?value WHERE { wd:Q500046 p:P39 ?s . ?s ps:P39 wd:Q13217683 . ?s pq:P1365 ?value}