Question: Does Georgia (the one that has a diplomatic relation with Kazakhstan) or Thailand have greater GDP (PPP) ?
Choices:
Georgia
Germany
Mozambique
Namibia
Zimbabwe
Dubai
Thailand
Eswatini
Colombia
Sierra Leone
Program:
function: Find
inputs: Kazakhstan
function: Relate
dependencies: 0
inputs: diplomatic relation
forward
function: Find
inputs: Georgia
function: And
dependencies: 1
2
function: Find
inputs: Thailand
function: SelectBetween
dependencies: 3
4
inputs: GDP (PPP)
greater
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "Georgia" . ?e_1 <diplomatic_relation> ?e . ?e_1 <pred:name> "Kazakhstan" .   } UNION { ?e <pred:name> "Thailand" .  } ?e <GDP_(PPP)> ?pv . ?pv <pred:value> ?v .  } ORDER BY DESC(?v) LIMIT 1
Answer: Thailand