Skip to content
Jim Balhoff edited this page Jul 30, 2016 · 33 revisions

owlet is a query expansion preprocessor for SPARQL. It parses embedded OWL class expressions and uses an OWL reasoner to replace them with FILTER statements containing the URIs of subclasses of the given class expression (or superclasses, equivalent classes, or instances):

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ao: <http://purl.obolibrary.org/obo/my-anatomy-ontology/>
PREFIX ow: <http://purl.org/phenoscape/owlet/syntax#>
SELECT DISTINCT ?gene
WHERE 
{
?gene ao:expressed_in ?structure .
?structure rdf:type ?structure_class .
# Triple pattern containing an OWL expression:
?structure_class rdfs:subClassOf "ao:muscle and (ao:part_of some ao:head)"^^ow:omn .
}

becomes:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ao: <http://purl.obolibrary.org/obo/my-anatomy-ontology/>
PREFIX ow: <http://purl.org/phenoscape/owlet/syntax#>
SELECT DISTINCT ?gene
WHERE 
{
?gene ao:expressed_in ?structure .
?structure rdf:type ?structure_class .
# Filter constraining ?structure_class to the terms returned by the OWL query:
FILTER(?structure_class IN (ao:adductor_mandibulae, ao:constrictor_dorsalis, ...))
}

Some existing systems provide similar or related functionality:

However, unlike those systems, owlet can be used to combine any OWL API-based reasoner with any SPARQL endpoint. Also, owlet SPARQL queries do not introduce any non-standard syntax and can be built programmatically with existing libraries such as Jena.

owlet is written in Scala but can be used in any Java application.

See also

Build status: Build status

Clone this wiki locally