Question: How many literary works derive The Godfather (which is written by Mario Puzo) or have the narrative location London (which is the birthplace of Anthony B. Richmond)?
Choices: 0
1
2
3
4
5
6
7
8
9
SPARQL: SELECT (COUNT(DISTINCT ?e) AS ?count) WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "literary work" .  { ?e <derivative_work> ?e_1 . ?e_1 <pred:name> "The Godfather" . ?e_1 <after_a_work_by> ?e_2 . ?e_2 <pred:name> "Mario Puzo" .  } UNION { ?e <narrative_location> ?e_1 . ?e_1 <pred:name> "London" . ?e_2 <place_of_birth> ?e_1 . ?e_2 <pred:name> "Anthony B. Richmond" .  } }
Program:
function: Find
inputs: Mario Puzo
function: Relate
dependencies: 0
inputs: after a work by
backward
function: Find
inputs: The Godfather
function: And
dependencies: 1
2
function: Relate
dependencies: 3
inputs: derivative work
backward
function: FilterConcept
dependencies: 4
inputs: literary work
function: Find
inputs: Anthony B. Richmond
function: Relate
dependencies: 6
inputs: place of birth
forward
function: Find
inputs: London
function: And
dependencies: 7
8
function: Relate
dependencies: 9
inputs: narrative location
backward
function: FilterConcept
dependencies: 10
inputs: literary work
function: Or
dependencies: 5
11
function: Count
dependencies: 12
Answer: 4