Question: Does Morris County or Middlesex County,  the one that shares a border with Monmouth County, have less area?
Choices:
Monmouth County
Hudson County
Bergen County
Gloucester County
Burlington County
Hunterdon County
Passaic County
Morris County
Middlesex County
Cumberland County
Program:
function: Find
inputs: Morris County
function: Find
inputs: Monmouth County
function: Relate
dependencies: 1
inputs: shares border with
backward
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> "Morris County" .  } UNION { ?e <pred:name> "Middlesex County" . ?e <shares_border_with> ?e_1 . ?e_1 <pred:name> "Monmouth County" .   } ?e <area> ?pv . ?pv <pred:value> ?v .  } ORDER BY ?v LIMIT 1
Answer: Middlesex County