Question: Of human settlements bordering Orange, which has a common border with Montclair, which boasts the highest population count?
Choices:
Princeton
North Hollywood
Ridgewood
Wexford
West Orange
Verona
Montclair
Livingston
Red Bank
Whanganui
Program:
function: Find
inputs: Montclair
function: Relate
dependencies: 0
inputs: shares border with
forward
function: Find
inputs: Orange
function: And
dependencies: 1
2
function: Relate
dependencies: 3
inputs: shares border with
forward
function: FilterConcept
dependencies: 4
inputs: human settlement
function: SelectAmong
dependencies: 5
inputs: population
largest
SPARQL: SELECT ?e WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "human settlement" . ?e_1 <shares_border_with> ?e . ?e_1 <pred:name> "Orange" . ?e_2 <shares_border_with> ?e_1 . ?e_2 <pred:name> "Montclair" .  ?e <population> ?pv . ?pv <pred:value> ?v .  } ORDER BY DESC(?v) LIMIT 1
Answer: West Orange