org.semanticweb.elk.reasoner.stages
Class AbstractReasonerState

java.lang.Object
  extended by org.semanticweb.elk.reasoner.stages.AbstractReasonerState
Direct Known Subclasses:
Reasoner

public abstract class AbstractReasonerState
extends Object

The execution state of the reasoner containing information about which reasoning stages have been completed and holding the results of these reasoning stages, such as the consistency status of the ontology, class, or instance taxonomy.

Author:
"Yevgeny Kazakov"

Constructor Summary
protected AbstractReasonerState()
           
protected AbstractReasonerState(AxiomLoader axiomLoader)
           
 
Method Summary
 void clearInterrupt()
          clears the interrupt status of the reasoner
 boolean doneConsistencyCheck()
           
 boolean doneInstanceTaxonomy()
           
 boolean doneTaxonomy()
           
 void forceLoading()
          Forces loading of all axioms from the registered AxiomLoaders.
 Set<ElkClass> getAllClasses()
           
 Set<ElkNamedIndividual> getAllNamedIndividuals()
           
 Map<IndexedClassExpression,Context> getContextMap()
           
 Collection<IndexedClassExpression> getIndexedClassExpressions()
           
 InstanceTaxonomy<ElkClass,ElkNamedIndividual> getInstanceTaxonomy()
          Compute the inferred taxonomy of the named classes with instances if this has not been done yet.
 InstanceTaxonomy<ElkClass,ElkNamedIndividual> getInstanceTaxonomyQuietly()
          Compute the inferred taxonomy of the named classes with instances if this has not been done yet.
protected abstract  int getNumberOfWorkers()
           
protected  OntologyIndex getOntologyIndex()
          Compute the index representation of the given ontology if it has not been done yet.
protected abstract  ComputationExecutor getProcessExecutor()
           
protected abstract  ProgressMonitor getProgressMonitor()
           
 Map<IndexedPropertyChain,SaturatedPropertyChain> getPropertySaturationMap()
           
protected abstract  ReasonerStageExecutor getStageExecutor()
           
 Taxonomy<ElkClass> getTaxonomy()
          Compute the inferred taxonomy of the named classes for the given ontology if it has not been done yet.
 Taxonomy<ElkClass> getTaxonomyQuietly()
          Compute the inferred taxonomy of the named classes for the given ontology if it has not been done yet.
 void initClassTaxonomy()
           
 void initInstanceTaxonomy()
           
 void interrupt()
          interrupts running reasoning stages
 boolean isAllowIncrementalMode()
           
 boolean isInconsistent()
          Check consistency of the current ontology, if this has not been done yet.
 boolean isIncrementalMode()
           
 boolean isInterrupted()
           
 void registerAxiomLoader(AxiomLoader newAxiomLoader)
           
 void resetAxiomLoading()
          Reset the axiom loading stage and all subsequent stages
 void setAllowIncrementalMode(boolean allow)
           
protected  boolean setAllowIncrementalTaxonomy(boolean flag)
           
protected  boolean useIncrementalTaxonomy()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractReasonerState

protected AbstractReasonerState()

AbstractReasonerState

protected AbstractReasonerState(AxiomLoader axiomLoader)
Method Detail

setAllowIncrementalMode

public void setAllowIncrementalMode(boolean allow)

isAllowIncrementalMode

public boolean isAllowIncrementalMode()

isIncrementalMode

public boolean isIncrementalMode()

resetAxiomLoading

public void resetAxiomLoading()
Reset the axiom loading stage and all subsequent stages


registerAxiomLoader

public void registerAxiomLoader(AxiomLoader newAxiomLoader)

forceLoading

public void forceLoading()
                  throws ElkLoadingException
Forces loading of all axioms from the registered AxiomLoaders. Typically, loading lazily when reasoning tasks are requested.

Throws:
ElkLoadingException - if axioms cannot be loaded

getNumberOfWorkers

protected abstract int getNumberOfWorkers()
Returns:
the maximal number of workers that can be used for running concurrent reasoning tasks

getStageExecutor

protected abstract ReasonerStageExecutor getStageExecutor()
Returns:
the ReasonerStageExecutor that is used for executing the stages of the reasoner.

