Question: What city is the capital of the Massachusetts county containing Amherst?
Choices: Taunton
Northampton
Salem
Waukegan
Columbus
Pittsfield
Franklin
Moline
Boston
Bradenton
SPARQL: SELECT DISTINCT ?e WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "city of the United States" . ?e_1 <capital> ?e . ?e_1 <pred:instance_of> ?c_1 . ?c_1 <pred:name> "county of Massachusetts" . ?e_3 <located_in_the_administrative_territorial_entity> ?e_1 . ?e_3 <pred:name> "Amherst" .   }
Program:
function: Find
inputs: Amherst
function: Relate
dependencies: 0
inputs: located in the administrative territorial entity
forward
function: FilterConcept
dependencies: 1
inputs: county of Massachusetts
function: Relate
dependencies: 2
inputs: capital
forward
function: FilterConcept
dependencies: 3
inputs: city of the United States
function: What
dependencies: 4
Answer: Northampton