Question: Which has more people, Melaka or Punjab (the one that shares border with Sindh)?
Choices:
Greater Poland Voivodeship
New South Wales
Minas Gerais
Upper Austria
Lublin Voivodeship
Melaka
Podlaskie Voivodeship
Chiapas
Punjab
Tasmania
Program:
function: Find
inputs: Melaka
function: Find
inputs: Sindh
function: Relate
dependencies: 1
inputs: shares border with
backward
function: Find
inputs: Punjab
function: And
dependencies: 2
3
function: SelectBetween
dependencies: 0
4
inputs: population
greater
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "Melaka" .  } UNION { ?e <pred:name> "Punjab" . ?e <shares_border_with> ?e_1 . ?e_1 <pred:name> "Sindh" .   } ?e <population> ?pv . ?pv <pred:value> ?v .  } ORDER BY DESC(?v) LIMIT 1
Answer: Punjab