Made room for two new models. authored by stuckyb's avatar stuckyb
# Model 8: RDF\* / SPARQL\*
This solution uses extensions of RDF and SPARQL, called RDF\* and SPARQL\*, proposed by [Hartig and Thompson (2014)](https://arxiv.org/abs/1406.3399) and further discussed in [Hartig (2017)](https://www.semanticscholar.org/paper/Foundations-of-RDF%E2%8B%86-and-SPARQL%E2%8B%86-\(An-Alternative-to-Hartig/36e70ee51cb7b7ec12faac934ae6b6a4d9da15a8). The key feature of RDF\* and SPARQL\* is the ability to *directly* use one triple as the subject or object of another triple. This is functionally equivalent to assigning an identifier to a triple so that it can be referenced in other triple statements. The proposal includes an extension to Turtle syntax, called Turtle\*, that makes it easy to write nested triples in source data. The test data file `model_8-reasoned.ttlx` is in Turtle\* format.
The major drawback to RDF\* / SPARQL\* is that they are not (yet?) widely supported. Blazegraph [fully supports](https://wiki.blazegraph.com/wiki/index.php/Reification_Done_Right) RDF\* / SPARQL\* / Turtle\*, but as far as I know, none of the other major RDF datastores have implemented them yet.
![Diagram of the test knowledge base for Model 8.](images/model_8.png)
## SPARQL queries
### Q1: What eats Plant?
Same as for [Model 1](observation_models/model_1#q1-what-eats-plant).
### Q2: What observations provide this information?
```
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
SELECT ?obs
WHERE {
BIND(<<?animal obo:feeding_on ?food>> AS ?triple)
?food rdf:type obo:Plant .
?obs obo:has_triple ?triple .
}
```
### Q3: What is associated with Plant?
Same as for [Model 1](observation_models/model_1#q3-what-is-associated-with-plant).
### Q4: What observations provide this information?
```
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
SELECT ?obs
WHERE {
BIND(<<?organism ?prop ?plant>> AS ?triple)
?prop rdfs:subPropertyOf* obo:associated_with .
?plant rdf:type obo:Plant .
?obs obo:has_triple ?triple .
}
```
### Q5: What eats something that eats Plant?
Same as for [Model 1](observation_models/model_1#q5-what-eats-something-that-eats-plant).
### Q6: What observations provide this information?
```
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
SELECT ?obs
WHERE {
BIND(<<?animal1 obo:feeding_on ?plant>> AS ?triple1)
BIND(<<?animal2 obo:feeding_on ?animal1>> AS ?triple2)
?plant rdf:type obo:Plant .
{ ?obs obo:has_triple ?triple1 . } UNION { ?obs obo:has_triple ?triple2 . }
}
```
### Q7: What is connected to Plant via trophic relationships?
Samme as for [Model 1](observation_models/model_1#q7-what-is-connected-to-plant-via-trophic-relationships).
### Q8: What observations provide this information?
Cannot be answered with a single SPARQL query.