Class ExplainOperation


  • public class ExplainOperation
    extends Object
    Compute an explanation for an entailed axiom.
    Author:
    Jim Balhoff
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Set<org.semanticweb.owl.explanation.api.Explanation<org.semanticweb.owlapi.model.OWLAxiom>> explain​(org.semanticweb.owlapi.model.OWLAxiom axiom, org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.reasoner.OWLReasonerFactory reasonerFactory, int maxExplanations)
      Compute explanations for an entailed axiom.
      static Set<org.semanticweb.owl.explanation.api.Explanation<org.semanticweb.owlapi.model.OWLAxiom>> explainInconsistent​(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.reasoner.OWLReasonerFactory reasonerFactory, int max)
      Compute explanations for inconsistent ontology
      static Set<org.semanticweb.owl.explanation.api.Explanation<org.semanticweb.owlapi.model.OWLAxiom>> explainMostGeneralUnsatisfiableClasses​(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.reasoner.OWLReasoner reasoner, org.semanticweb.owlapi.reasoner.OWLReasonerFactory reasonerFactory, int max)
      Compute explanations for all most general unsatisfiable classes Note that this is a very naive implementation which assumes and acyclic class hierarchy.
      static Set<org.semanticweb.owl.explanation.api.Explanation<org.semanticweb.owlapi.model.OWLAxiom>> explainRootUnsatisfiableClasses​(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.reasoner.OWLReasoner reasoner, org.semanticweb.owlapi.reasoner.OWLReasonerFactory reasonerFactory, int max)
      Compute explanations for all root unsatisfiable classes See https://github.com/matthewhorridge/owlexplanation/blob/439c5ca67835f5e421adde725e4e8a3bcd760ac8/src/main/java/org/semanticweb/owl/explanation/impl/rootderived/StructuralRootDerivedReasoner.java#L122
      static Set<org.semanticweb.owl.explanation.api.Explanation<org.semanticweb.owlapi.model.OWLAxiom>> explainUnsatisfiableClasses​(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.reasoner.OWLReasoner reasoner, org.semanticweb.owlapi.reasoner.OWLReasonerFactory reasonerFactory, int max)
      Compute explanations for all unsatisfiable classes
      static Set<org.semanticweb.owl.explanation.api.Explanation<org.semanticweb.owlapi.model.OWLAxiom>> explainUnsatisfiableClasses​(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.reasoner.OWLReasoner reasoner, org.semanticweb.owlapi.reasoner.OWLReasonerFactory reasonerFactory, int max, int maxUnsat)
      Compute explanations for all unsatisfiable classes
      static String renderAxiomImpactSummary​(Map<org.semanticweb.owlapi.model.OWLAxiom,​Integer> axiomMap, org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.model.OWLOntologyManager manager)  
      static String renderExplanationAsMarkdown​(org.semanticweb.owl.explanation.api.Explanation<org.semanticweb.owlapi.model.OWLAxiom> explanation, org.semanticweb.owlapi.model.OWLOntologyManager manager)
      Render an Explanation object as Markdown text, linking text labels to term IRIs and indenting axioms.
    • Constructor Detail

      • ExplainOperation

        public ExplainOperation()
    • Method Detail

      • explain

        public static Set<org.semanticweb.owl.explanation.api.Explanation<org.semanticweb.owlapi.model.OWLAxiom>> explain​(org.semanticweb.owlapi.model.OWLAxiom axiom,
                                                                                                                          org.semanticweb.owlapi.model.OWLOntology ontology,
                                                                                                                          org.semanticweb.owlapi.reasoner.OWLReasonerFactory reasonerFactory,
                                                                                                                          int maxExplanations)
        Compute explanations for an entailed axiom.
        Parameters:
        axiom - entailed axiom to explain
        ontology - ontology to search for explanation
        reasonerFactory - reasoner factory used to create reasoners to test entailments
        maxExplanations - maximum number of explanations to compute
        Returns:
        explanations
      • explainInconsistent

        public static Set<org.semanticweb.owl.explanation.api.Explanation<org.semanticweb.owlapi.model.OWLAxiom>> explainInconsistent​(org.semanticweb.owlapi.model.OWLOntology ontology,
                                                                                                                                      org.semanticweb.owlapi.reasoner.OWLReasonerFactory reasonerFactory,
                                                                                                                                      int max)
        Compute explanations for inconsistent ontology
        Parameters:
        ontology - the ontology to be tested
        reasonerFactory - the reasoner factory to be used for determining the explanation
        max - maximum number of explanations to be computed
        Returns:
        a set of explanations for inconsistent ontology
      • explainUnsatisfiableClasses

        public static Set<org.semanticweb.owl.explanation.api.Explanation<org.semanticweb.owlapi.model.OWLAxiom>> explainUnsatisfiableClasses​(org.semanticweb.owlapi.model.OWLOntology ontology,
                                                                                                                                              org.semanticweb.owlapi.reasoner.OWLReasoner reasoner,
                                                                                                                                              org.semanticweb.owlapi.reasoner.OWLReasonerFactory reasonerFactory,
                                                                                                                                              int max)
        Compute explanations for all unsatisfiable classes
        Parameters:
        ontology - the ontology to be tested
        reasoner - the reasoner to be used to determine the unsatisfiable classes
        reasonerFactory - the reasoner factory to be used to compute the explanations
        max - maximum number of explanations to be computed
        Returns:
        a set of explanations
      • explainUnsatisfiableClasses

        public static Set<org.semanticweb.owl.explanation.api.Explanation<org.semanticweb.owlapi.model.OWLAxiom>> explainUnsatisfiableClasses​(org.semanticweb.owlapi.model.OWLOntology ontology,
                                                                                                                                              org.semanticweb.owlapi.reasoner.OWLReasoner reasoner,
                                                                                                                                              org.semanticweb.owlapi.reasoner.OWLReasonerFactory reasonerFactory,
                                                                                                                                              int max,
                                                                                                                                              int maxUnsat)
        Compute explanations for all unsatisfiable classes
        Parameters:
        ontology - the ontology to be tested
        reasoner - the reasoner to be used to determine the unsatisfiable classes
        reasonerFactory - the reasoner factory to be used to compute the explanations
        max - maximum number of explanations to be computed
        maxUnsat - cutoff - limit number of tested unsatisfiable classes to maxUnsat classes
        Returns:
        a set of explanations
      • explainRootUnsatisfiableClasses

        public static Set<org.semanticweb.owl.explanation.api.Explanation<org.semanticweb.owlapi.model.OWLAxiom>> explainRootUnsatisfiableClasses​(org.semanticweb.owlapi.model.OWLOntology ontology,
                                                                                                                                                  org.semanticweb.owlapi.reasoner.OWLReasoner reasoner,
                                                                                                                                                  org.semanticweb.owlapi.reasoner.OWLReasonerFactory reasonerFactory,
                                                                                                                                                  int max)
        Compute explanations for all root unsatisfiable classes See https://github.com/matthewhorridge/owlexplanation/blob/439c5ca67835f5e421adde725e4e8a3bcd760ac8/src/main/java/org/semanticweb/owl/explanation/impl/rootderived/StructuralRootDerivedReasoner.java#L122
        Parameters:
        ontology - the ontology to be tested
        reasoner - the reasoner to be used to determine the unsatisfiable classes
        reasonerFactory - the reasoner factory to be used to compute the explanations
        max - maximum number of explanations to be computed
        Returns:
        a set of explanations
      • explainMostGeneralUnsatisfiableClasses

        public static Set<org.semanticweb.owl.explanation.api.Explanation<org.semanticweb.owlapi.model.OWLAxiom>> explainMostGeneralUnsatisfiableClasses​(org.semanticweb.owlapi.model.OWLOntology ontology,
                                                                                                                                                         org.semanticweb.owlapi.reasoner.OWLReasoner reasoner,
                                                                                                                                                         org.semanticweb.owlapi.reasoner.OWLReasonerFactory reasonerFactory,
                                                                                                                                                         int max)
        Compute explanations for all most general unsatisfiable classes Note that this is a very naive implementation which assumes and acyclic class hierarchy.
        Parameters:
        ontology - the ontology to be tested
        reasoner - the reasoner to be used to determine the unsatisfiable classes
        reasonerFactory - the reasoner factory to be used to compute the explanations
        max - maximum number of explanations to be computed
        Returns:
        a set of explanations
      • renderExplanationAsMarkdown

        public static String renderExplanationAsMarkdown​(org.semanticweb.owl.explanation.api.Explanation<org.semanticweb.owlapi.model.OWLAxiom> explanation,
                                                         org.semanticweb.owlapi.model.OWLOntologyManager manager)
        Render an Explanation object as Markdown text, linking text labels to term IRIs and indenting axioms.
        Parameters:
        explanation - explanation to render
        manager - OWLOntologyManager containing source ontologies for explanation axioms
        Returns:
        Markdown-formatted explanation text
      • renderAxiomImpactSummary

        public static String renderAxiomImpactSummary​(Map<org.semanticweb.owlapi.model.OWLAxiom,​Integer> axiomMap,
                                                      org.semanticweb.owlapi.model.OWLOntology ontology,
                                                      org.semanticweb.owlapi.model.OWLOntologyManager manager)