com.clarkparsia.explanation
Class HSTExplanationGenerator

java.lang.Object
  extended by com.clarkparsia.explanation.HSTExplanationGenerator
All Implemented Interfaces:
ExplanationGenerator, MultipleExplanationGenerator, SingleExplanationGenerator

public class HSTExplanationGenerator
extends java.lang.Object
implements MultipleExplanationGenerator

Description: An implementation of MultipleExplanationGenerator interface using Reiter's Hitting Set Tree (HST) algorithm as described in Aditya Kalyanpur's thesis. This class relies on a SingleExplanationGenerator that can compute a minimal set of axioms that cause the unsatisfiability. The core of the functionality is based on Matthew Horridge's implementation.

Copyright: Copyright (c) 2007

Company: Clark & Parsia, LLC.

Author:
Evren Sirin

Field Summary
static java.util.logging.Logger log
           
 
Constructor Summary
HSTExplanationGenerator(SingleExplanationGenerator singleExplanationGenerator)
           
 
Method Summary
 java.util.Set<OWLAxiom> getExplanation(OWLDescription unsatClass)
          Returns a single explanation for the given unsatisfiable class.
 java.util.Set<java.util.Set<OWLAxiom>> getExplanations(OWLDescription unsatClass)
          Returns all the explanations for the given unsatisfiable class.
 java.util.Set<java.util.Set<OWLAxiom>> getExplanations(OWLDescription unsatClass, int maxExplanations)
          Return a specified number of explanations for the given unsatisfiable class.
 OWLOntology getOntology()
          Returns the ontology according to which the explanations are generated.
 OWLOntologyManager getOntologyManager()
          Get the ontology manager for this explanation generator.
 OWLClassReasoner getReasoner()
          Returns the reasoner associated with this generator.
 ReasonerFactory getReasonerFactory()
          Returns the reasoner factory used to generate reasoners.
 SingleExplanationGenerator getSingleExplanationGenerator()
           
 void setOntology(OWLOntology ontology)
          Sets the ontology according to which the explanations are generated.
 void setProgressMonitor(ExplanationProgressMonitor progressMonitor)
          Sets the progress monitor for this multiple explanation generator.
 void setReasoner(OWLClassReasoner reasoner)
          Sets the reasoner that will be used to generate explanations.
 void setReasonerFactory(ReasonerFactory reasonerFactory)
          Sets the reasoner factory that will be used to generate fresh reasoners.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final java.util.logging.Logger log
Constructor Detail

HSTExplanationGenerator

public HSTExplanationGenerator(SingleExplanationGenerator singleExplanationGenerator)
Method Detail

setProgressMonitor

public void setProgressMonitor(ExplanationProgressMonitor progressMonitor)
Description copied from interface: MultipleExplanationGenerator
Sets the progress monitor for this multiple explanation generator.

Specified by:
setProgressMonitor in interface MultipleExplanationGenerator
Parameters:
progressMonitor - The progress monitor.

getOntologyManager

public OWLOntologyManager getOntologyManager()
Description copied from interface: SingleExplanationGenerator
Get the ontology manager for this explanation generator.

Specified by:
getOntologyManager in interface SingleExplanationGenerator

getOntology

public OWLOntology getOntology()
Description copied from interface: SingleExplanationGenerator
Returns the ontology according to which the explanations are generated.

Specified by:
getOntology in interface SingleExplanationGenerator

setOntology

public void setOntology(OWLOntology ontology)
Description copied from interface: SingleExplanationGenerator
Sets the ontology according to which the explanations are generated.

Specified by:
setOntology in interface SingleExplanationGenerator

getReasoner

public OWLClassReasoner getReasoner()
Description copied from interface: SingleExplanationGenerator
Returns the reasoner associated with this generator.

Specified by:
getReasoner in interface SingleExplanationGenerator

setReasoner

public void setReasoner(OWLClassReasoner reasoner)
Description copied from interface: SingleExplanationGenerator
Sets the reasoner that will be used to generate explanations. This function is provided in addition to SingleExplanationGenerator.setReasonerFactory(ReasonerFactory) because the reasoning results already computed by the given reasoner can be reused. It is guaranteed that the state of this reasoner will not be invalidated by explanation generation, i.e. if the reasoner was in classified state it will stay in classified state.

Specified by:
setReasoner in interface SingleExplanationGenerator

getReasonerFactory

public ReasonerFactory getReasonerFactory()
Description copied from interface: SingleExplanationGenerator
Returns the reasoner factory used to generate reasoners.

Specified by:
getReasonerFactory in interface SingleExplanationGenerator

setReasonerFactory

public void setReasonerFactory(ReasonerFactory reasonerFactory)
Description copied from interface: SingleExplanationGenerator
Sets the reasoner factory that will be used to generate fresh reasoners. We create new reasoner instances to avoid invalidating the reasoning state of existing reasoners. Explanation generation process will modify the original ontology and/or reason over a subset of the original ontology. Using an alternate fresh reasoner for these tasks ensures efficient explanation generation without side effects to anything outside the explanation generatyor.

Specified by:
setReasonerFactory in interface SingleExplanationGenerator

getSingleExplanationGenerator

public SingleExplanationGenerator getSingleExplanationGenerator()

getExplanation

public java.util.Set<OWLAxiom> getExplanation(OWLDescription unsatClass)
Description copied from interface: ExplanationGenerator
Returns a single explanation for the given unsatisfiable class.

Specified by:
getExplanation in interface ExplanationGenerator
Specified by:
getExplanation in interface SingleExplanationGenerator
Parameters:
unsatClass - The class that is unsatisfiable for which an explanation will be generated.
Returns:
A single explanation for the given unsatisfiable class, or empty set if the concept is satisfiable

getExplanations

public java.util.Set<java.util.Set<OWLAxiom>> getExplanations(OWLDescription unsatClass)
Description copied from interface: ExplanationGenerator
Returns all the explanations for the given unsatisfiable class.

Specified by:
getExplanations in interface ExplanationGenerator
Parameters:
unsatClass - The class that is unsatisfiable for which an explanation will be generated.
Returns:
All explanations for the given unsatisfiable class, or an empty set if the concept is satisfiable

getExplanations

public java.util.Set<java.util.Set<OWLAxiom>> getExplanations(OWLDescription unsatClass,
                                                              int maxExplanations)
Description copied from interface: ExplanationGenerator
Return a specified number of explanations for the given unsatisfiable class. A smaller number of explanations can be returned if there are not as many explanations for the given concept. The returned set will be empty if the given class is satisfiable,

Specified by:
getExplanations in interface ExplanationGenerator
Parameters:
unsatClass - The class that is unsatisfiable for which an explanation will be generated.
maxExplanations - Maximum number of explanations requested, or 0 to get all the explanations
Returns:
A specified number of explanations for the given unsatisfiable class, or an empty set if the concept is satisfiable