Package org.obolibrary.robot
Class ExplainOperation
- java.lang.Object
-
- org.obolibrary.robot.ExplainOperation
-
public class ExplainOperation extends Object
Compute an explanation for an entailed axiom.- Author:
- Jim Balhoff
-
-
Constructor Summary
Constructors Constructor Description ExplainOperation()
-
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 ontologystatic 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#L122static 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 classesstatic 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 classesstatic 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.
-
-
-
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 explainontology
- ontology to search for explanationreasonerFactory
- reasoner factory used to create reasoners to test entailmentsmaxExplanations
- 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 testedreasonerFactory
- the reasoner factory to be used for determining the explanationmax
- 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 testedreasoner
- the reasoner to be used to determine the unsatisfiable classesreasonerFactory
- the reasoner factory to be used to compute the explanationsmax
- 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 testedreasoner
- the reasoner to be used to determine the unsatisfiable classesreasonerFactory
- the reasoner factory to be used to compute the explanationsmax
- maximum number of explanations to be computedmaxUnsat
- 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 testedreasoner
- the reasoner to be used to determine the unsatisfiable classesreasonerFactory
- the reasoner factory to be used to compute the explanationsmax
- 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 testedreasoner
- the reasoner to be used to determine the unsatisfiable classesreasonerFactory
- the reasoner factory to be used to compute the explanationsmax
- 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 rendermanager
- OWLOntologyManager containing source ontologies for explanation axioms- Returns:
- Markdown-formatted explanation text
-
-