Question: Which area is larger, Western Cape or Punjab (the one that shares border with Sindh)?
Choices:
New South Wales
Upper Austria
Western Cape
Minas Gerais
Lublin Voivodeship
Tasmania
Greater Poland Voivodeship
Chiapas
Punjab
Podlaskie Voivodeship
Program:
function: Find
inputs: Western Cape
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: area
greater
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "Western Cape" .  } UNION { ?e <pred:name> "Punjab" . ?e <shares_border_with> ?e_1 . ?e_1 <pred:name> "Sindh" .   } ?e <area> ?pv . ?pv <pred:value> ?v .  } ORDER BY DESC(?v) LIMIT 1
Answer: Punjab