public default boolean doExplanation() { return getABox().doExplanation(); }
public default boolean doExplanation() { return getABox().doExplanation(); }
public void inheritDifferents(final Node y, final DependencySet ds) { for (final Map.Entry<Node, DependencySet> entry : y._differents.entrySet()) { final Node yDiff = entry.getKey(); final DependencySet finalDS = ds.union(entry.getValue(), _abox.doExplanation()); setDifferent(yDiff, finalDS); } }
public void inheritDifferents(final Node y, final DependencySet ds) { for (final Map.Entry<Node, DependencySet> entry : y._differents.entrySet()) { final Node yDiff = entry.getKey(); final DependencySet finalDS = ds.union(entry.getValue(), _abox.doExplanation()); setDifferent(yDiff, finalDS); } }
public void addAllTypes(final Map<ATermAppl, DependencySet> types, final DependencySet ds) { for (final Entry<ATermAppl, DependencySet> entry : types.entrySet()) { final ATermAppl c = entry.getKey(); if (hasType(c)) continue; final DependencySet depends = entry.getValue(); super.addType(c, depends.union(ds, _abox.doExplanation())); } checkClash(); }
public void addAllTypes(final Map<ATermAppl, DependencySet> types, final DependencySet ds) { for (final Entry<ATermAppl, DependencySet> entry : types.entrySet()) { final ATermAppl c = entry.getKey(); if (hasType(c)) continue; final DependencySet depends = entry.getValue(); super.addType(c, depends.union(ds, _abox.doExplanation())); } checkClash(); }
protected void resetDependencySet(final Token token) { final boolean doExplanation = _strategy.getABox().doExplanation(); _ds = token.getDepends(doExplanation); if (doExplanation) _ds = _ds.union(_explain, doExplanation); }
protected void resetDependencySet(final Token token) { final boolean doExplanation = _strategy.getABox().doExplanation(); _ds = token.getDepends(doExplanation); if (doExplanation) _ds = _ds.union(_explain, doExplanation); }
/** * Get the dependency if this node is merged to another node. This node may be merged to another node which is later merged to another node and so on. This * function may return the dependency for the first step or the union of all steps. * * @param all * @return the dependency set resulting of the merge */ public DependencySet getMergeDependency(final boolean all) { if (!isMerged() || !all) return _mergeDepends; DependencySet ds = _mergeDepends; Node node = _mergedTo; while (node.isMerged()) { ds = ds.union(node._mergeDepends, _abox.doExplanation()); node = node._mergedTo; } return ds; }
public void setLastClash(final DependencySet ds) { if (getTryNext() >= 0) { _combinedClash = _combinedClash.union(ds, _abox.doExplanation()); if (OpenlletOptions.USE_INCREMENTAL_DELETION) //CHW - added for incremental deletions support THIS SHOULD BE MOVED TO SUPER _abox.getKB().getDependencyIndex().addCloseBranchDependency(this, ds); } }
public void setLastClash(final DependencySet ds) { if (getTryNext() >= 0) { _combinedClash = _combinedClash.union(ds, _abox.doExplanation()); if (OpenlletOptions.USE_INCREMENTAL_DELETION) //CHW - added for incremental deletions support THIS SHOULD BE MOVED TO SUPER _abox.getKB().getDependencyIndex().addCloseBranchDependency(this, ds); } }
protected Node getNode(final NodeProvider provider, final Token token) { Node node = provider.getNode(null, token); if (node.isMerged()) { final boolean doExplanation = _strategy.getABox().doExplanation(); _ds = _ds.union(node.getMergeDependency(true), doExplanation); node = node.getSame(); } return node; }
protected Node getNode(final NodeProvider provider, final Token token) { Node node = provider.getNode(null, token); if (node.isMerged()) { final boolean doExplanation = _strategy.getABox().doExplanation(); _ds = _ds.union(node.getMergeDependency(true), doExplanation); node = node.getSame(); } return node; }
private void applyDisjointness(final Individual subj, final Role pred, final Node obj, final DependencySet dsParam) { DependencySet ds = dsParam; // TODO what about inv edges? // TODO improve this check final Set<Role> disjoints = pred.getDisjointRoles(); if (disjoints.isEmpty()) return; final EdgeList edges = subj.getEdgesTo(obj); for (int i = 0, n = edges.size(); i < n; i++) { final Edge otherEdge = edges.get(i); if (disjoints.contains(otherEdge.getRole())) { ds = ds.union(otherEdge.getDepends(), _abox.doExplanation()); ds = ds.union(pred.getExplainDisjointRole(otherEdge.getRole()), _abox.doExplanation()); _abox.setClash(Clash.disjointProps(subj, ds, pred.getName(), otherEdge.getRole().getName())); return; } } }
public boolean setSame(final Node node, final DependencySet ds) { if (isSame(node)) return false; if (isDifferent(node)) { //CHW - added for incremental reasoning support - this is needed as we will need to backjump if possible if (OpenlletOptions.USE_INCREMENTAL_CONSISTENCY) _abox.setClash(Clash.nominal(this, ds.union(_mergeDepends, _abox.doExplanation()).union(node._mergeDepends, _abox.doExplanation()), node.getName())); else _abox.setClash(Clash.nominal(this, ds, node.getName())); return false; } _mergedTo = node; _mergeDepends = ds.copy(_abox.getBranchIndex()); node.addMerged(this); return true; }
public boolean setSame(final Node node, final DependencySet ds) { if (isSame(node)) return false; if (isDifferent(node)) { //CHW - added for incremental reasoning support - this is needed as we will need to backjump if possible if (OpenlletOptions.USE_INCREMENTAL_CONSISTENCY) _abox.setClash(Clash.nominal(this, ds.union(_mergeDepends, _abox.doExplanation()).union(node._mergeDepends, _abox.doExplanation()), node.getName())); else _abox.setClash(Clash.nominal(this, ds, node.getName())); return false; } _mergedTo = node; _mergeDepends = ds.copy(_abox.getBranchIndex()); node.addMerged(this); return true; }
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; }
protected boolean applyAllValuesPropertyChain(final Individual x, final ATermList chain, final ATermAppl c, final DependencySet ds) { final Role r = _strategy.getABox().getRole(chain.getFirst()); final EdgeList edges = x.getRNeighborEdges(r); if (!edges.isEmpty()) { final ATermAppl allRC = ATermUtils.makeAllValues(chain.getNext(), c); for (int e = 0; e < edges.size(); e++) { final Edge edgeToY = edges.get(e); final Node y = edgeToY.getNeighbor(x); final DependencySet finalDS = ds.union(edgeToY.getDepends(), _strategy.getABox().doExplanation()); applyAllValues(x, r, y, allRC, finalDS); if (x.isMerged() || _strategy.getABox().isClosed()) return false; } } return true; }
protected boolean applyAllValuesPropertyChain(final Individual x, final ATermList chain, final ATermAppl c, final DependencySet ds) { final Role r = _strategy.getABox().getRole(chain.getFirst()); final EdgeList edges = x.getRNeighborEdges(r); if (!edges.isEmpty()) { final ATermAppl allRC = ATermUtils.makeAllValues(chain.getNext(), c); for (int e = 0; e < edges.size(); e++) { final Edge edgeToY = edges.get(e); final Node y = edgeToY.getNeighbor(x); final DependencySet finalDS = ds.union(edgeToY.getDepends(), _strategy.getABox().doExplanation()); applyAllValues(x, r, y, allRC, finalDS); if (x.isMerged() || _strategy.getABox().isClosed()) return false; } } return true; }