Class OWLAPILiteReasoner

java.lang.Object
io.github.kodymoodley.owlapilite.OWLAPILiteReasoner

public class OWLAPILiteReasoner extends Object
Class for OWLAPI-Lite which provides access to methods for reasoning with OWL ontologies.
Version:
1.0.1
Author:
Kody Moodley, https://kodymoodley.github.io
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static org.semanticweb.owlapi.model.OWLDataFactory
    OWLDataFactory instance
    com.clarkparsia.owlapi.explanation.DefaultExplanationGenerator
    An instance of a default explanation generator for computing justifications for entailments
    org.semanticweb.owl.explanation.impl.blackbox.checker.InconsistentOntologyExplanationGeneratorFactory
    An instance of Matthew Horridge's explanation generator factory for inconsistent ontologies
    org.semanticweb.owl.explanation.api.ExplanationGenerator<org.semanticweb.owlapi.model.OWLAxiom>
    An instance of Matthew Horridge's explanation generator for inconsistent ontologies
    org.semanticweb.owlapi.model.OWLOntology
    the OWLOntology object being reasoned with
    org.semanticweb.owlapi.model.IRI
    the IRI of the ontology being reasoned with
    Parser instance
    org.semanticweb.owlapi.reasoner.OWLReasoner
    the OWLReasoner object which is responsible for reasoning
    org.semanticweb.owlapi.reasoner.OWLReasonerFactory
    OWLReasonerFactory instance
    SelectedReasoner instance
  • Constructor Summary

    Constructors
    Constructor
    Description
    OWLAPILiteReasoner(org.semanticweb.owlapi.reasoner.OWLReasonerFactory reasonerFactory, org.semanticweb.owlapi.model.OWLOntology ontology, Parser parser, SelectedReasoner selectedReasoner)
    OWLAPILiteReasoner constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    prints to console output the explanations (justifications) for the entailment of the axiom (represented by the given string in Manchester OWL Syntax)
    void
    prints to console output the explanations (justifications) for the inconsistency of the ontology.
    void
    prints to console output the explanations (justifications) for the unsatisfiability of a class expression (represented by the given string in Manchester OWL Syntax).
    void
    for each object property in the ontology, print all object property assertions they are involved in to console output
    void
    Alias for getAllObjectPropertyAssertions method.
    void
    for each individual in the ontology, prints all atomic classes to console output, such that the individual is an instance of these classes
    void
    prints all atomic equivalent classes of a given class expression string to console output
    void
    for a given class expression, print all its instances to console output
    void
    print the name of the selected OWL reasoner to console output
    void
    for a given object property, print all object property assertions it is involved in, to console output
    void
    Alias for getObjectPropertyAssertions method.
    void
    print the name of the OWL 2 profile that this reasoner supports to console output
    void
    prints all atomic subclasses (both direct and indirect) of a given class expression string to console output
    void
    prints all atomic superclasses (both direct and indirect) of a given class expression string to console output
    void
    prints all atomic classes to console output, such that the individual (represented by the given string) is an instance of these classes
    void
    prints all unsatisfiable class names in the ontology associated with this OWLAPILiteReasoner instance to console output
    boolean
    prints Yes to console output if the ontology associated with this OWLAPILiteReasoner instance is consistent, prints No otherwise
    void
    isEntailed(String axiomStr)
    prints Yes to console output if the given string represents an OWLAxiom in Manchester OWL Syntax that is entailed by the ontology.
    void
    prints Yes to console output if the given string represents an OWLClassExpression in Manchester OWL Syntax that is satisfiable w.r.t.
    void
    printExplanation(Set<org.semanticweb.owlapi.model.OWLAxiom> explanation, int idx)
    prints a single explanation with a given integer id
    void
    printExplanation(org.semanticweb.owl.explanation.api.Explanation<org.semanticweb.owlapi.model.OWLAxiom> explanation, int idx)
    prints a single explanation with a given integer id

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ontology

      public org.semanticweb.owlapi.model.OWLOntology ontology
      the OWLOntology object being reasoned with
    • ontologyIRI

      public org.semanticweb.owlapi.model.IRI ontologyIRI
      the IRI of the ontology being reasoned with
    • reasoner

      public org.semanticweb.owlapi.reasoner.OWLReasoner reasoner
      the OWLReasoner object which is responsible for reasoning
    • parser

      public Parser parser
      Parser instance
    • dataFactory

      public static org.semanticweb.owlapi.model.OWLDataFactory dataFactory
      OWLDataFactory instance
    • selectedReasoner

      public SelectedReasoner selectedReasoner
      SelectedReasoner instance
    • reasonerFactory

      public org.semanticweb.owlapi.reasoner.OWLReasonerFactory reasonerFactory
      OWLReasonerFactory instance
    • explanationGenerator

      public com.clarkparsia.owlapi.explanation.DefaultExplanationGenerator explanationGenerator
      An instance of a default explanation generator for computing justifications for entailments
    • inconsistencyExpFac

      public org.semanticweb.owl.explanation.impl.blackbox.checker.InconsistentOntologyExplanationGeneratorFactory inconsistencyExpFac
      An instance of Matthew Horridge's explanation generator factory for inconsistent ontologies
    • inconsistencyExplanationGenerator

      public org.semanticweb.owl.explanation.api.ExplanationGenerator<org.semanticweb.owlapi.model.OWLAxiom> inconsistencyExplanationGenerator
      An instance of Matthew Horridge's explanation generator for inconsistent ontologies
  • Constructor Details

    • OWLAPILiteReasoner

      public OWLAPILiteReasoner(org.semanticweb.owlapi.reasoner.OWLReasonerFactory reasonerFactory, org.semanticweb.owlapi.model.OWLOntology ontology, Parser parser, SelectedReasoner selectedReasoner)
      OWLAPILiteReasoner constructor
      Parameters:
      reasonerFactory - reference to a specific OWLReasonerFactory implementation
      ontology - an OWLOntology object representing the ontology to be reasoned with
      parser - a Parser instance (Manchester OWL Syntax)
      selectedReasoner - a SelectedReasoner instance holding metadata about the selected OWL reasoner
  • Method Details

    • getEquivalentClasses

      public void getEquivalentClasses(String classEx)
      prints all atomic equivalent classes of a given class expression string to console output
      Parameters:
      classEx - a class expression string in Manchester OWL Syntax
    • getSubClasses

      public void getSubClasses(String classEx)
      prints all atomic subclasses (both direct and indirect) of a given class expression string to console output
      Parameters:
      classEx - a class expression string in Manchester OWL Syntax
    • getSuperClasses

      public void getSuperClasses(String classEx)
      prints all atomic superclasses (both direct and indirect) of a given class expression string to console output
      Parameters:
      classEx - a class expression string in Manchester OWL Syntax
    • getUnsatisfiableClasses

      public void getUnsatisfiableClasses()
      prints all unsatisfiable class names in the ontology associated with this OWLAPILiteReasoner instance to console output
    • isConsistent

      public boolean isConsistent()
      prints Yes to console output if the ontology associated with this OWLAPILiteReasoner instance is consistent, prints No otherwise
      Returns:
      true if ontology is consistent, false otherwise
    • getTypes

      public void getTypes(String ind)
      prints all atomic classes to console output, such that the individual (represented by the given string) is an instance of these classes
      Parameters:
      ind - string representation of an individual name in the ontology
    • getAllTypes

      public void getAllTypes()
      for each individual in the ontology, prints all atomic classes to console output, such that the individual is an instance of these classes
    • getObjectPropertyAssertions

      public void getObjectPropertyAssertions(String opropStr)
      for a given object property, print all object property assertions it is involved in, to console output
      Parameters:
      opropStr - string representing an object property
    • getOPropertyAssertions

      public void getOPropertyAssertions(String opropStr)
      Alias for getObjectPropertyAssertions method. for a given object property, print all object property assertions it is involved in, to console output
      Parameters:
      opropStr - string representing an object property
    • getInstances

      public void getInstances(String clsStr)
      for a given class expression, print all its instances to console output
      Parameters:
      clsStr - a class expression string in Manchester OWL Syntax
    • getAllObjectPropertyAssertions

      public void getAllObjectPropertyAssertions()
      for each object property in the ontology, print all object property assertions they are involved in to console output
    • getAllOPropertyAssertions

      public void getAllOPropertyAssertions()
      Alias for getAllObjectPropertyAssertions method. for each object property in the ontology, print all object property assertions they are involved in to console output
    • getName

      public void getName()
      print the name of the selected OWL reasoner to console output
    • getOWLProfile

      public void getOWLProfile()
      print the name of the OWL 2 profile that this reasoner supports to console output
    • isEntailed

      public void isEntailed(String axiomStr)
      prints Yes to console output if the given string represents an OWLAxiom in Manchester OWL Syntax that is entailed by the ontology. Prints No, otherwise
      Parameters:
      axiomStr - a string representation of an OWLAxiom in Manchester OWL Syntax
    • isSatisfiable

      public void isSatisfiable(String clsStr)
      prints Yes to console output if the given string represents an OWLClassExpression in Manchester OWL Syntax that is satisfiable w.r.t. the ontology. Prints No, otherwise
      Parameters:
      clsStr - a string representation of an OWLClassExpression in Manchester OWL Syntax
    • explainUnsatisfiability

      public void explainUnsatisfiability(String clsStr)
      prints to console output the explanations (justifications) for the unsatisfiability of a class expression (represented by the given string in Manchester OWL Syntax). Prints 'NOT unsatisfiable' if the class expression is satisfiable.
      Parameters:
      clsStr - a string representation of an OWLClassExpression in Manchester OWL Syntax
    • explainInconsistency

      public void explainInconsistency()
      prints to console output the explanations (justifications) for the inconsistency of the ontology. Prints 'NOT inconsistent' if the ontology is consistent
    • explainEntailment

      public void explainEntailment(String axiomStr)
      prints to console output the explanations (justifications) for the entailment of the axiom (represented by the given string in Manchester OWL Syntax)
      Parameters:
      axiomStr - a string representation of an OWLAxiom in Manchester OWL Syntax
    • printExplanation

      public void printExplanation(Set<org.semanticweb.owlapi.model.OWLAxiom> explanation, int idx)
      prints a single explanation with a given integer id
      Parameters:
      explanation - a set of OWLAxiom objects
      idx - an integer representing an ID or number for this explanation in a sequence
    • printExplanation

      public void printExplanation(org.semanticweb.owl.explanation.api.Explanation<org.semanticweb.owlapi.model.OWLAxiom> explanation, int idx)
      prints a single explanation with a given integer id
      Parameters:
      explanation - an Explanation object which contains a set of OWLAxiom objects
      idx - an integer representing an ID or number for this explanation in a sequence