@Override public Iterator<WME> getInnerIterator(final Individual ind) { return toWMEs(ind.getEdgesTo(ind), EdgeDirection.FORWARD); } };
@Override public Iterator<WME> getInnerIterator(final Individual ind) { return toWMEs(ind.getEdgesTo(ind), EdgeDirection.FORWARD); } };
@Override public Iterator<WME> getMatches() { final Individual subject = initNode(); final Node object = initObjectNode(); final EdgeList edges = subject.getEdgesTo(object, _role); return toWMEs(edges, EdgeDirection.FORWARD); }
@Override public Iterator<WME> getMatches() { final Individual subject = initNode(); final Node object = initObjectNode(); final EdgeList edges = subject.getEdgesTo(object, _role); return toWMEs(edges, EdgeDirection.FORWARD); }
final EdgeList edges = node.getEdgesTo(succ);
final EdgeList edges = node.getEdgesTo(succ);
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; } } }
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; } } }
final EdgeList edges = subj.getEdgesTo(obj, role); for (int i = 0; i < edges.size(); i++)
final EdgeList edges = subj.getEdgesTo(obj, role); for (int i = 0; i < edges.size(); i++)
if (ds.max() > _branchIndex || ds.getBranch() > _branchIndex) throw new InternalReasonerException("Invalid ds: " + edge + " " + ds); final EdgeList allEdges = node.getEdgesTo(succ); if (allEdges.getRoles().size() != allEdges.size()) throw new InternalReasonerException("Duplicate edges: " + allEdges);
if (ds.max() > _branchIndex || ds.getBranch() > _branchIndex) throw new InternalReasonerException("Invalid ds: " + edge + " " + ds); final EdgeList allEdges = node.getEdgesTo(succ); if (allEdges.getRoles().size() != allEdges.size()) throw new InternalReasonerException("Duplicate edges: " + allEdges);
public void checkReflexivitySymmetry(final Individual subj, final Role pred, final Individual obj, final DependencySet dsParam) { DependencySet ds = dsParam; if (pred.isAsymmetric() && obj.hasRSuccessor(pred, subj)) { final EdgeList edges = obj.getEdgesTo(subj, pred); ds = ds.union(edges.get(0).getDepends(), _abox.doExplanation()); if (OpenlletOptions.USE_TRACING) ds = ds.union(pred.getExplainAsymmetric(), _abox.doExplanation()); _abox.setClash(Clash.unexplained(subj, ds, "Antisymmetric property " + pred)); } else if (subj.equals(obj)) if (pred.isIrreflexive()) _abox.setClash(Clash.unexplained(subj, ds.union(pred.getExplainIrreflexive(), _abox.doExplanation()), "Irreflexive property " + pred)); else { final ATerm notSelfP = ATermUtils.makeNot(ATermUtils.makeSelf(pred.getName())); if (subj.hasType(notSelfP)) _abox.setClash(Clash.unexplained(subj, ds.union(subj.getDepends(notSelfP), _abox.doExplanation()), "Local irreflexive property " + pred)); } }
public void checkReflexivitySymmetry(final Individual subj, final Role pred, final Individual obj, final DependencySet dsParam) { DependencySet ds = dsParam; if (pred.isAsymmetric() && obj.hasRSuccessor(pred, subj)) { final EdgeList edges = obj.getEdgesTo(subj, pred); ds = ds.union(edges.get(0).getDepends(), _abox.doExplanation()); if (OpenlletOptions.USE_TRACING) ds = ds.union(pred.getExplainAsymmetric(), _abox.doExplanation()); _abox.setClash(Clash.unexplained(subj, ds, "Antisymmetric property " + pred)); } else if (subj.equals(obj)) if (pred.isIrreflexive()) _abox.setClash(Clash.unexplained(subj, ds.union(pred.getExplainIrreflexive(), _abox.doExplanation()), "Irreflexive property " + pred)); else { final ATerm notSelfP = ATermUtils.makeNot(ATermUtils.makeSelf(pred.getName())); if (subj.hasType(notSelfP)) _abox.setClash(Clash.unexplained(subj, ds.union(subj.getDepends(notSelfP), _abox.doExplanation()), "Local irreflexive property " + pred)); } }