Question: Which area is smaller, Charlottesville or Portsmouth (the one whose local dialing code is 757)?
Choices:
Roanoke
Winchester
Williamsburg
Suffolk
Charlottesville
Hampton
Portsmouth
Danville
Falls Church
Lynchburg
Program:
function: Find
inputs: Charlottesville
function: Find
inputs: Portsmouth
function: FilterStr
dependencies: 1
inputs: local dialing code
757
function: SelectBetween
dependencies: 0
2
inputs: area
less
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "Charlottesville" . } UNION { ?e <pred:name> "Portsmouth" . ?e <local_dialing_code> ?pv_1 . ?pv_1 <pred:value> "757" . } ?e <area> ?pv . ?pv <pred:value> ?v .  } ORDER BY ?v LIMIT 1
Answer: Charlottesville