/** * Validate all the edges in the ABox nodes. Used to find bugs in the copy and detach/attach functions. */ @Override public void validate() { if (!OpenlletOptions.VALIDATE_ABOX) return; System.out.print("VALIDATING..."); final Iterator<Individual> n = getIndIterator(); while (n.hasNext()) { final Individual node = n.next(); if (node.isPruned()) continue; validate(node); } }
/** * Validate all the edges in the ABox nodes. Used to find bugs in the copy and detach/attach functions. */ @Override public void validate() { if (!OpenlletOptions.VALIDATE_ABOX) return; System.out.print("VALIDATING..."); final Iterator<Individual> n = getIndIterator(); while (n.hasNext()) { final Individual node = n.next(); if (node.isPruned()) continue; validate(node); } }
private Individual(final Individual ind, final ABoxImpl abox) { super(ind, abox); _nominalLevel = ind._nominalLevel; _parent = ind._parent; for (int i = 0; i < TYPES; i++) { _types[i] = new ArrayList<>(ind._types[i]); _applyNext[i] = ind._applyNext[i]; } if (isPruned()) _outEdges = new EdgeList(ind._outEdges); else _outEdges = new EdgeList(ind._outEdges.size()); _depth = 0; }
private Individual(final Individual ind, final ABoxImpl abox) { super(ind, abox); _nominalLevel = ind._nominalLevel; _parent = ind._parent; for (int i = 0; i < TYPES; i++) { _types[i] = new ArrayList<>(ind._types[i]); _applyNext[i] = ind._applyNext[i]; } if (isPruned()) _outEdges = new EdgeList(ind._outEdges); else _outEdges = new EdgeList(ind._outEdges.size()); _depth = 0; }
@Override public void apply(final Individual x) { if (!x.canApply(Node.SOME)) return; final List<ATermAppl> types = x.getTypes(Node.SOME); final int size = types.size(); for (int j = x._applyNext[Node.SOME]; j < size; j++) { final ATermAppl sv = types.get(j); applySomeValuesRule(x, sv); if (_strategy.getABox().isClosed() || x.isPruned()) return; } x._applyNext[Node.SOME] = size; }
@Override public void apply(final Individual x) { if (!x.canApply(Node.SOME)) return; final List<ATermAppl> types = x.getTypes(Node.SOME); final int size = types.size(); for (int j = x._applyNext[Node.SOME]; j < size; j++) { final ATermAppl sv = types.get(j); applySomeValuesRule(x, sv); if (_strategy.getABox().isClosed() || x.isPruned()) return; } x._applyNext[Node.SOME] = size; }
public boolean activateIndividual(final Individual ind) { // only named non-pruned individuals final boolean changed = false; if (!ind.isRootNominal() || ind.isPruned()) return false; final List<ATermAppl> types = ind.getTypes(Node.ATOM); for (int i = 0; i < types.size(); i++) { final ATermAppl type = types.get(i); activateType(ind, type, ind.getDepends(type)); } activateDifferents(ind); for (final Edge edge : new ArrayList<>(ind.getOutEdges())) if (edge.getTo().isRootNominal()) activateEdge(edge); return changed; }
public boolean activateIndividual(final Individual ind) { // only named non-pruned individuals final boolean changed = false; if (!ind.isRootNominal() || ind.isPruned()) return false; final List<ATermAppl> types = ind.getTypes(Node.ATOM); for (int i = 0; i < types.size(); i++) { final ATermAppl type = types.get(i); activateType(ind, type, ind.getDepends(type)); } activateDifferents(ind); for (final Edge edge : new ArrayList<>(ind.getOutEdges())) if (edge.getTo().isRootNominal()) activateEdge(edge); return changed; }
public void applyDomainRange(final Individual subj, final Role pred, final Node obj, final DependencySet ds) { final Set<ATermAppl> domains = pred.getDomains(); final Set<ATermAppl> ranges = pred.getRanges(); for (final ATermAppl domain : domains) { if (_logger.isLoggable(Level.FINE) && !subj.hasType(domain)) _logger.fine("DOM : " + obj + " <- " + pred + " <- " + subj + " : " + ATermUtils.toString(domain)); addType(subj, domain, ds.union(pred.getExplainDomain(domain), _abox.doExplanation())); if (subj.isPruned() || obj.isPruned()) return; } for (final ATermAppl range : ranges) { if (_logger.isLoggable(Level.FINE) && !obj.hasType(range)) _logger.fine("RAN : " + subj + " -> " + pred + " -> " + obj + " : " + ATermUtils.toString(range)); addType(obj, range, ds.union(pred.getExplainRange(range), _abox.doExplanation())); if (subj.isPruned() || obj.isPruned()) return; } }
if (node.isPruned()) throw new InternalReasonerException("Pruned node: " + node);
public void applyDomainRange(final Individual subj, final Role pred, final Node obj, final DependencySet ds) { final Set<ATermAppl> domains = pred.getDomains(); final Set<ATermAppl> ranges = pred.getRanges(); for (final ATermAppl domain : domains) { if (_logger.isLoggable(Level.FINE) && !subj.hasType(domain)) _logger.fine("DOM : " + obj + " <- " + pred + " <- " + subj + " : " + ATermUtils.toString(domain)); addType(subj, domain, ds.union(pred.getExplainDomain(domain), _abox.doExplanation())); if (subj.isPruned() || obj.isPruned()) return; } for (final ATermAppl range : ranges) { if (_logger.isLoggable(Level.FINE) && !obj.hasType(range)) _logger.fine("RAN : " + subj + " -> " + pred + " -> " + obj + " : " + ATermUtils.toString(range)); addType(obj, range, ds.union(pred.getExplainRange(range), _abox.doExplanation())); if (subj.isPruned() || obj.isPruned()) return; } }
public void applyPropertyRestrictions(final Individual subj, final Role pred, final Node obj, final DependencySet ds) { applyDomainRange(subj, pred, obj, ds); if (subj.isPruned() || obj.isPruned()) return; applyFunctionality(subj, pred, obj); if (subj.isPruned() || obj.isPruned()) return; applyDisjointness(subj, pred, obj, ds); _allValuesRule.applyAllValues(subj, pred, obj, ds); if (subj.isPruned() || obj.isPruned()) return; if (pred.isObjectRole()) { final Individual o = (Individual) obj; _allValuesRule.applyAllValues(o, pred.getInverse(), subj, ds); checkReflexivitySymmetry(subj, pred, o, ds); checkReflexivitySymmetry(o, pred.getInverse(), subj, ds); applyDisjointness(o, pred.getInverse(), subj, ds); } }
public void applyPropertyRestrictions(final Individual subj, final Role pred, final Node obj, final DependencySet ds) { applyDomainRange(subj, pred, obj, ds); if (subj.isPruned() || obj.isPruned()) return; applyFunctionality(subj, pred, obj); if (subj.isPruned() || obj.isPruned()) return; applyDisjointness(subj, pred, obj, ds); _allValuesRule.applyAllValues(subj, pred, obj, ds); if (subj.isPruned() || obj.isPruned()) return; if (pred.isObjectRole()) { final Individual o = (Individual) obj; _allValuesRule.applyAllValues(o, pred.getInverse(), subj, ds); checkReflexivitySymmetry(subj, pred, o, ds); checkReflexivitySymmetry(o, pred.getInverse(), subj, ds); applyDisjointness(o, pred.getInverse(), subj, ds); } }
@Override protected void updateNodeReferences() { super.updateNodeReferences(); if (_parent != null) _parent = _abox.getIndividual(_parent.getName()); if (isPruned()) { final EdgeList oldEdges = _outEdges; _outEdges = new EdgeList(oldEdges.size()); for (int i = 0; i < oldEdges.size(); i++) { final Edge edge = oldEdges.get(i); final Node to = _abox.getNode(edge.getTo().getName()); final Edge newEdge = new DefaultEdge(edge.getRole(), this, to, edge.getDepends()); _outEdges.add(newEdge); } } }
@Override protected void updateNodeReferences() { super.updateNodeReferences(); if (_parent != null) _parent = _abox.getIndividual(_parent.getName()); if (isPruned()) { final EdgeList oldEdges = _outEdges; _outEdges = new EdgeList(oldEdges.size()); for (int i = 0; i < oldEdges.size(); i++) { final Edge edge = oldEdges.get(i); final Node to = _abox.getNode(edge.getTo().getName()); final Edge newEdge = new DefaultEdge(edge.getRole(), this, to, edge.getDepends()); _outEdges.add(newEdge); } } }
if (isPruned()) throw new InternalReasonerException("Adding edge to a pruned _node " + this + " " + r + " " + x + "\t" + _pruned); else
if (isPruned()) throw new InternalReasonerException("Adding edge to a pruned _node " + this + " " + r + " " + x + "\t" + _pruned); else
return edge; if (subj.isPruned()) return edge;
return edge; if (subj.isPruned()) return edge;