Question: Which movie is shorter, Bad Teacher (the one that has Cameron Diaz as a cast member) or Tangled (the one that has Lorraine Bracco as a cast member)?
Choices:
The Hunchback of Notre Dame
The Towering Inferno
Rebecca
Curse of the Golden Flower
Pleasantville
Bad Teacher
The Fifth Element
Training Day
A Prairie Home Companion
Tangled
Program:
function: Find
inputs: Cameron Diaz
function: Relate
dependencies: 0
inputs: cast member
backward
function: Find
inputs: Bad Teacher
function: And
dependencies: 1
2
function: Find
inputs: Lorraine Bracco
function: Relate
dependencies: 4
inputs: cast member
backward
function: Find
inputs: Tangled
function: And
dependencies: 5
6
function: SelectBetween
dependencies: 3
7
inputs: duration
less
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "Bad Teacher" . ?e <cast_member> ?e_1 . ?e_1 <pred:name> "Cameron Diaz" .   } UNION { ?e <pred:name> "Tangled" . ?e <cast_member> ?e_2 . ?e_2 <pred:name> "Lorraine Bracco" .  } ?e <duration> ?pv . ?pv <pred:value> ?v .  } ORDER BY ?v LIMIT 1
Answer: Tangled