org.mindswap.pellet
Class Individual

java.lang.Object
  extended by org.mindswap.pellet.Node
      extended by org.mindswap.pellet.Individual
All Implemented Interfaces:
CachedNode

public class Individual
extends Node
implements CachedNode

Author:
Evren Sirin

Field Summary
 int[] applyNext
           
 
Fields inherited from class org.mindswap.pellet.Node
ALL, ATOM, BLOCKABLE, CHANGED, log, MAX, MIN, NOM, NOMINAL, OR, SOME, TYPES, UNCHANGED
 
Method Summary
 Edge addEdge(Role r, Node x, DependencySet ds)
           
 void addType(aterm.ATermAppl c, DependencySet ds)
           
 boolean canApply(int type)
           
 boolean checkMaxClash(aterm.ATermAppl normalizedMax, DependencySet maxDepends)
           
 boolean checkMinClash(aterm.ATermAppl minCard, DependencySet minDepends)
           
 Node copyTo(ABox 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, aterm.ATermAppl c)
           
 DependencySet getNodeDepends()
           
 int getNominalLevel()
           
 void getObviousTypes(java.util.List<aterm.ATermAppl> types, java.util.List<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)
          Get neighbor edges to a specific node
 java.util.Set<Node> getRNeighbors(Role r)
           
 EdgeList getRPredecessorEdges(Role r)
           
 EdgeList getRSuccessorEdges(Role r)
           
 java.util.Set<Node> getRSuccessors(Role r, aterm.ATermAppl c)
           
 Individual getSame()
           
 aterm.ATermAppl getTerm()
           
 java.util.List<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, 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, aterm.ATermAppl c)
           
 boolean hasDistinctRNeighborsForMin(Role r, int n, 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 hasRNeighbor(Role r, Node x)
           
 boolean hasRSuccessor(Role r)
           
 boolean hasRSuccessor(Role r, Node x)
           
 boolean hasSuccessor(Node x)
           
 boolean isBlockable()
           
 boolean isBlocked()
           
 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(aterm.ATermAppl maxCard)
           
 boolean isRedundantMin(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(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)
           
 void setNominalLevel(int level)
           
 void unprune(int branch)
           
 
Methods inherited from class org.mindswap.pellet.Node
getABox, getAllMerged, getDepends, getDepends, getInEdges, getMerged, getMergeDependency, getMergedTo, getName, getNameStr, getPath, getPruned, getTypes, hasObviousType, hasObviousType, hasType, inheritDifferents, isBnode, isConceptRoot, isMerged, isNamedIndividual, isPruned, isRoot, isRootNominal, isSame, mergedAt, prunedAt, removeInEdge, removeInEdges, removeTypes, restorePruned, setChanged, setConceptRoot, setDifferent, setSame, toString, undoSetSame
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mindswap.pellet.tableau.cache.CachedNode
getDepends, getInEdges, getName, isNamedIndividual
 

Field Detail

applyNext

public int[] applyNext
Method Detail

isBlocked

public boolean isBlocked()

setBlocked

public void setBlocked(boolean isBlocked)

getDepth

public short getDepth()

getNodeDepends

public DependencySet getNodeDepends()
Specified by:
getNodeDepends in class Node

isLiteral

public boolean isLiteral()
Specified by:
isLiteral in class Node

isIndividual

public boolean isIndividual()
Specified by:
isIndividual in class Node

isNominal

public boolean isNominal()
Specified by:
isNominal in class Node

isBlockable

public boolean isBlockable()
Specified by:
isBlockable in class Node

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 interface CachedNode
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 class Node

getTerm

public aterm.ATermAppl getTerm()
Specified by:
getTerm in class Node

copyTo

public Node copyTo(ABox abox)
Specified by:
copyTo in class Node

getTypes

public java.util.List<aterm.ATermAppl> getTypes(int type)

isDifferent

public boolean isDifferent(Node node)
Overrides:
isDifferent in class Node

getDifferents

public java.util.Set<Node> getDifferents()
Overrides:
getDifferents in class Node

getDifferenceDependency

public DependencySet getDifferenceDependency(Node node)
Overrides:
getDifferenceDependency in class Node

getObviousTypes

public void getObviousTypes(java.util.List<aterm.ATermAppl> types,
                            java.util.List<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 types
nonTypes - All atomic concepts

canApply

public boolean canApply(int type)

addType

public void addType(aterm.ATermAppl c,
                    DependencySet ds)
Overrides:
addType in class Node

checkMinClash

public boolean checkMinClash(aterm.ATermAppl minCard,
                             DependencySet minDepends)

checkMaxClash

public boolean checkMaxClash(aterm.ATermAppl normalizedMax,
                             DependencySet maxDepends)

isRedundantMin

public boolean isRedundantMin(aterm.ATermAppl minCard)

isRedundantMax

public boolean isRedundantMax(aterm.ATermAppl maxCard)

hasMax1

public DependencySet hasMax1(Role r)

getMaxCard

public int getMaxCard(Role r)

getMinCard

public int getMinCard(Role r,
                      aterm.ATermAppl c)

removeType

public boolean removeType(aterm.ATermAppl c)
Overrides:
removeType in class Node

isLeaf

public final boolean isLeaf()
Specified by:
isLeaf in class Node

getSame

public final Individual getSame()
Overrides:
getSame in class Node

getRSuccessors

public final java.util.Set<Node> getRSuccessors(Role r,
                                                aterm.ATermAppl c)

getRSuccessorEdges

public final EdgeList getRSuccessorEdges(Role r)

getRPredecessorEdges

public final EdgeList getRPredecessorEdges(Role r)

getRNeighbors

public final java.util.Set<Node> getRNeighbors(Role r)

getRNeighborEdges

public EdgeList getRNeighborEdges(Role r)

getRNeighborEdges

public EdgeList getRNeighborEdges(Role r,
                                  Node node)
Get neighbor edges to a specific node

Parameters:
r -
node -
Returns:

getEdgesTo

public EdgeList getEdgesTo(Node x)

getEdgesTo

public EdgeList getEdgesTo(Node x,
                           Role r)

hasDistinctRNeighborsForMax

public DependencySet hasDistinctRNeighborsForMax(Role r,
                                                 int n,
                                                 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 neighbors
n - Number of neighbors
c - 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,
                                           aterm.ATermAppl c)

hasDistinctRNeighborsForMin

public boolean hasDistinctRNeighborsForMin(Role r,
                                           int n,
                                           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 -
onlyNominals -
Returns:

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 interface CachedNode
Returns:
Outgoing edges of this node

hasRSuccessor

public boolean hasRSuccessor(Role r)

hasSuccessor

public boolean hasSuccessor(Node x)
Specified by:
hasSuccessor in class Node

hasRSuccessor

public final boolean hasRSuccessor(Role r,
                                   Node x)

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

hasRNeighbor

public boolean hasRNeighbor(Role r,
                            Node x)

addEdge

public Edge addEdge(Role r,
                    Node x,
                    DependencySet ds)

getOutEdges

public final EdgeList getOutEdges()
Description copied from interface: CachedNode
Returns the outgoing edges of this node.

Specified by:
getOutEdges in interface CachedNode
Returns:
Outgoing edges of this node

getParent

public Individual getParent()

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

Overrides:
reset in class Node

restore

public boolean restore(int branch)
Overrides:
restore in class Node

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

Specified by:
prune in class Node
Parameters:
succ -
ds -

unprune

public void unprune(int branch)
Overrides:
unprune in class Node

debugString

public java.lang.String debugString()

isBottom

public boolean isBottom()
Returns if this is the cached node for TOP concept.

Specified by:
isBottom in interface CachedNode
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 interface CachedNode
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 interface CachedNode
Returns:
true if this is the cached node for BOTTOM concept


Copyright © 2004 Evren Sirin. All Rights Reserved.