public TestProperty(final ATermAppl p, final AtomIObject arg1, final S arg2) { super(arg1, arg2); _role = _abox.getRole(p); if (_role == null) throw new InternalReasonerException("Cannot retreive role!: " + p); }
public TestProperty(final ATermAppl p, final AtomIObject arg1, final S arg2) { super(arg1, arg2); _role = _abox.getRole(p); if (_role == null) throw new InternalReasonerException("Cannot retreive role!: " + p); }
private Role getRole() { if (_role == null) _role = _abox.getRole(_pattern.getPredicate()); return _role; }
private Role getRole() { if (_role == null) _role = _abox.getRole(_pattern.getPredicate()); return _role; }
@Override public void visit(final IndividualPropertyAtom atom) { result = _abox.getRole(atom.getPredicate()).isSimple(); }
@Override public void visit(final IndividualPropertyAtom atom) { result = _abox.getRole(atom.getPredicate()).isSimple(); }
public int getMinCard(final Role r, final ATermAppl c) { int maxOfMins = 0; for (final ATermAppl minCard : _types[MIN]) { final Role minR = _abox.getRole(minCard.getArgument(0)); final int min = ((ATermInt) minCard.getArgument(1)).getInt(); final ATermAppl minC = (ATermAppl) minCard.getArgument(2); if (minR.isSubRoleOf(r) && maxOfMins < min && (minC.equals(c) || c.equals(TOP))) maxOfMins = min; } return maxOfMins; }
public int getMinCard(final Role r, final ATermAppl c) { int maxOfMins = 0; for (final ATermAppl minCard : _types[MIN]) { final Role minR = _abox.getRole(minCard.getArgument(0)); final int min = ((ATermInt) minCard.getArgument(1)).getInt(); final ATermAppl minC = (ATermAppl) minCard.getArgument(2); if (minR.isSubRoleOf(r) && maxOfMins < min && (minC.equals(c) || c.equals(TOP))) maxOfMins = min; } return maxOfMins; }
public boolean isRedundantMin(final ATermAppl minCard) { final Role minR = _abox.getRole(minCard.getArgument(0)); if (minR == null) return false; final int min = ((ATermInt) minCard.getArgument(1)).getInt(); final ATermAppl minQ = (ATermAppl) minCard.getArgument(2); for (final ATermAppl prevMinCard : _types[MIN]) { final Role prevMinR = _abox.getRole(prevMinCard.getArgument(0)); if (prevMinR == null) continue; final int prevMin = ((ATermInt) prevMinCard.getArgument(1)).getInt() - 1; final ATermAppl prevMinQ = (ATermAppl) prevMinCard.getArgument(2); if (min <= prevMin && prevMinR.isSubRoleOf(minR) && (minQ.equals(prevMinQ) || ATermUtils.isTop(minQ))) return true; } return false; }
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)); } }
@Override public void visit(final IndividualPropertyAtom atom) { final NodeProvider s = _translator.translateObject(atom.getArgument1()); final NodeProvider o = _translator.translateObject(atom.getArgument2()); final Role r = _abox.getRole(atom.getPredicate()); _node = new ProductionNode.Edge(_strategy, _explain, s, r, o); }
@Override public void visit(final DatavaluedPropertyAtom atom) { final NodeProvider s = _translator.translateObject(atom.getArgument1()); final NodeProvider o = _translator.translateObject(atom.getArgument2()); final Role r = _abox.getRole(atom.getPredicate()); _node = new ProductionNode.Edge(_strategy, _explain, s, r, o); }
@Override public void visit(final DatavaluedPropertyAtom atom) { final NodeProvider s = _translator.translateObject(atom.getArgument1()); final NodeProvider o = _translator.translateObject(atom.getArgument2()); final Role r = _abox.getRole(atom.getPredicate()); _node = new ProductionNode.Edge(_strategy, _explain, s, r, o); }
@Override public void visit(final IndividualPropertyAtom atom) { final NodeProvider s = _translator.translateObject(atom.getArgument1()); final NodeProvider o = _translator.translateObject(atom.getArgument2()); final Role r = _abox.getRole(atom.getPredicate()); _node = new ProductionNode.Edge(_strategy, _explain, s, r, o); }
public int getMaxCard(final Role r) { int min = Integer.MAX_VALUE; for (final ATermAppl mc : _types[MAX]) { // max(r, n) is in normalized form not(min(p, n + 1)) final ATermAppl maxCard = (ATermAppl) mc.getArgument(0); final Role maxR = _abox.getRole(maxCard.getArgument(0)); final int max = ((ATermInt) maxCard.getArgument(1)).getInt() - 1; if (r.isSubRoleOf(maxR) && max < min) min = max; } if (r.isFunctional() && min > 1) min = 1; return min; }
public int getMaxCard(final Role r) { int min = Integer.MAX_VALUE; for (final ATermAppl mc : _types[MAX]) { // max(r, n) is in normalized form not(min(p, n + 1)) final ATermAppl maxCard = (ATermAppl) mc.getArgument(0); final Role maxR = _abox.getRole(maxCard.getArgument(0)); final int max = ((ATermInt) maxCard.getArgument(1)).getInt() - 1; if (r.isSubRoleOf(maxR) && max < min) min = max; } if (r.isFunctional() && min > 1) min = 1; return min; }
@Override public final void apply(final Individual node) { for (final ATermAppl c : new ArrayList<>(node.getTypes(Node.ATOM))) // 'applyAllValues' can change the underlying types of individual; so we make a copy to iterate { if (!OpenlletOptions.MAINTAIN_COMPLETION_QUEUE && null == node.getDepends(c)) continue; if (ATermUtils.isSelf(c)) { final ATermAppl predicate = (ATermAppl) c.getArgument(0); final Role role = _strategy.getABox().getRole(predicate); _logger.fine(() -> "SELF: " + node + "\trole:" + role + "\tdepends:" + node.getDepends(c) + "\tRSuccessor:" + node.hasRSuccessor(role, node)); _strategy.addEdge(node, role, node, node.getDepends(c)); if (_strategy.getABox().isClosed()) return; } } } }
public DependencySet hasMax1(final Role r) { for (final ATermAppl mc : _types[MAX]) { // max(r, n, c) is in normalized form not(min(p, n + 1)) final ATermAppl maxCard = (ATermAppl) mc.getArgument(0); final Role maxR = _abox.getRole(maxCard.getArgument(0)); final int max = ((ATermInt) maxCard.getArgument(1)).getInt() - 1; final ATermAppl maxQ = (ATermAppl) maxCard.getArgument(2); // FIXME returned dependency set might be wrong // if there are two _types max(r,1) and max(p,1) where r subproperty of p // then the dependency set what we return might be wrong if (max == 1 && r.isSubRoleOf(maxR) && ATermUtils.isTop(maxQ)) return getDepends(mc).union(r.getExplainSub(maxR.getName()), _abox.doExplanation()); } return null; }
public DependencySet hasMax1(final Role r) { for (final ATermAppl mc : _types[MAX]) { // max(r, n, c) is in normalized form not(min(p, n + 1)) final ATermAppl maxCard = (ATermAppl) mc.getArgument(0); final Role maxR = _abox.getRole(maxCard.getArgument(0)); final int max = ((ATermInt) maxCard.getArgument(1)).getInt() - 1; final ATermAppl maxQ = (ATermAppl) maxCard.getArgument(2); // FIXME returned dependency set might be wrong // if there are two _types max(r,1) and max(p,1) where r subproperty of p // then the dependency set what we return might be wrong if (max == 1 && r.isSubRoleOf(maxR) && ATermUtils.isTop(maxQ)) return getDepends(mc).union(r.getExplainSub(maxR.getName()), _abox.doExplanation()); } return null; }