com.clarkparsia.explanation
Class SingleExplanationGeneratorImpl

java.lang.Object
  extended by com.clarkparsia.explanation.SingleExplanationGeneratorImpl
All Implemented Interfaces:
SingleExplanationGenerator, TransactionAwareSingleExpGen
Direct Known Subclasses:
BlackBoxExplanation

public abstract class SingleExplanationGeneratorImpl
extends java.lang.Object
implements TransactionAwareSingleExpGen

Title: SingleExplanationGeneratorImpl

Description: An abstract implementation of SingleExplanationGenerator that can be used as the basis for different explanation generator techniques.

Copyright: Copyright (c) 2007

Company: Clark & Parsia, LLC.

Author:
Evren Sirin

Field Summary
protected  OWLClassReasoner altReasoner
           
protected  DefinitionTracker definitionTracker
           
protected  OWLOntologyManager owlOntologyManager
           
protected  OWLClassReasoner reasoner
           
protected  OWLReasonerFactory reasonerFactory
           
 
Constructor Summary
SingleExplanationGeneratorImpl(OWLOntologyManager manager)
           
 
Method Summary
 void beginTransaction()
          Indicates to the explanation generator that a transaction which may modify the ontology state is starting.
 void endTransaction()
          End a transaction.
 OWLClassReasoner getAltReasoner()
           
 java.util.Set<OWLOntology> getOntologies()
          Returns the set of ontologies according to which the explanations are generated.
 OWLOntology getOntology()
          
 OWLOntologyManager getOntologyManager()
          Get the ontology manager for this explanation generator.
 OWLClassReasoner getReasoner()
          Returns the reasoner associated with this generator.
 OWLReasonerFactory getReasonerFactory()
          Returns the reasoner factory used to generate reasoners.
protected  boolean isFirstExplanation()
           
 void setOntologies(java.util.Set<OWLOntology> ontologies)
          Sets the set of ontologies according to which the explanations are generated.
 void setOntology(OWLOntology ontology)
          Sets the set of ontologies according to which the explanations are generated to the import closure of the given ontologies.
 void setReasoner(OWLClassReasoner reasoner)
          Sets the reasoner that will be used to generate explanations.
 void setReasonerFactory(OWLReasonerFactory 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
 
Methods inherited from interface com.clarkparsia.explanation.SingleExplanationGenerator
getExplanation
 

Field Detail

owlOntologyManager

protected OWLOntologyManager owlOntologyManager

reasoner

protected OWLClassReasoner reasoner

reasonerFactory

protected OWLReasonerFactory reasonerFactory

definitionTracker

protected DefinitionTracker definitionTracker

altReasoner

protected OWLClassReasoner altReasoner
Constructor Detail

SingleExplanationGeneratorImpl

public SingleExplanationGeneratorImpl(OWLOntologyManager manager)
Method Detail

getOntologyManager

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

Specified by:
getOntologyManager in interface SingleExplanationGenerator

setOntology

public void setOntology(OWLOntology ontology)
Description copied from interface: SingleExplanationGenerator
Sets the set of ontologies according to which the explanations are generated to the import closure of the given ontologies.

Specified by:
setOntology in interface SingleExplanationGenerator

setOntologies

public void setOntologies(java.util.Set<OWLOntology> ontologies)
Description copied from interface: SingleExplanationGenerator
Sets the set of ontologies according to which the explanations are generated.

Specified by:
setOntologies 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(OWLReasonerFactory) 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

getOntology

public OWLOntology getOntology()

Specified by:
getOntology in interface SingleExplanationGenerator

getOntologies

public java.util.Set<OWLOntology> getOntologies()
Description copied from interface: SingleExplanationGenerator
Returns the set of ontologies according to which the explanations are generated.

Specified by:
getOntologies in interface SingleExplanationGenerator

getReasonerFactory

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

Specified by:
getReasonerFactory in interface SingleExplanationGenerator

setReasonerFactory

public void setReasonerFactory(OWLReasonerFactory 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 generator.

Specified by:
setReasonerFactory in interface SingleExplanationGenerator

getAltReasoner

public OWLClassReasoner getAltReasoner()

isFirstExplanation

protected boolean isFirstExplanation()

beginTransaction

public void beginTransaction()
Description copied from interface: TransactionAwareSingleExpGen
Indicates to the explanation generator that a transaction which may modify the ontology state is starting. Intended to allow the explanation generator to efficiently preserve state when used by HSTExplanationGenerator.

Specified by:
beginTransaction in interface TransactionAwareSingleExpGen

endTransaction

public void endTransaction()
Description copied from interface: TransactionAwareSingleExpGen
End a transaction. See TransactionAwareSingleExpGen.beginTransaction()

Specified by:
endTransaction in interface TransactionAwareSingleExpGen