Question: Which town in Middlesex County, sharing its border with Worcester County, has the smalles area?
Choices:
Greenwich
Westport
Brookline
Kensington
Framingham
West Hartford
Amherst
Uxbridge
Bedford
Concord
Program:
function: Find
inputs: Worcester County
function: Relate
dependencies: 0
inputs: shares border with
forward
function: Find
inputs: Middlesex County
function: And
dependencies: 1
2
function: Relate
dependencies: 3
inputs: located in the administrative territorial entity
backward
function: FilterConcept
dependencies: 4
inputs: town of the United States
function: SelectAmong
dependencies: 5
inputs: area
smallest
SPARQL: SELECT ?e WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "town of the United States" . ?e <located_in_the_administrative_territorial_entity> ?e_1 . ?e_1 <pred:name> "Middlesex County" . ?e_2 <shares_border_with> ?e_1 . ?e_2 <pred:name> "Worcester County" .  ?e <area> ?pv . ?pv <pred:value> ?v .  } ORDER BY ?v LIMIT 1
Answer: Concord