Question: Which has a greater duration, Great Expectations (whose script is wrote by David Lean) or Happy Together (which has Leslie Cheung as a cast member)?
Choices:
Curse of the Golden Flower
The Hunchback of Notre Dame
A Prairie Home Companion
Pleasantville
Happy Together
Great Expectations
Training Day
The Towering Inferno
The Fifth Element
Rebecca
Program:
function: Find
inputs: David Lean
function: Relate
dependencies: 0
inputs: screenwriter
backward
function: Find
inputs: Great Expectations
function: And
dependencies: 1
2
function: Find
inputs: Leslie Cheung
function: Relate
dependencies: 4
inputs: cast member
backward
function: Find
inputs: Happy Together
function: And
dependencies: 5
6
function: SelectBetween
dependencies: 3
7
inputs: duration
greater
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "Great Expectations" . ?e <screenwriter> ?e_1 . ?e_1 <pred:name> "David Lean" .   } UNION { ?e <pred:name> "Happy Together" . ?e <cast_member> ?e_2 . ?e_2 <pred:name> "Leslie Cheung" .  } ?e <duration> ?pv . ?pv <pred:value> ?v .  } ORDER BY DESC(?v) LIMIT 1
Answer: Great Expectations