Question: Which has less area, Gloucester County or Middlesex County that borders Monmouth County?
Choices:
Burlington County
Gloucester County
Monmouth County
Hunterdon County
Passaic County
Cumberland County
Middlesex County
Bergen County
Morris County
Hudson County
Program:
function: Find
inputs: Gloucester County
function: Find
inputs: Monmouth County
function: Relate
dependencies: 1
inputs: shares border with
forward
function: Find
inputs: Middlesex County
function: And
dependencies: 2
3
function: SelectBetween
dependencies: 0
4
inputs: area
less
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "Gloucester County" .  } UNION { ?e <pred:name> "Middlesex County" . ?e_1 <shares_border_with> ?e . ?e_1 <pred:name> "Monmouth County" .   } ?e <area> ?pv . ?pv <pred:value> ?v .  } ORDER BY ?v LIMIT 1
Answer: Middlesex County