Question: Which movie is longer, Hannibal (the one whose director is Ridley Scott) or Ned Kelly (the one that has Heath Ledger as a cast member)?
Choices:
Training Day
Ned Kelly
Hannibal
The Fifth Element
Curse of the Golden Flower
The Hunchback of Notre Dame
The Towering Inferno
Rebecca
Pleasantville
A Prairie Home Companion
Answer: Hannibal
SPARQL: SELECT ?e WHERE { { ?e <pred:name> "Hannibal" . ?e <director> ?e_1 . ?e_1 <pred:name> "Ridley Scott" .   } UNION { ?e <pred:name> "Ned Kelly" . ?e <cast_member> ?e_2 . ?e_2 <pred:name> "Heath Ledger" .  } ?e <duration> ?pv . ?pv <pred:value> ?v .  } ORDER BY DESC(?v) LIMIT 1
Program:
function: Find
inputs: Ridley Scott
function: Relate
dependencies: 0
inputs: director
backward
function: Find
inputs: Hannibal
function: And
dependencies: 1
2
function: Find
inputs: Heath Ledger
function: Relate
dependencies: 4
inputs: cast member
backward
function: Find
inputs: Ned Kelly
function: And
dependencies: 5
6
function: SelectBetween
dependencies: 3
7
inputs: duration
greater