Question: Which work is Ian McKellen, performing in Sherlock Holmes (the one that has Matt Frewer as a performer), present in ?
Choices: Elementary
The Royal Scandal
Sherlock Holmes: A Game of Shadows
Sherlock Holmes and the Deadly Necklace
If 6 Was 9
Sherlock Holmes
The Sign of Four
Crosstown Traffic
The Hound of the Baskervilles
Mr. Holmes
SPARQL: SELECT DISTINCT ?qpv WHERE { ?e_1 <pred:name> "Sherlock Holmes" . ?e_1 <performer> ?e_3 . ?e_3 <pred:name> "Matt Frewer" . ?e_2 <pred:name> "Ian McKellen" . ?e_1 <performer> ?e_2 . [ <pred:fact_h> ?e_1 ; <pred:fact_r> <performer> ; <pred:fact_t> ?e_2 ] <present_in_work> ?qpv .  }
Program:
function: Find
inputs: Matt Frewer
function: Relate
dependencies: 0
inputs: performer
backward
function: Find
inputs: Sherlock Holmes
function: And
dependencies: 1
2
function: Find
inputs: Ian McKellen
function: QueryRelationQualifier
dependencies: 3
4
inputs: performer
present in work
Answer: Mr. Holmes