|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.semanticweb.elk.reasoner.saturation.ContextImpl
public class ContextImpl
Context implementation that is used for EL reasoning. It provides data structures for storing and retrieving various types of derived expressions, including computed subsumptions between class expressions.
| Field Summary | |
|---|---|
protected boolean |
isInconsistent
true if owl:Nothing is stored in subsumers_ |
protected boolean |
isSaturated
true if all derived Subsumer of root_ have been
computed. |
| Constructor Summary | |
|---|---|
ContextImpl(IndexedClassExpression root)
Construct a new Context for the given root
IndexedClassExpression. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected volatile boolean isSaturated
true if all derived Subsumer of root_ have been
computed.
protected volatile boolean isInconsistent
true if owl:Nothing is stored in subsumers_
| Constructor Detail |
|---|
public ContextImpl(IndexedClassExpression root)
Context for the given root
IndexedClassExpression. Initially, the context is not active.
root - | Method Detail |
|---|
public IndexedClassExpression getRoot()
getRoot in interface ContextIndexedClassExpression for which this Context
is assigned. This may never been null.public void removeLinks()
ContextContext from the chain of contexts
removeLinks in interface Contextpublic Set<IndexedClassExpression> getSubsumers()
getSubsumers in interface ContextIndexedClassExpressions that subsume the root
IndexedClassExpressionpublic boolean addSubsumer(IndexedClassExpression expression)
ContextIndexedClassExpression to the subsumers of the
root IndexedClassExpression of this Context.
addSubsumer in interface Contextexpression - the IndexedClassExpression to be added as a susbumer
of the root IndexedClassExpression of this
Context.
true if the set of subsumers of this Context has
changed as the result of calling this method, i.e., the input
IndexedClassExpression was not a subsumer before. This
method is not thread safe.public boolean containsSubsumer(IndexedClassExpression expression)
ContextIndexedClassExpression is a subsumer of
the root IndexedClassExpression of this Context.
containsSubsumer in interface Contextexpression - the IndexedClassExpression to be tested for this
Context
true if the given IndexedClassExpression is a
subsumer of the root in this Context. This method is not
thread safe.public boolean removeSubsumer(IndexedClassExpression expression)
ContextIndexedClassExpression from the subsumers of
the root IndexedClassExpression of this Context.
removeSubsumer in interface Contextexpression - the IndexedClassExpression to be removed from the
subsumers of the root in this Context
true if the set of subsumers of this Context has
changed as the result of calling this method, i.e., the input
IndexedClassExpression was a subsumer before. This method
is not thread safe.public boolean isInconsistent()
isInconsistent in interface Contexttrue if a contradiction has not been derived for the root
IndexedClassExpressionpublic boolean setInconsistent(boolean inconsistent)
ContextContext to the given value.
setInconsistent in interface Contextpublic Multimap<IndexedPropertyChain,Context> getBackwardLinksByObjectProperty()
getBackwardLinksByObjectProperty in interface ContextContexts from which there exists an (implied)
"existential relation" with this Context indexed by the
IndexedPropertyChain of this relation. For example, if
the input ontology contains an axiom
SubClassOf(:A ObjectSomeValuesFrom(:r :B) then an
existential link between the context with root :A and the
context with root :B with property :r will be
created. For technical reasons, this link is stored in the
context for :B, as a "backward link" <:r, :A>
indexed by :r in the Multimap returned by this
method. The returned Multimap is not thread safe and
should be accessed from at most one thread at a time. This is
never null.public boolean containsBackwardLink(BackwardLink link)
containsBackwardLink in interface Contextpublic boolean addDisjointnessAxiom(IndexedDisjointnessAxiom disjointnessAxiom)
ContextIndexedDisjointnessAxiom to this
Context.
addDisjointnessAxiom in interface ContextdisjointnessAxiom - the IndexedDisjointnessAxiom to be added to this
Context
true if adding the axiom changes the state of this
Context, i.e., some rules need to be appliedpublic boolean removeDisjointnessAxiom(IndexedDisjointnessAxiom axiom)
ContextIndexedDisjointnessAxiom from
this Context.
removeDisjointnessAxiom in interface Contextaxiom - the IndexedDisjointnessAxiom to be removed from this
Context
true if the state of this Context has changed as
the result of calling this method, i.e., the context has
contained this IndexedDisjointnessAxiompublic boolean containsDisjointnessAxiom(IndexedDisjointnessAxiom axiom)
containsDisjointnessAxiom in interface Contextaxiom - the IndexedDisjointnessAxiom to be checked for
occurrences in this Context
true if the given IndexedDisjointnessAxiom occurs
in this Contextpublic boolean inconsistencyDisjointnessAxiom(IndexedDisjointnessAxiom axiom)
inconsistencyDisjointnessAxiom in interface Contextaxiom - the IndexedDisjointnessAxiom to be checked for causing
inconsistency in this Context
true if the given IndexedDisjointnessAxiom causes
inconsistency of this Contextpublic boolean setSaturated(boolean saturated)
ContextContext as saturated. This means that all all
Conclusions for this Context are already computed.
setSaturated in interface ContextContextpublic boolean isSaturated()
isSaturated in interface Contexttrue if all Conclusions for this Context,
as determined by the function
Conclusion.getSourceContext(Context), are already
computed.public boolean addBackwardLink(BackwardLink link)
ContextBackwardLink to this Context.
addBackwardLink in interface Contextlink - the BackwardLink being added to this Context
true if this Context has changed as the result
this method, i.e., the given BackwardLink has not been
added before to this Context. This method is not thread
safe.public boolean removeBackwardLink(BackwardLink link)
removeBackwardLink in interface Contextpublic AbstractChain<ModifiableLinkRule<BackwardLink>> getBackwardLinkRuleChain()
getBackwardLinkRuleChain in interface ContextChain view of all backward link rules assigned to
this Context; this is always not null. This
method can be used for convenient search and modification
(addition and deletion) of the rules using the methods of the
Chain interface without without worrying about
null values.public ModifiableLinkRule<BackwardLink> getBackwardLinkRuleHead()
getBackwardLinkRuleHead in interface ContextContext, or
null if there no such rules; all other rules can be
obtained by traversing over Link.next(); this method
should be used to access the rules without modifying them.public boolean addToDo(Conclusion conclusion)
ContextConclusion to be processed within this
Context. The method returns true when this is the first
unprocessed conclusion added to the context after it is being created or
cleared (that is, Context.takeToDo() has returned null). If
several threads call this method at the same time for the same
Context then at most one of these method returns true,
unless Context.takeToDo() is called as well.
addToDo in interface Contextconclusion - the Conclusion added to be processed within this
Context
true when the added conclusion is the first unprocessed
conclusion for this contextContext.takeToDo()public Conclusion takeToDo()
ContextConclusions of this
context. This method is thread safe and can be used concurrently with the
method Context.addToDo(Conclusion).
takeToDo in interface ContextConclusion of this context, if there is
one, or null if there is no such ConclusionContext.addToDo(Conclusion)public String toString()
toString in class Objectpublic boolean isEmpty()
isEmpty in interface Contexttrue if the context is empty
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||