Question: Which movie is shorter, Flight (the one whose script is wrote by Frank Capra) or Anger Management (the one that has Jack Nicholson as a cast member)?
Choices:
The Hunchback of Notre Dame
Curse of the Golden Flower
Talk to Her
A Prairie Home Companion
The Towering Inferno
Anger Management
Training Day
The Fifth Element
Pleasantville
Rebecca
Program:
function: Find
inputs: Frank Capra
function: Relate
dependencies: 0
inputs: screenwriter
backward
function: Find
inputs: Flight
function: And
dependencies: 1
2
function: Find
inputs: Jack Nicholson
function: Relate
dependencies: 4
inputs: cast member
backward
function: Find
inputs: Anger Management
function: And
dependencies: 5
6
function: SelectBetween
dependencies: 3
7
inputs: duration
less
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "Flight" . ?e <screenwriter> ?e_1 . ?e_1 <pred:name> "Frank Capra" .   } UNION { ?e <pred:name> "Anger Management" . ?e <cast_member> ?e_2 . ?e_2 <pred:name> "Jack Nicholson" .  } ?e <duration> ?pv . ?pv <pred:value> ?v .  } ORDER BY ?v LIMIT 1
Answer: Anger Management