Ontology service
What is an Ontology service and how to use
UNDER DEVELOPMENT !!!!!!!!!!!
Example ontologies
- ECHA Endpoints ontology
Example of linking Features
with ECHA endpoint ontology
-
by subclassing
-
or by using a predicate
Example of linking an ot:Algorithm
with the algorithm types ontology
Note: owl:sameAs doesn't sound right here, more appropriate would be to invent property ot:typeOf
<ot:Algorithm rdf:ID="WekaJ48"> <dc:identifier rdf:datatype="&xsd;string" >http://myservice/algorithm/{algorithmid}</dc:identifier> ...... <owl:sameAs rdf:resource="http://www.opentox.org/algorithms.owl#ClassificationEagerSingleTarget"/> <rdfs:comment rdf:datatype="&xsd;string"></rdfs:comment> </ot:Algorithm>
with Blue obelisk ontology
<ot:Algorithm rdf:ID="XLogPCalculation"> <dc:identifier rdf:datatype="&xsd;string" >http://myservice/algorithm/{algorithmid}</dc:identifier> <dc:title rdf:datatype="&xsd;string">XLogP</dc:title> <owl:sameAs rdf:resource="http://www.blueobelisk.org/ontologies/chemoinformatics-algorithms/#xlogP"/> </ot:Algorithm>
Example of querying an Ontology service
All queries assume all of the following ontologies are available in the same repository: OpenTox resource, ECHA endpoints ontology, Algorithm Types ontology , Opentox examples. All queries use SPARQL.
Retrieve all available ot:Algorithms :
SPARQL
PREFIX ot:<http://www.opentox.org/api/1.1#> select ?x where { ?x rdf:type ot:Algorithm }
Results:
The query returns references to all ot:Algorithm objects, , as defined in opentox-example ontology.
<http://www.opentox.org/example/1.1#XLogPCalculation> <http://www.opentox.org/example/1.1#Toxtree> <http://www.opentox.org/example/1.1#LazarAlgorithm> <http://www.opentox.org/example/1.1#AlgorithmMLR> <http://www.opentox.org/example/1.1#AlgorithmSVM> <http://www.opentox.org/example/1.1#WekaJ48>
Retrieve all available ot:Algorithms, which are same as bo:xlogP algorithm, defined in Blue Obelisk ontology:
SPARQL
PREFIX owl:<http://www.w3.org/2002/07/owl#> PREFIX ot:<http://www.opentox.org/api/1.1#> select ?x where { {?x rdf:type ot:Algorithm } {?x owl:sameAs <http://www.blueobelisk.org/ontologies/chemoinformatics-algorithms/#xlogP>} }
Results:
The query returns reference to XLogPCalculation object, as defined in opentox-example ontology.
<http://www.opentox.org/example/1.1#XLogPCalculation>
Retrieve all Classification Algorithms:
SPARQL
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#> PREFIX ot:<http://www.opentox.org/api/1.1#> select ?algorithm ?algorithm_type where { {?algorithm rdf:type ot:Algorithm} {?algorithm owl:sameAs ?algorithm_type} {?algorithm_type rdf:type ota:Classification} }
Results:
algorithm | algorithm_type |
---|---|
<http://www.opentox.org/example/1.1#LazarAlgorithm> | ota:ClassificationLazySingleTarget |
<http://www.opentox.org/example/1.1#WekaJ48> | ota:ClassificationEagerSingleTarget |
Retrieve all Features
SPARQL
PREFIX ot:<http://www.opentox.org/api/1.1#> PREFIX dc:<http://purl.org/dc/elements/1.1/> PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?feature ?id ?name ?source where { {?feature rdf:type ot:Feature} {?feature dc:title ?name} {?feature dc:identifier ?id} {?feature ot:hasSource ?source} }
Results:
Feature | id |
Name |
Source |
---|---|---|---|
<http://www.opentox.org/example/1.1#XLogPDescriptor> | "http://myservice/feature/{featureid2}"^^xsd:string |
"XLogP"^^xsd:string |
<http://www.opentox.org/example/1.1#XLogPCalculation> |
<http://www.opentox.org/example/1.1#MultiCellCall> | "http://myserice/feature/{featureid1}"^^xsd:string |
"MultiCellCall"^^xsd:string |
<http://www.opentox.org/example/1.1#DSSToxCPDBAS> |
<http://www.opentox.org/example/1.1#MultiCellCallPredicted> | "http://myservice/feature/{featureid3}"^^xsd:string |
"MultiCellCall"^^xsd:string |
<http://www.opentox.org/example/1.1#WekaJ48> |
Retrieve all Models
SPARQL
select ?model where {?model rdf:type ot:Model}
Results:
Model |
---|
<http://www.opentox.org/example/1.1#ToxtreeCarcinogenicity> |
<http://www.opentox.org/example/1.1#Lazar> |
<http://www.opentox.org/example/1.1#DemoModel> |
Retrieve all Models, created by eager classification algorithms, single target variable:
SPARQL
PREFIX ot:<http://www.opentox.org/api/1.1#> PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX owl:<http://www.w3.org/2002/07/owl#> select ?model ?algorithm where { {?model rdf:type ot:Model} {?model ot:algorithm ?algorithm} {?algorithm owl:sameAs ota:ClassificationEagerSingleTarget} }
Results
Model | Algorithm |
---|---|
<http://www.opentox.org/example/1.1#DemoModel> |
<http://www.opentox.org/example/1.1#WekaJ48> |
Queries are tested with opentox-example.owl imported into Sesame 2.3 triple store and OpenRDF Workbench. Both are available for download from http://www.openrdf.org/.