Question: What is the character role of Mel Gibson (the one that has the occupation of screenwriter) in Hamlet (the one whose composer is Ennio Morricone)?
Choices:
Gabrielle Solis
Marilyn Monroe
Prince Hamlet
Warrick Brown
Nikola Tesla
Raymond Langston
Rogue
Mark Tuso
Tuya
Ezra Kramer
Answer: Prince Hamlet
SPARQL: SELECT DISTINCT ?qpv WHERE { ?e_1 <pred:name> "Hamlet" . ?e_1 <composer> ?e_3 . ?e_3 <pred:name> "Ennio Morricone" . ?e_2 <pred:name> "Mel Gibson" . ?e_2 <occupation> ?e_4 . ?e_4 <pred:name> "screenwriter" . ?e_1 <cast_member> ?e_2 . [ <pred:fact_h> ?e_1 ; <pred:fact_r> <cast_member> ; <pred:fact_t> ?e_2 ] <character_role> ?qpv .  }
Program:
function: Find
inputs: Ennio Morricone
function: Relate
dependencies: 0
inputs: composer
backward
function: Find
inputs: Hamlet
function: And
dependencies: 1
2
function: Find
inputs: screenwriter
function: Relate
dependencies: 4
inputs: occupation
backward
function: Find
inputs: Mel Gibson
function: And
dependencies: 5
6
function: QueryRelationQualifier
dependencies: 3
7
inputs: cast member
character role