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