Question: Which has more people, Troy (the one that is located in or next to Hudson River) or Yonkers?
Choices:
Utica
Auburn
Glen Cove
Troy
Long Beach
Yonkers
Elmira
Syracuse
White Plains
Glens Falls
Program:
function: Find
inputs: Hudson River
function: Relate
dependencies: 0
inputs: located in or next to body of water
backward
function: Find
inputs: Troy
function: And
dependencies: 1
2
function: Find
inputs: Yonkers
function: SelectBetween
dependencies: 3
4
inputs: population
greater
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "Troy" . ?e <located_in_or_next_to_body_of_water> ?e_1 . ?e_1 <pred:name> "Hudson River" .   } UNION { ?e <pred:name> "Yonkers" .  } ?e <population> ?pv . ?pv <pred:value> ?v .  } ORDER BY DESC(?v) LIMIT 1
Answer: Yonkers