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