Question: What position did James G. Blaine hold when he was replaced by John W. Foster?
Paraphrase: For what position did John W. Foster replace James G. Blaine?
SPARQL (Wikidata): SELECT ?obj WHERE { wd:Q448778 p:P39 ?s . ?s ps:P39 ?obj . ?s pq:P1366 wd:Q703642 }