Question: Which is longer, Toy Story 2 or Shrek the Third that origins from the United States?
Choices:
Winnie the Pooh
Toy Story 2
Beauty and the Beast
The Rescuers
Shrek the Third
Shrek 2
Aladdin
Lilo & Stitch
Renaissance
Peter Pan
Program:
function: Find
inputs: Toy Story 2
function: Find
inputs: United States of America
function: Relate
dependencies: 1
inputs: country of origin
backward
function: Find
inputs: Shrek the Third
function: And
dependencies: 2
3
function: SelectBetween
dependencies: 0
4
inputs: duration
greater
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "Toy Story 2" .  } UNION { ?e <pred:name> "Shrek the Third" . ?e <country_of_origin> ?e_1 . ?e_1 <pred:name> "United States of America" .   } ?e <duration> ?pv . ?pv <pred:value> ?v .  } ORDER BY DESC(?v) LIMIT 1
Answer: Toy Story 2