Skip to content

Ontop OWL API implementation

Ana Oliveira da Costa edited this page Jul 4, 2016 · 2 revisions

For more information about Ontop: Ontop official wiki

Quest OWL API implementation

Quest was extended with OWL reasoning features. OWL API provides an interface for OWL reasoners (OWLReasoner) that specifies the expected behavior for an OWL reasoner. Quest implements this interface by extending the OWL API abstract class OWLReasonerBase and by adding custom behavior for some of the missing implementation. Supported OWL reasoner features on Ontop are described below.

This implementation aims at take advantage of Ontop's efficient implementation of TBox Reasoning for DL-Lite based on Directed Acyclic Graphs (DAG).

Supported entailments check

Class Expressions

Implemented:

NodeSet<OWLClass> getSubClasses(OWLClassExpression ce, boolean direct)
NodeSet<OWLClass> getSuperClasses(OWLClassExpression ce, boolean direct)
Node<OWLClass> getEquivalentClasses(OWLClassExpression ce)

OWLClassExpressions ObjectComplementOf and ObjectIntersectionOf are not supported at the moment.

Object Type Expressions

Implemented:

NodeSet<OWLObjectPropertyExpression> getSubObjectProperties(OWLObjectPropertyExpression pe, boolean direct)
NodeSet<OWLObjectPropertyExpression> getSuperObjectProperties(OWLObjectPropertyExpression pe, boolean direct)                         
Node<OWLObjectPropertyExpression> getEquivalentObjectProperties(OWLObjectPropertyExpression pe)
Node<OWLObjectPropertyExpression> getInverseObjectProperties(OWLObjectPropertyExpression pe)

Axioms

Implemented entailment check for:

  • OWLEquivalentClassesAxiom
  • OWLEquivalentObjectPropertiesAxiom

To check if an axiom type is supported:

boolean isEntailmentCheckingSupported(@Nonnull AxiomType<?> axiomType)

To check if an axiom is entailed by the root ontology:

boolean isEntailed(@Nonnull OWLAxiom axiom)
boolean isEntailed(@Nonnull Set<? extends OWLAxiom> axioms)

Developer Guide

Translation from Ontop classes to OWL API classes

The class it.unibz.inf.ontop.owlapi.OWLAPITranslator2QLOWL implements methods to translate from Ontop classes related to expressions to OWL API classes. For each of the translations two methods should be created. Example:

OWLObjectPropertyExpression translate(ObjectPropertyExpression op);
NodeSet<OWLObjectPropertyExpression> translateObjPropertyToNodeSet(Set<ObjectPropertyExpression> itOPclasses);

This class is not complete. Methods should be added when needed.

Mapping between AxiomType and method to check entailment

Axiom's entailment checking is performed by only two methods and covers a substantial number of different axioms. it.unibz.inf.ontop.owlrefplatform.owlapi.AxiomEntailmentQuestOWL singleton class manages a mapping between the different axiom types and the implementation of their entailment checking. This class allows to easily connect each AxiomType with expected implementation and to keep this information in only one place. This reduces the risk of bugs and make it easier to add support for new axiom types.

The interface AxiomEntailmentMethod should be used to specify that a class implements behavior related to axiom entailment checking through the method:

public boolean isEntailedByOntology(QuestOWL reasoner, OWLAxiom axiom)

How to add support to a new Axiom Type

In the constructor of AxiomEntailmentQuestOWL add a new entry to Map<AxiomType<?>, AxiomEntailmentMethod> entailmentMethodMap by given the AxiomType and a reference to a class that implements the interface AxiomEntailmentMethod.

Example:

entailmentMethodMap.put(AxiomType.TYPE_X, new AxiomEntailmentMethod() {
    public boolean isEntailedByOntology(QuestOWL reasoner, OWLAxiom axiom) {
     return methodToCheckEntailmentForTypeX(reasoner, axiom);
    }
 });
Clone this wiki locally