|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.semanticweb.elk.reasoner.stages.AbstractReasonerState
org.semanticweb.elk.reasoner.Reasoner
public class Reasoner
The class for querying the results of the reasoning tasks for a given
ontology. The input ontology is represented internally by the
OntologyIndex object, which is updated by adding or removing
ElkAxioms (methods addAxiom() and removeAxiom()). When querying the
results of the reasoning tasks, the reasoner will ensure that all necessary
reasoning stages, such as consistency checking, are performed.
Reasoners are created (and pre-configured) by the ReasonerFactory.
| Field Summary | |
|---|---|
protected boolean |
allowFreshEntities
Should fresh entities in reasoner queries be accepted (configuration setting). |
protected ProgressMonitor |
progressMonitor
The progress monitor that is used for reporting progress. |
protected ReasonerStageExecutor |
stageExecutor
The executor for various stages of the reasoner |
| Constructor Summary | |
|---|---|
protected |
Reasoner(AxiomLoader axiomLoader,
ReasonerStageExecutor stageExecutor,
ExecutorService executor)
Constructor. |
| Method Summary | |
|---|---|
boolean |
getAllowFreshEntities()
Get whether fresh entities are allowed. |
TaxonomyNode<ElkClass> |
getClassNode(ElkClassExpression classExpression)
Return the TaxonomyNode for the given ElkClassExpression. |
Node<ElkClass> |
getEquivalentClasses(ElkClassExpression classExpression)
Return the Node containing equivalent classes of the given
ElkClassExpression. |
protected InstanceNode<ElkClass,ElkNamedIndividual> |
getInstanceNode(ElkNamedIndividual elkNamedIndividual)
Helper method to get an InstanceNode from the taxonomy. |
Set<? extends Node<ElkNamedIndividual>> |
getInstances(ElkClassExpression classExpression,
boolean direct)
Return the (direct or indirect) instances of the given ElkClassExpression as specified by the parameter. |
protected int |
getNumberOfWorkers()
|
protected ComputationExecutor |
getProcessExecutor()
|
protected ProgressMonitor |
getProgressMonitor()
|
protected ReasonerStageExecutor |
getStageExecutor()
|
Set<? extends Node<ElkClass>> |
getSubClasses(ElkClassExpression classExpression,
boolean direct)
Return the (direct or indirect) subclasses of the given ElkClassExpression as specified by the parameter. |
Set<? extends Node<ElkClass>> |
getSuperClasses(ElkClassExpression classExpression,
boolean direct)
Return the (direct or indirect) superclasses of the given ElkClassExpression as specified by the parameter. |
protected TaxonomyNode<ElkClass> |
getTaxonomyNode(ElkClass elkClass)
Helper method to get a TaxonomyNode from the taxonomy. |
protected TypeNode<ElkClass,ElkNamedIndividual> |
getTypeNode(ElkClass elkClass)
Helper method to get a TypeNode from the taxonomy. |
Set<? extends Node<ElkClass>> |
getTypes(ElkNamedIndividual elkNamedIndividual,
boolean direct)
Return the (direct or indirect) types of the given ElkNamedIndividual. |
boolean |
isSatisfiable(ElkClassExpression classExpression)
Check if the given ElkClassExpression is satisfiable, that is, if
it can possibly have instances. |
void |
setAllowFreshEntities(boolean allow)
Set if fresh entities should be allowed. |
void |
setConfigurationOptions(ReasonerConfiguration config)
This supposed to be the central place where the reasoner gets its configuration options |
void |
setNumberOfWorkers(int workerNo)
Sets the number of working threads. |
void |
setProgressMonitor(ProgressMonitor progressMonitor)
Set the progress monitor that will be used for reporting progress on all potentially long-running operations. |
boolean |
shutdown()
Tries to shut down the reasoner within 1 minute |
boolean |
shutdown(long timeout,
TimeUnit unit)
Tries to shut down the reasoner within the specified time |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ProgressMonitor progressMonitor
protected final ReasonerStageExecutor stageExecutor
protected boolean allowFreshEntities
ElkFreshEntitiesException will be thrown
when encountering entities that did not occur in the ontology.
| Constructor Detail |
|---|
protected Reasoner(AxiomLoader axiomLoader,
ReasonerStageExecutor stageExecutor,
ExecutorService executor)
ReasonerFactory.
| Method Detail |
|---|
public void setProgressMonitor(ProgressMonitor progressMonitor)
progressMonitor - public void setAllowFreshEntities(boolean allow)
ElkFreshEntitiesException will be thrown in
such cases. If true, the reasoner will answer as if the entity had been
declared (but not used in any axiom).
allow - public boolean getAllowFreshEntities()
setAllowFreshEntities(boolean) for details.
true if fresh entities are allowedprotected int getNumberOfWorkers()
getNumberOfWorkers in class AbstractReasonerStatepublic void setNumberOfWorkers(int workerNo)
workerNo - public void setConfigurationOptions(ReasonerConfiguration config)
config - protected ComputationExecutor getProcessExecutor()
getProcessExecutor in class AbstractReasonerStateComputationExecutor that is used for execution of
reasoning processesprotected ReasonerStageExecutor getStageExecutor()
getStageExecutor in class AbstractReasonerStateReasonerStageExecutor that is used for executing the
stages of the reasoner.protected ProgressMonitor getProgressMonitor()
getProgressMonitor in class AbstractReasonerStateProgressMonitor that is used for reporting progress
on all potentially long-running operations.
public boolean shutdown(long timeout,
TimeUnit unit)
throws InterruptedException
timeout - the maximum time to waitunit - the time unit of the timeout argument
true if the operation was successful
InterruptedException - if the current thread was interrupted
public boolean shutdown()
throws InterruptedException
true if the operation was successful
InterruptedException - if the current thread was interrupted
protected TaxonomyNode<ElkClass> getTaxonomyNode(ElkClass elkClass)
throws ElkException
TaxonomyNode from the taxonomy.
elkClass - an ElkClass for which to find a TaxonomyNode
TaxonomyNode for the given ElkClass
ElkException
protected InstanceNode<ElkClass,ElkNamedIndividual> getInstanceNode(ElkNamedIndividual elkNamedIndividual)
throws ElkException
InstanceNode from the taxonomy.
elkNamedIndividual -
InstanceNode for the given ElkNamedIndividual
ElkException - if the result cannot be computed
protected TypeNode<ElkClass,ElkNamedIndividual> getTypeNode(ElkClass elkClass)
throws ElkException
TypeNode from the taxonomy.
elkClass -
TypeNode for the given ElkClass
ElkException - if the result cannot be computed
public TaxonomyNode<ElkClass> getClassNode(ElkClassExpression classExpression)
throws ElkException
TaxonomyNode for the given ElkClassExpression.
Calling of this method may trigger the computation of the taxonomy, if it
has not been done yet. If the input is an ElkClass that does not
occur in the ontology and fresh entities are not allowed, a
ElkFreshEntitiesException will be thrown.
classExpression - the ElkClassExpression for which to return the
Node
TaxonomyNode for the given ElkClassExpression
ElkException - if the result cannot be computed
public Node<ElkClass> getEquivalentClasses(ElkClassExpression classExpression)
throws ElkException
Node containing equivalent classes of the given
ElkClassExpression. Calling of this method may trigger the
computation of the taxonomy, if it has not been done yet.
classExpression - the ElkClassExpression for which to return the
Node
Node whose members are ElkClasses
equivalent to the given ElkClassExpression
ElkException - if the result cannot be computed
public Set<? extends Node<ElkClass>> getSubClasses(ElkClassExpression classExpression,
boolean direct)
throws ElkException
ElkClassExpression as specified by the parameter. The method
returns a set of Nodes, each of which representing an equivalent
class of subclasses. Calling of this method may trigger the computation
of the taxonomy, if it has not been done yet.
classExpression - the ElkClassExpression for which to return the
subclass Nodesdirect - if true, only direct subclasses should be returned
Nodes for direct or indirect subclasses of the
given ElkClassExpression according to the specified
parameter
ElkException - if the result cannot be computed
public Set<? extends Node<ElkClass>> getSuperClasses(ElkClassExpression classExpression,
boolean direct)
throws ElkException
ElkClassExpression as specified by the parameter. The method
returns a set of Nodes, each of which representing an equivalent
class of superclasses. Calling of this method may trigger the computation
of the taxonomy, if it has not been done yet.
classExpression - the ElkClassExpression for which to return the
superclass Nodesdirect - if true, only direct superclasses are returned
Nodes for direct or indirect superclasses of
the given ElkClassExpression according to the specified
parameter
ElkException - if the result cannot be computed
public Set<? extends Node<ElkNamedIndividual>> getInstances(ElkClassExpression classExpression,
boolean direct)
throws ElkException
ElkClassExpression as specified by the parameter. The method
returns a set of Nodes, each of which representing an equivalent
class of instances. Calling of this method may trigger the computation of
the realization, if it has not been done yet.
classExpression - the ElkClassExpression for which to return the
instances Nodesdirect - if true, only direct instances are returned
Nodes for direct or indirect instances of the
given ElkClassExpression according to the specified
parameter
ElkException - if the result cannot be computed
public Set<? extends Node<ElkClass>> getTypes(ElkNamedIndividual elkNamedIndividual,
boolean direct)
throws ElkException
ElkNamedIndividual. The method returns a set of Nodes,
each of which representing an equivalent class of types. Calling of this
method may trigger the computation of the realization, if it has not been
done yet.
elkNamedIndividual - the ElkNamedIndividual for which to return the types
Nodesdirect - if true, only direct types are returned
Nodes for the direct or indirect types of the
given ElkNamedIndividual according to the specified
parameter
ElkException - if the result cannot be computed
public boolean isSatisfiable(ElkClassExpression classExpression)
throws ElkException
ElkClassExpression is satisfiable, that is, if
it can possibly have instances. ElkClassExpressions are not
satisfiable if they are equivalent to owl:Nothing. A satisfiable
ElkClassExpression is also called consistent or coherent. Calling
of this method may trigger the computation of the taxonomy, if it has not
been done yet.
classExpression - the ElkClassExpression for which to check
satisfiability
true if the given input is satisfiable
ElkException - if the result cannot be computed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||