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