Question: Which area has higher elevation above sea level, Danville (the one whose population is 42944) or Suffolk (the one that shares border with Chesapeake)?
Choices:
Williamsburg
Danville
Lexington
Falls Church
Winchester
Lynchburg
Fairfax
Hampton
Suffolk
Roanoke
Program:
function: Find
inputs: Danville
function: FilterNum
dependencies: 0
inputs: population
42944
=
function: Find
inputs: Chesapeake
function: Relate
dependencies: 2
inputs: shares border with
backward
function: Find
inputs: Suffolk
function: And
dependencies: 3
4
function: SelectBetween
dependencies: 1
5
inputs: elevation above sea level
greater
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "Danville" . ?e <population> ?pv_1 . ?pv_1 <pred:unit> "1" . ?pv_1 <pred:value> "42944"^^xsd:double . } UNION { ?e <pred:name> "Suffolk" . ?e <shares_border_with> ?e_1 . ?e_1 <pred:name> "Chesapeake" . } ?e <elevation_above_sea_level> ?pv . ?pv <pred:value> ?v .  } ORDER BY DESC(?v) LIMIT 1
Answer: Danville