Question: How many plays are a notable work of the human that is the author of Hamlet (who has David Tennant as a cast member)?
Choices:
2
3
4
5
6
7
8
9
10
11
Program:
function: Find
inputs: David Tennant
function: Relate
dependencies: 0
inputs: cast member
backward
function: Find
inputs: Hamlet
function: And
dependencies: 1
2
function: Relate
dependencies: 3
inputs: after a work by
forward
function: FilterConcept
dependencies: 4
inputs: human
function: Relate
dependencies: 5
inputs: notable work
forward
function: FilterConcept
dependencies: 6
inputs: play
function: Count
dependencies: 7
SPARQL: SELECT (COUNT(DISTINCT ?e) AS ?count) WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "play" . ?e_1 <notable_work> ?e . ?e_1 <pred:instance_of> ?c_1 . ?c_1 <pred:name> "human" . ?e_2 <after_a_work_by> ?e_1 . ?e_2 <pred:name> "Hamlet" . ?e_2 <cast_member> ?e_3 . ?e_3 <pred:name> "David Tennant" .   }
Answer: 6