boolean checkInverses) {
EdgeList edges = checkInverses
? cNode.getInEdges()
: cNode.getOutEdges();
for( Edge edge : edges ) {
Role role = checkInverses
? edge.getRole().getInverse()
: edge.getRole();
DependencySet ds = edge.getDepends();
if( !ds.isIndependent() )
continue;
boolean found = false;
ATermAppl val = checkInverses
? edge.getFromName()
: edge.getToName();
if( !role.isObjectRole() ) {
found = pNode.hasRNeighbor( role );
}
else if( !isRootNominal( kb, val ) ) {
if( !role.hasComplexSubRole() )
found = pNode.hasRNeighbor( role );
else {
TransitionGraph<Role> tg = role.getFSM();
Iterator<Transition<Role>> it = tg.getInitialState().getTransitions().iterator();
while( !found && it.hasNext() ) {
Transition<Role> tr = it.next();
found = pNode.hasRNeighbor( tr.getName() );
}
}
}
else {
Set<ATermAppl> neighbors = null;
if( role.isSimple() || !(pNode instanceof Individual) )
neighbors = getRNeighbors( pNode, role );
else {
neighbors = new HashSet<ATermAppl>();
kb.getABox().getObjectPropertyValues( pNode.getName(), role, neighbors,
neighbors, false );