getProcessExecutor

protected abstract ComputationExecutor getProcessExecutor()
Returns:
the ComputationExecutor that is used for execution of reasoning processes

getProgressMonitor

protected abstract ProgressMonitor getProgressMonitor()
Returns:
the ProgressMonitor that is used for reporting progress on all potentially long-running operations.

interrupt

public void interrupt()
interrupts running reasoning stages


isInterrupted

public boolean isInterrupted()
Returns:
true if the reasoner has been interrupted and the interrupt status of the reasoner has not been cleared yet

clearInterrupt

public void clearInterrupt()
clears the interrupt status of the reasoner


isInconsistent

public boolean isInconsistent()
                       throws ElkException
Check consistency of the current ontology, if this has not been done yet.

Returns:
true if the ontology is inconsistent, that is, unsatisfiable.
Throws:
ElkException - if the reasoning process cannot be completed successfully

getTaxonomy

public Taxonomy<ElkClass> getTaxonomy()
                               throws ElkInconsistentOntologyException,
                                      ElkException
Compute the inferred taxonomy of the named classes for the given ontology if it has not been done yet.

Returns:
the class taxonomy implied by the current ontology
Throws:
ElkInconsistentOntologyException - if the ontology is inconsistent
ElkException - if the reasoning process cannot be completed successfully

getTaxonomyQuietly

public Taxonomy<ElkClass> getTaxonomyQuietly()
                                      throws ElkException
Compute the inferred taxonomy of the named classes for the given ontology if it has not been done yet.

Returns:
the class taxonomy implied by the current ontology
Throws:
ElkException - if the reasoning process cannot be completed successfully

getInstanceTaxonomy

public InstanceTaxonomy<ElkClass,ElkNamedIndividual> getInstanceTaxonomy()
                                                                  throws ElkException
Compute the inferred taxonomy of the named classes with instances if this has not been done yet.

Returns:
the instance taxonomy implied by the current ontology
Throws:
ElkInconsistentOntologyException - if the ontology is inconsistent
ElkException - if the reasoning process cannot be completed successfully

getInstanceTaxonomyQuietly

public InstanceTaxonomy<ElkClass,ElkNamedIndividual> getInstanceTaxonomyQuietly()
                                                                         throws ElkException
Compute the inferred taxonomy of the named classes with instances if this has not been done yet.

Returns:
the instance taxonomy implied by the current ontology
Throws:
ElkException - if the reasoning process cannot be completed successfully

getAllClasses

public Set<ElkClass> getAllClasses()
Returns:
all ElkClasses occurring in the ontology

getAllNamedIndividuals

public Set<ElkNamedIndividual> getAllNamedIndividuals()
Returns:
all ElkNamedIndividuals occurring in the ontology

getContextMap

public Map<IndexedClassExpression,Context> getContextMap()

getPropertySaturationMap

public Map<IndexedPropertyChain,SaturatedPropertyChain> getPropertySaturationMap()

doneConsistencyCheck

public boolean doneConsistencyCheck()
Returns:
true if the ontology has been checked for consistency.

doneTaxonomy

public boolean doneTaxonomy()
Returns:
true if the class taxonomy has been computed

doneInstanceTaxonomy

public boolean doneInstanceTaxonomy()
Returns:
true if the instance taxonomy has been computed

getOntologyIndex

protected OntologyIndex getOntologyIndex()
                                  throws ElkException
Compute the index representation of the given ontology if it has not been done yet.

Returns:
the index representation of the given ontology
Throws:
ElkException - if the reasoning process cannot be completed successfully

setAllowIncrementalTaxonomy

protected boolean setAllowIncrementalTaxonomy(boolean flag)

useIncrementalTaxonomy

protected boolean useIncrementalTaxonomy()

initClassTaxonomy

public void initClassTaxonomy()

initInstanceTaxonomy

public void initInstanceTaxonomy()

getIndexedClassExpressions

public Collection<IndexedClassExpression> getIndexedClassExpressions()


Copyright © 2011-2013 Department of Computer Science, University of Oxford. All Rights Reserved.