Question: Which area is smaller, Worcester County or Middlesex County (the one that shares border with Norfolk County)?
Choices:
Franklin County
Barnstable County
Suffolk County
Hampshire County
Essex County
Berkshire County
Norfolk County
Worcester County
Middlesex County
Plymouth County
Program:
function: Find
inputs: Worcester County
function: Find
inputs: Norfolk 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> "Worcester County" .  } UNION { ?e <pred:name> "Middlesex County" . ?e <shares_border_with> ?e_1 . ?e_1 <pred:name> "Norfolk County" .   } ?e <area> ?pv . ?pv <pred:value> ?v .  } ORDER BY ?v LIMIT 1
Answer: Worcester County