Question: What is the number of chemical elements that are different from magnesium or that is a nutrient of chicken (which has the nutrient phosphorus)
Choices:
1
2
3
4
5
6
7
8
9
10
Program:
function: Find
inputs: magnesium
function: Relate
dependencies: 0
inputs: different from
backward
function: FilterConcept
dependencies: 1
inputs: chemical element
function: Find
inputs: phosphorus
function: Relate
dependencies: 3
inputs: nutrient
backward
function: Find
inputs: chicken
function: And
dependencies: 4
5
function: Relate
dependencies: 6
inputs: nutrient
forward
function: FilterConcept
dependencies: 7
inputs: chemical element
function: Or
dependencies: 2
8
function: Count
dependencies: 9
SPARQL: SELECT (COUNT(DISTINCT ?e) AS ?count) WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "chemical element" .  { ?e <different_from> ?e_1 . ?e_1 <pred:name> "magnesium" .  } UNION { ?e_1 <nutrient> ?e . ?e_1 <pred:name> "chicken" . ?e_1 <nutrient> ?e_2 . ?e_2 <pred:name> "phosphorus" .  } }
Answer: 7