Package openllet.core.boxes.abox
Class Individual
- java.lang.Object
-
- openllet.core.boxes.abox.Node
-
- openllet.core.boxes.abox.Individual
-
- All Implemented Interfaces:
CachedNode
public class Individual extends Node implements CachedNode
- Author:
- Evren Sirin
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Edge
addEdge(Role r, Node x, DependencySet dsParam)
void
addType(openllet.aterm.ATermAppl c, DependencySet ds)
void
addType(openllet.aterm.ATermAppl c, DependencySet dsParam, boolean checkForPruned)
boolean
canApply(int type)
boolean
checkMaxClash(openllet.aterm.ATermAppl normalizedMax, DependencySet maxDepends)
boolean
checkMinClash(openllet.aterm.ATermAppl minCard, DependencySet minDepends)
Node
copyTo(ABoxImpl abox)
java.lang.String
debugString()
short
getDepth()
DependencySet
getDifferenceDependency(Node node)
java.util.Set<Node>
getDifferents()
EdgeList
getEdgesTo(Node x)
EdgeList
getEdgesTo(Node x, Role r)
int
getMaxCard(Role r)
int
getMinCard(Role r, openllet.aterm.ATermAppl c)
DependencySet
getNodeDepends()
int
getNominalLevel()
void
getObviousTypes(java.util.List<openllet.aterm.ATermAppl> types, java.util.List<openllet.aterm.ATermAppl> nonTypes)
Collects atomic concepts such that either that concept or its negation exist in the _types list without depending on any non-deterministic _branch.EdgeList
getOutEdges()
Returns the outgoing edges of this _node.Individual
getParent()
EdgeList
getRNeighborEdges(Role r)
EdgeList
getRNeighborEdges(Role r, Node node)
java.util.Set<Node>
getRNeighbors(Role r)
EdgeList
getRPredecessorEdges(Role r)
EdgeList
getRSuccessorEdges(Role r)
java.util.Set<Node>
getRSuccessors(Role r, openllet.aterm.ATermAppl c)
Individual
getSame()
openllet.aterm.ATermAppl
getTerm()
java.util.List<openllet.aterm.ATermAppl>
getTypes(int type)
Bool
hasDataPropertyValue(Role r, java.lang.Object value)
Check the property assertions to see if it is possible for this _individual to have the value for the given datatype property.DependencySet
hasDistinctRNeighborsForMax(Role r, int n, openllet.aterm.ATermAppl c)
Checks if this _individual has at least n distinct r-neighbors that has a specific type.boolean
hasDistinctRNeighborsForMin(Role r, int n, openllet.aterm.ATermAppl c)
boolean
hasDistinctRNeighborsForMin(Role r, int n, openllet.aterm.ATermAppl c, boolean onlyNominals)
Returns true if this _individual has at least n distinct r-neighbors.DependencySet
hasMax1(Role r)
boolean
hasRNeighbor(Role r)
Checks if this node is connected to another _node with the given role (or one of its subproperties).boolean
hasRSuccessor(Role r, Node x)
boolean
hasSuccessor(Node x)
boolean
isBlockable()
boolean
isBlocked()
using only for 'tableau' algorithm.boolean
isBottom()
Returns if this is the cached _node for TOP concept.boolean
isComplete()
Returns if this cached _node is complete.boolean
isDifferent(Node node)
boolean
isIndependent()
Returns if this _node was cached without any dependency to a non-deterministic _branch.boolean
isIndividual()
boolean
isLeaf()
boolean
isLiteral()
boolean
isNominal()
boolean
isRedundantMax(openllet.aterm.ATermAppl maxCard)
boolean
isRedundantMin(openllet.aterm.ATermAppl minCard)
boolean
isTop()
Returns if this is the cached _node for BOTTOM concept.void
prune(DependencySet ds)
Prune the given _node by removing all links going to nominal _nodes and recurse through all successors.boolean
removeEdge(Edge edge)
boolean
removeType(openllet.aterm.ATermAppl c)
void
reset(boolean onlyApplyTypes)
Resets this _node (_types, edges, sames, _differents) to contain only asserted information.boolean
restore(int branch)
void
setBlocked(boolean isBlocked)
use only for 'tableau' algorithm.void
setNominalLevel(int level)
void
unprune(int branch)
-
Methods inherited from class openllet.core.boxes.abox.Node
equals, getABox, getAllMerged, getDepends, getDepends, getInEdges, getMerged, getMergeDependency, getMergedTo, getName, getNameStr, getPath, getPruned, getTypes, hashCode, hasObviousType, hasObviousType, hasType, inheritDifferents, isBnode, isConceptRoot, isMerged, isNamedIndividual, isPruned, isRoot, isRootNominal, isSame, removeInEdge, restorePruned, setChanged, setConceptRoot, setDifferent, setSame, toString, types, undoSetSame
-
Methods inherited from interface openllet.core.tableau.cache.CachedNode
getDepends, getInEdges, getName, isNamedIndividual
-
-
-
-
Method Detail
-
isBlocked
public boolean isBlocked()
using only for 'tableau' algorithm.- Returns:
- blocking or not
-
setBlocked
public void setBlocked(boolean isBlocked)
use only for 'tableau' algorithm.- Parameters:
isBlocked
- set to blocking or not
-
getDepth
public short getDepth()
-
getNodeDepends
public DependencySet getNodeDepends()
- Specified by:
getNodeDepends
in classNode
-
isIndividual
public boolean isIndividual()
- Specified by:
isIndividual
in classNode
-
isBlockable
public boolean isBlockable()
- Specified by:
isBlockable
in classNode
-
isIndependent
public boolean isIndependent()
Description copied from interface:CachedNode
Returns if this _node was cached without any dependency to a non-deterministic _branch. In the presence of nominals, when we are checking the satisfiability of a concept the root _node may be merged to a nominal _node and that merge may be due to a non-deterministic _branch. In such cases the types and edges that are cached do not necessarily show types and edges that will exist in every clash-free tableau completion.- Specified by:
isIndependent
in interfaceCachedNode
- Returns:
- If this _node was cached without any dependency to a non-deterministic _branch
-
setNominalLevel
public void setNominalLevel(int level)
-
getNominalLevel
public int getNominalLevel()
- Specified by:
getNominalLevel
in classNode
-
getTypes
public java.util.List<openllet.aterm.ATermAppl> getTypes(int type)
-
isDifferent
public boolean isDifferent(Node node)
- Overrides:
isDifferent
in classNode
-
getDifferents
public java.util.Set<Node> getDifferents()
- Overrides:
getDifferents
in classNode
-
getDifferenceDependency
public DependencySet getDifferenceDependency(Node node)
- Overrides:
getDifferenceDependency
in classNode
-
getObviousTypes
public void getObviousTypes(java.util.List<openllet.aterm.ATermAppl> types, java.util.List<openllet.aterm.ATermAppl> nonTypes)
Collects atomic concepts such that either that concept or its negation exist in the _types list without depending on any non-deterministic _branch. First list is filled with _types and second list is filled with non-_types, i.e. this _individual can never be an instance of any element in the second list.- Parameters:
types
- All atomic concepts found in typesnonTypes
- All atomic concepts
-
canApply
public boolean canApply(int type)
-
addType
public void addType(openllet.aterm.ATermAppl c, DependencySet ds)
-
addType
public void addType(openllet.aterm.ATermAppl c, DependencySet dsParam, boolean checkForPruned)
-
checkMinClash
public boolean checkMinClash(openllet.aterm.ATermAppl minCard, DependencySet minDepends)
-
checkMaxClash
public boolean checkMaxClash(openllet.aterm.ATermAppl normalizedMax, DependencySet maxDepends)
-
isRedundantMin
public boolean isRedundantMin(openllet.aterm.ATermAppl minCard)
-
isRedundantMax
public boolean isRedundantMax(openllet.aterm.ATermAppl maxCard)
-
hasMax1
public DependencySet hasMax1(Role r)
-
getMaxCard
public int getMaxCard(Role r)
-
getMinCard
public int getMinCard(Role r, openllet.aterm.ATermAppl c)
-
removeType
public boolean removeType(openllet.aterm.ATermAppl c)
- Overrides:
removeType
in classNode
-
getSame
public final Individual getSame()
-
getRNeighborEdges
public EdgeList getRNeighborEdges(Role r, Node node)
- Parameters:
r
-node
-- Returns:
- neighbor edges to a specific node
-
hasDistinctRNeighborsForMax
public DependencySet hasDistinctRNeighborsForMax(Role r, int n, openllet.aterm.ATermAppl c)
Checks if this _individual has at least n distinct r-neighbors that has a specific type.- Parameters:
r
- Role we use to find neighborsn
- Number of neighborsc
- The type that all neighbors should belong to- Returns:
- The union of dependencies for the edges leading to neighbors and the dependency of the type assertion for each _neighbor
-
hasDistinctRNeighborsForMin
public boolean hasDistinctRNeighborsForMin(Role r, int n, openllet.aterm.ATermAppl c)
-
hasDistinctRNeighborsForMin
public boolean hasDistinctRNeighborsForMin(Role r, int n, openllet.aterm.ATermAppl c, boolean onlyNominals)
Returns true if this _individual has at least n distinct r-neighbors. If only nominal neighbors are wanted then blockable ones will simply be ignored (note that this should only happen if r is an object property)- Parameters:
r
-n
-c
-onlyNominals
-- Returns:
- true if this individual has at least n distinct r-neighbors.
-
hasRNeighbor
public final boolean hasRNeighbor(Role r)
Description copied from interface:CachedNode
Checks if this node is connected to another _node with the given role (or one of its subproperties). The _node may have an incoming edge with the inverse of this role which would count as an r-neighbor.- Specified by:
hasRNeighbor
in interfaceCachedNode
- Returns:
- Outgoing edges of this node
-
hasSuccessor
public boolean hasSuccessor(Node x)
- Specified by:
hasSuccessor
in classNode
-
hasDataPropertyValue
public Bool hasDataPropertyValue(Role r, java.lang.Object value)
Check the property assertions to see if it is possible for this _individual to have the value for the given datatype property. This function is meaningful only called for individuals in a completed ABox (a pseudo model for the KB). In a completed ABox, _individual will have some literal successors that may or may not have a known value. The _individual has the _data property value only if it has a literal successor that has the exact given value and the edge between the _individual and the literal does not depend on any non- deterministic _branch. If the literal value is there but the edge _depends on a _branch then we cannot exactly say if the literal value is there or not. If there is no literal successor with the given value then we can for sure say that _individual does not have the _data property value (because it does not have the value in at least one model)- Parameters:
r
-value
-- Returns:
- Bool.TRUE if the _individual definetely has the property value, Bool.FALSE if the _individual definetely does NOT have the property value and Bool.UNKNOWN if it cannot be determined for sure, i.e. consistency check is required
-
addEdge
public Edge addEdge(Role r, Node x, DependencySet dsParam)
-
getOutEdges
public final EdgeList getOutEdges()
Description copied from interface:CachedNode
Returns the outgoing edges of this _node.- Specified by:
getOutEdges
in interfaceCachedNode
- Returns:
- Outgoing edges of this _node
-
getParent
public Individual getParent()
- Returns:
- can return null
- Since:
- 2.30
-
reset
public void reset(boolean onlyApplyTypes)
Resets this _node (_types, edges, sames, _differents) to contain only asserted information. This function can be seen a specialized case of restore but a special function is needed both for correctness (e.g. SMART_RESTORE option should not change behavior) and performance
-
removeEdge
public final boolean removeEdge(Edge edge)
-
prune
public void prune(DependencySet ds)
Prune the given _node by removing all links going to nominal _nodes and recurse through all successors. No need to remove incoming edges because either the _node is the first one being pruned so the merge function already handled it or this is a successor _node and its successor is also being pruned
-
debugString
public java.lang.String debugString()
-
isBottom
public boolean isBottom()
Returns if this is the cached _node for TOP concept.- Specified by:
isBottom
in interfaceCachedNode
- Returns:
true
if this is the cached _node for TOP concept
-
isComplete
public boolean isComplete()
Returns if this cached _node is complete.- Specified by:
isComplete
in interfaceCachedNode
- Returns:
true
if this cached _node is complete
-
isTop
public boolean isTop()
Returns if this is the cached _node for BOTTOM concept.- Specified by:
isTop
in interfaceCachedNode
- Returns:
true
if this is the cached _node for BOTTOM concept
-
-