Question: How many television series are a derivative work of Training Day (the one that is shot in Santa Monica) or the series spin-off of Star Trek: The Next Generation (the one that is followed by Star Trek: Deep Space Nine)?
Choices:
0
1
2
3
4
5
6
7
8
9
Answer: 2
SPARQL: SELECT (COUNT(DISTINCT ?e) AS ?count) WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "television series" .  { ?e_1 <derivative_work> ?e . ?e_1 <pred:name> "Training Day" . ?e_1 <filming_location> ?e_2 . ?e_2 <pred:name> "Santa Monica" .  } UNION { ?e_1 <series_spin-off> ?e . ?e_1 <pred:name> "Star Trek: The Next Generation" . ?e_1 <followed_by> ?e_2 . ?e_2 <pred:name> "Star Trek: Deep Space Nine" .  } }
Program:
function: Find
inputs: Santa Monica
function: Relate
dependencies: 0
inputs: filming location
backward
function: Find
inputs: Training Day
function: And
dependencies: 1
2
function: Relate
dependencies: 3
inputs: derivative work
forward
function: FilterConcept
dependencies: 4
inputs: television series
function: Find
inputs: Star Trek: Deep Space Nine
function: Relate
dependencies: 6
inputs: followed by
backward
function: Find
inputs: Star Trek: The Next Generation
function: And
dependencies: 7
8
function: Relate
dependencies: 9
inputs: series spin-off
forward
function: FilterConcept
dependencies: 10
inputs: television series
function: Or
dependencies: 5
11
function: Count
dependencies: 12