Question: Which occupies the greatest area, of US states bordering Montana (which borders the Northwest Territories)?
Choices:
North Dakota
Massachusetts
Wyoming
Florida
California
Hawaii
Idaho
Illinois
Colorado
South Dakota
Program:
function: Find
inputs: Northwest Territories
function: Relate
dependencies: 0
inputs: shares border with
backward
function: Find
inputs: Montana
function: And
dependencies: 1
2
function: Relate
dependencies: 3
inputs: shares border with
backward
function: FilterConcept
dependencies: 4
inputs: state of the United States
function: SelectAmong
dependencies: 5
inputs: area
largest
SPARQL: SELECT ?e WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "state of the United States" . ?e <shares_border_with> ?e_1 . ?e_1 <pred:name> "Montana" . ?e_1 <shares_border_with> ?e_2 . ?e_2 <pred:name> "Northwest Territories" .  ?e <area> ?pv . ?pv <pred:value> ?v .  } ORDER BY DESC(?v) LIMIT 1
Answer: Wyoming