Ontology service
Provides storage and search functionality for objects, defined in OpenTox services and relevant ontologies
REST operations
Description | Method | URI | Parameters | Result | Status codes | ||
Retrieve SPARQL query results |
GET |
/ontology |
?query=SPARQL_QUERY (mandatory) |
RDF representation of the query results | 200,404,500 |
||
Predefined query to retrieve all models |
GET |
/ontology/models |
RDF representation of all models |
||||
Predefined query to retrieve all endpoints | GET |
|
RDF representation of all endpoints |
||||
Predefined query to retrieve all algorithms |
GET |
/ontology/algorithms |
RDF representation of all algorithms |
||||
Submit SPARQL query and/or OpenTox service URL |
POST | /ontology | uri[]=URL of a OpenTox RDF resource query=SPARQL_QUERY |
RDF representation of the query results, if query is specified if uri[] is specified, the server retrievea RDF representation and adds it to the RDF storage, thus making it available for the subsequent queries. Any non-empty subset of parameters is valid (i.e. only query, only model_uri, query and algorithm_uri, etc.) |
200,404,500,502 |
Note: not clear if GET parameter can allow for arbitrary SPARQL query
Mode of operation
The Ontology service provides RDF storage and SPARQL endpoint for objects, defined in OpenTox ontology and relevant (AlgorithmTypes , Blue Obelisk, ECHA endpoints) ontologies.
The query interface is compliant with http://www.w3.org/TR/rdf-sparql-protocol/#query-bindings-http
The Ontology service adds new information to its storage, by retrieving RDF representation of OpenTox objects (e.g. Algorithm, Model, Feature, etc.) from OpenTox services. The URL of OpenTox services are either predefined, or obtained via parameters of GET/POST query, as described above.
A specific implementation of Ontology service may select to connect to a set of OpenTox services on regular intervals and retrieve updated RDF representation of OpenTox objects.
TODO API for an extensible list of predefined SPARQL queries, as in http://www.linkedlifedata.com/sparql
Representation
RDF representation defined in OpenTox API ontology
Supported MIME types
Mandatory:
- application/rdf+xml (default)
- application/sparql-results+xml
Optional:
- other RDF formats
HTTP status codes
Interpretation | Nr | Name |
Success | 200 | OK |
Wrong query syntax |
404 | Bad request |
500 |
Internal server error |
|
Error when retrieving RDF representation from specified URL |
502 |
Example
Retrieve all available Models:
query= PREFIX ot:<http://www.opentox.org/api/1.1#> PREFIX ota:<http://www.opentox.org/algorithms.owl#> PREFIX owl:<http://www.w3.org/2002/07/owl#> PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX otee:<http://www.opentox.org/echaEndpoints.owl#> select ?x where { ?x rdf:type ot:Model }
Given an endpoint, retrieve all relevant Models:
Preconditions:
1) Model1 has dependent variable Feature1
2) Feature1 is set to be owl:sameAs to http://www.opentox.org/echaEndpoints.owl#EndpointA
3) RDF representations of Model1, Feature1 and the ECHA endpoints ontology are all available via OpenTox Ontology service
Query:
query= PREFIX ot:<http://www.opentox.org/api/1.1#> PREFIX ota:<http://www.opentox.org/algorithms.owl#> PREFIX owl:<http://www.w3.org/2002/07/owl#> PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX otee:<http://www.opentox.org/echaEndpoints.owl#> select ?model ?target where { ?model rdf:type ot:Model. ?target owl:sameAs otee:EndpointA. ?model ot:dependentVariables ?target. }
Retrieve list of all Models and relevant endpoints
Preconditions:
same as above
Query:
query= PREFIX ot:<http://www.opentox.org/api/1.1#> PREFIX ota:<http://www.opentox.org/algorithms.owl#> PREFIX owl:<http://www.w3.org/2002/07/owl#> PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX otee:<http://www.opentox.org/echaEndpoints.owl#> select ?model ?target ?endpoint where { ?model rdf:type ot:Model. ?target owl:sameAs ?endpoint. ?model ot:dependentVariables ?target. }
More examples
Querying/Reasoning with Jena and SPARQL