Question: Which city has the larger population, Portsmouth (whose elevation is 162 meters above sea level) or Bangor (whose population is 33039)?
Choices:
Bangor
Columbus
Compton
New Haven
Greenville
Franklin
Waukegan
Lansing
Portsmouth
Boulder
Answer: Bangor
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "Portsmouth" . ?e <elevation_above_sea_level> ?pv_1 . ?pv_1 <pred:unit> "metre" . ?pv_1 <pred:value> "162"^^xsd:double . } UNION { ?e <pred:name> "Bangor" . ?e <population> ?pv_2 . ?pv_2 <pred:unit> "1" . ?pv_2 <pred:value> "33039"^^xsd:double . } ?e <population> ?pv . ?pv <pred:value> ?v .  } ORDER BY DESC(?v) LIMIT 1
Program:
function: Find
inputs: Portsmouth
function: FilterNum
dependencies: 0
inputs: elevation above sea level
162 metre
=
function: Find
inputs: Bangor
function: FilterNum
dependencies: 2
inputs: population
33039
=
function: SelectBetween
dependencies: 1
3
inputs: population
greater