Question: Which movie is shorter, Apache (the one that has Burt Lancaster as a cast member) or Hamlet (the one whose composer is Ennio Morricone)?
Choices:
The Fifth Element
Curse of the Golden Flower
Pleasantville
Hamlet
Rebecca
Talk to Her
Training Day
Apache
A Prairie Home Companion
The Towering Inferno
Program:
function: Find
inputs: Burt Lancaster
function: Relate
dependencies: 0
inputs: cast member
backward
function: Find
inputs: Apache
function: And
dependencies: 1
2
function: Find
inputs: Ennio Morricone
function: Relate
dependencies: 4
inputs: composer
backward
function: Find
inputs: Hamlet
function: And
dependencies: 5
6
function: SelectBetween
dependencies: 3
7
inputs: duration
less
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "Apache" . ?e <cast_member> ?e_1 . ?e_1 <pred:name> "Burt Lancaster" .   } UNION { ?e <pred:name> "Hamlet" . ?e <composer> ?e_2 . ?e_2 <pred:name> "Ennio Morricone" .  } ?e <duration> ?pv . ?pv <pred:value> ?v .  } ORDER BY ?v LIMIT 1
Answer: Apache