what is the {replaces} for {John A. Macdonald} has {position held} as {member of the House of Commons of Canada} ?
When someone took over for John A. MacDonald as a member of the House of Commons, what was the date?
When was John A. MacDonald replaced as a member of the House of Commons?
SELECT ?k WHERE { resource:John_A._Macdonald property:position_held ?y . ?y property:replaces ?k . ?y property:position_held resource:member_of_the_House_of_Commons_of_Canada }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q128702> .
?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/Q15964890> .
?statement <http://www.wikidata.org/entity/P1365> ?value. 
} 

SELECT ?value WHERE { wd:Q128702 p:P39 ?s . ?s ps:P39 wd:Q15964890 . ?s pq:P1365 ?value}