Question: What is the connection between Diamonds Are Forever (the one whose genre is film based on literature) to Sammy Davis Jr.?
Choices:
territory claimed by
next lower rank
office held by head of the organisation
had as last meal
sex or gender
cast member
lifestyle
sidekick of
twinned administrative body
named after
Answer: cast member
SPARQL: SELECT DISTINCT ?p WHERE { ?e_1 <pred:name> "Diamonds Are Forever" . ?e_1 <genre> ?e_3 . ?e_3 <pred:name> "film based on literature" . ?e_2 <pred:name> "Sammy Davis Jr." . ?e_1 ?p ?e_2 .  }
Program:
function: Find
inputs: film based on literature
function: Relate
dependencies: 0
inputs: genre
backward
function: Find
inputs: Diamonds Are Forever
function: And
dependencies: 1
2
function: Find
inputs: Sammy Davis Jr.
function: QueryRelation
dependencies: 3
4