Question: Which movie is longer, Alexander the Great (the one that is shot in Madrid) or Cairo (the one whose color is black-and-white)?
Choices:
The Fifth Element
Curse of the Golden Flower
Alexander the Great
The Hunchback of Notre Dame
A Prairie Home Companion
Training Day
The Towering Inferno
Rebecca
Talk to Her
Cairo
Program:
function: Find
inputs: Madrid
function: Relate
dependencies: 0
inputs: filming location
backward
function: Find
inputs: Alexander the Great
function: And
dependencies: 1
2
function: Find
inputs: black-and-white
function: Relate
dependencies: 4
inputs: color
backward
function: Find
inputs: Cairo
function: And
dependencies: 5
6
function: SelectBetween
dependencies: 3
7
inputs: duration
greater
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "Alexander the Great" . ?e <filming_location> ?e_1 . ?e_1 <pred:name> "Madrid" .   } UNION { ?e <pred:name> "Cairo" . ?e <color> ?e_2 . ?e_2 <pred:name> "black-and-white" .  } ?e <duration> ?pv . ?pv <pred:value> ?v .  } ORDER BY DESC(?v) LIMIT 1
Answer: Alexander the Great