private void collectComplexPropertyValues(final Individual subj, final Role role) { final Set<ATermAppl> knowns = new HashSet<>(); final Set<ATermAppl> unknowns = new HashSet<>(); subj.getABox().getObjectPropertyValues(subj.getName(), role, knowns, unknowns, false); for (final ATermAppl val : knowns) _outEdges.add(new CachedOutEdge(role, val, DependencySet.INDEPENDENT)); for (final ATermAppl val : unknowns) _outEdges.add(new CachedOutEdge(role, val, DependencySet.DUMMY)); }
private void collectComplexPropertyValues(final Individual subj, final Role role) { final Set<ATermAppl> knowns = new HashSet<>(); final Set<ATermAppl> unknowns = new HashSet<>(); subj.getABox().getObjectPropertyValues(subj.getName(), role, knowns, unknowns, false); for (final ATermAppl val : knowns) _outEdges.add(new CachedOutEdge(role, val, DependencySet.INDEPENDENT)); for (final ATermAppl val : unknowns) _outEdges.add(new CachedOutEdge(role, val, DependencySet.DUMMY)); }
public boolean isDirectlyBlocked(final Individual blocked) { final Optional<Timer> timer = blocked.getABox().getKB().getTimers().startTimer("dBlocking"); try { return isDirectlyBlockedInt(blocked); } finally { timer.ifPresent(t -> t.stop()); } }
public boolean isDirectlyBlocked(final Individual blocked) { final Optional<Timer> timer = blocked.getABox().getKB().getTimers().startTimer("dBlocking"); try { return isDirectlyBlockedInt(blocked); } finally { timer.ifPresent(t -> t.stop()); } }
public boolean isBlocked(final Individual blocked) { final Optional<Timer> timer = blocked.getABox().getKB().getTimers().startTimer("blocking"); try { return !blocked.isRoot() && (isIndirectlyBlocked(blocked) || isDirectlyBlockedInt(blocked)); } finally { timer.ifPresent(t -> t.stop()); } }
public boolean isBlocked(final Individual blocked) { final Optional<Timer> timer = blocked.getABox().getKB().getTimers().startTimer("blocking"); try { return !blocked.isRoot() && (isIndirectlyBlocked(blocked) || isDirectlyBlockedInt(blocked)); } finally { timer.ifPresent(t -> t.stop()); } }
private static boolean isBlockedByChain(final BlockingContext cxt, final ATermList chain, final ATermAppl c) { final Role firstRole = cxt._blocked.getABox().getRole(chain.getFirst()); return !cxt.getIncomingRoles().contains(firstRole.getInverse()) && cxt._blocked.getParent().hasType(ATermUtils.makeAllValues(chain.getNext(), c)); } }
private static boolean isBlockedByChain(final BlockingContext cxt, final ATermList chain, final ATermAppl c) { final Role firstRole = cxt._blocked.getABox().getRole(chain.getFirst()); return !cxt.getIncomingRoles().contains(firstRole.getInverse()) && cxt._blocked.getParent().hasType(ATermUtils.makeAllValues(chain.getNext(), c)); } }
/** * @param name * @param nodeParam */ public CachedConceptNode(final ATermAppl name, final Individual nodeParam) { _name = name; Individual node = nodeParam; // if the _node is merged, get the representative _node and check // also if the merge depends on a _branch _isIndependent = node.getMergeDependency(true).isIndependent(); node = node.getSame(); _outEdges = copyEdgeList(node, true); _inEdges = copyEdgeList(node, false); // collect all transitive property values if (node.getABox().getKB().getExpressivity().hasNominal()) collectComplexPropertyValues(node); _types = CollectionUtils.makeIdentityMap(node.getDepends()); for (final Map.Entry<ATermAppl, DependencySet> e : _types.entrySet()) e.setValue(e.getValue().cache()); }
/** * @param name * @param nodeParam */ public CachedConceptNode(final ATermAppl name, final Individual nodeParam) { _name = name; Individual node = nodeParam; // if the _node is merged, get the representative _node and check // also if the merge depends on a _branch _isIndependent = node.getMergeDependency(true).isIndependent(); node = node.getSame(); _outEdges = copyEdgeList(node, true); _inEdges = copyEdgeList(node, false); // collect all transitive property values if (node.getABox().getKB().getExpressivity().hasNominal()) collectComplexPropertyValues(node); _types = CollectionUtils.makeIdentityMap(node.getDepends()); for (final Map.Entry<ATermAppl, DependencySet> e : _types.entrySet()) e.setValue(e.getValue().cache()); }
/** * {@inheritDoc} */ @Override public boolean isSafe(final ATermAppl c, final Individual ind) { final Edge parentEdge = getParentEdge(ind); final Role r = parentEdge.getRole(); final Individual parent = parentEdge.getFrom(); final ABox abox = parent.getABox(); if (!isParentSafe(abox.getKB(), r, parent)) return false; final Iterator<CachedNode> nodes = getCachedNodes(abox, c); if (!nodes.hasNext()) return false; if (interactsWithInverses(abox.getKB(), r)) while (nodes.hasNext()) { final CachedNode node = nodes.next(); if (node.isBottom()) return true; else if (node.isTop() || !node.isComplete()) return false; if (!isSafe(abox.getKB(), parent, r.getInverse(), node)) return false; } return true; }
/** * {@inheritDoc} */ @Override public boolean isSafe(final ATermAppl c, final Individual ind) { final Edge parentEdge = getParentEdge(ind); final Role r = parentEdge.getRole(); final Individual parent = parentEdge.getFrom(); final ABox abox = parent.getABox(); if (!isParentSafe(abox.getKB(), r, parent)) return false; final Iterator<CachedNode> nodes = getCachedNodes(abox, c); if (!nodes.hasNext()) return false; if (interactsWithInverses(abox.getKB(), r)) while (nodes.hasNext()) { final CachedNode node = nodes.next(); if (node.isBottom()) return true; else if (node.isTop() || !node.isComplete()) return false; if (!isSafe(abox.getKB(), parent, r.getInverse(), node)) return false; } return true; }
private static boolean block4(final BlockingContext cxt, final ATermAppl term) { final Role t = cxt._blocked.getABox().getRole(term.getArgument(0)); final int m; final ATermAppl c; if (ATermUtils.isMin(term)) { c = (ATermAppl) term.getArgument(2); m = ((ATermInt) term.getArgument(1)).getInt(); } else { c = ATermUtils.negate((ATermAppl) term.getArgument(1)); m = 1; } if (t.isDatatypeRole()) return true; if (cxt.isRSuccessor(t.getInverse()) && cxt._blocked.getParent().hasType(c)) return true; return cxt._blocker.getRSuccessors(t, c).size() >= m; } }
private static boolean block4(final BlockingContext cxt, final ATermAppl term) { final Role t = cxt._blocked.getABox().getRole(term.getArgument(0)); final int m; final ATermAppl c; if (ATermUtils.isMin(term)) { c = (ATermAppl) term.getArgument(2); m = ((ATermInt) term.getArgument(1)).getInt(); } else { c = ATermUtils.negate((ATermAppl) term.getArgument(1)); m = 1; } if (t.isDatatypeRole()) return true; if (cxt.isRSuccessor(t.getInverse()) && cxt._blocked.getParent().hasType(c)) return true; return cxt._blocker.getRSuccessors(t, c).size() >= m; } }
final Role s = cxt._blocked.getABox().getRole(p);
final Role s = cxt._blocked.getABox().getRole(p);