Question: Which has more people, Belleville (the one that shares border with Newark) or West Orange?
Choices:
West Orange
Verona
Wexford
Princeton
North Hollywood
Livingston
Belleville
Red Bank
Whanganui
Ridgewood
Program:
function: Find
inputs: Newark
function: Relate
dependencies: 0
inputs: shares border with
backward
function: Find
inputs: Belleville
function: And
dependencies: 1
2
function: Find
inputs: West Orange
function: SelectBetween
dependencies: 3
4
inputs: population
greater
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "Belleville" . ?e <shares_border_with> ?e_1 . ?e_1 <pred:name> "Newark" .   } UNION { ?e <pred:name> "West Orange" .  } ?e <population> ?pv . ?pv <pred:value> ?v .  } ORDER BY DESC(?v) LIMIT 1
Answer: West Orange