Question: Which has more people, New Brunswick (the one that is the headquarter location of Johnson & Johnson) or East Orange?
Choices:
Plainfield
Elizabeth
Hoboken
East Orange
New Brunswick
Passaic
Paterson
Jersey City
Trenton
Atlantic City
Program:
function: Find
inputs: Johnson & Johnson
function: Relate
dependencies: 0
inputs: headquarters location
forward
function: Find
inputs: New Brunswick
function: And
dependencies: 1
2
function: Find
inputs: East Orange
function: SelectBetween
dependencies: 3
4
inputs: population
greater
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "New Brunswick" . ?e_1 <headquarters_location> ?e . ?e_1 <pred:name> "Johnson & Johnson" .   } UNION { ?e <pred:name> "East Orange" .  } ?e <population> ?pv . ?pv <pred:value> ?v .  } ORDER BY DESC(?v) LIMIT 1
Answer: East Orange