Question: What is the character role of John Krasinski as a cast member of The Office whose narrative location is Scranton?
Choices:
Dr. Frank N. Furter
Jim Halpert
Lloyd Christmas
Cousin Randy
Dr. John Watson
Henri Ducard
Fix-it Felix
Gilderoy Lockhart
Princess Leia
Paul Atreides
Answer: Jim Halpert
SPARQL: SELECT DISTINCT ?qpv WHERE { ?e_1 <pred:name> "The Office" . ?e_1 <narrative_location> ?e_3 . ?e_3 <pred:name> "Scranton" . ?e_2 <pred:name> "John Krasinski" . ?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: Scranton
function: Relate
dependencies: 0
inputs: narrative location
backward
function: Find
inputs: The Office
function: And
dependencies: 1
2
function: Find
inputs: John Krasinski
function: QueryRelationQualifier
dependencies: 3
4
inputs: cast member
character role