Question: How many keyboard instruments are there whose country is England (that has military conflicts with the Kingdom of Portugal) or famous person is Richard Wright (who plays the piano)?
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> "keyboard instrument" .  { ?e <country> ?e_1 . ?e_1 <pred:name> "England" . ?e_2 <military_conflicts> ?e_1 . ?e_2 <pred:name> "Kingdom of Portugal" .  } UNION { ?e <famous_people> ?e_1 . ?e_1 <pred:name> "Richard Wright" . ?e_1 <instrument> ?e_2 . ?e_2 <pred:name> "piano" .  } }
Program:
function: Find
inputs: Kingdom of Portugal
function: Relate
dependencies: 0
inputs: military conflicts
forward
function: Find
inputs: England
function: And
dependencies: 1
2
function: Relate
dependencies: 3
inputs: country
backward
function: FilterConcept
dependencies: 4
inputs: keyboard instrument
function: Find
inputs: piano
function: Relate
dependencies: 6
inputs: instrument
backward
function: Find
inputs: Richard Wright
function: And
dependencies: 7
8
function: Relate
dependencies: 9
inputs: famous people
backward
function: FilterConcept
dependencies: 10
inputs: keyboard instrument
function: Or
dependencies: 5
11
function: Count
dependencies: 12