@Override public boolean hasNext() { while (_next == null && _iterator.hasNext()) { final Node node = _iterator.next(); if (node.isLiteral() && node.isRootNominal()) _next = (Literal) node; } return _next != null; }
@Override public boolean hasNext() { while (_next == null && _iterator.hasNext()) { final Node node = _iterator.next(); if (node.isLiteral() && node.isRootNominal()) _next = (Literal) node; } return _next != null; }
public static void printCounts(final ABox abox) { if (abox == null) { System.out.println("NO ABOX"); return; } int typeCount = 0; int edgeCount = 0; int literalCount = 0; for (final Node node : abox.getNodes().values()) if (node.isLiteral()) literalCount++; else { edgeCount += ((Individual) node).getOutEdges().size(); typeCount += node.getTypes().size(); } final int individualCount = abox.getNodes().size() - literalCount; System.out.println("Individuals : " + individualCount); System.out.println("Literals : " + literalCount); System.out.println("Types : " + typeCount); System.out.println("Edges : " + edgeCount); System.out.println(); }
private void restoreLocal(final Individual ind, final int branch, final Map<Node, Boolean> visited) { final boolean restored = ind.restore(branch); visited.put(ind, restored); if (restored) { for (final Edge edge : ind.getOutEdges()) { final Node succ = edge.getTo(); if (visited.containsKey(succ)) continue; if (succ.isLiteral()) { visited.put(succ, Boolean.FALSE); succ.restore(branch); } else restoreLocal((Individual) succ, branch, visited); } for (final Edge edge : ind.getInEdges()) { final Individual pred = edge.getFrom(); if (visited.containsKey(pred)) continue; restoreLocal(pred, branch, visited); } } }
private void restoreLocal(final Individual ind, final int branch, final Map<Node, Boolean> visited) { final boolean restored = ind.restore(branch); visited.put(ind, restored); if (restored) { for (final Edge edge : ind.getOutEdges()) { final Node succ = edge.getTo(); if (visited.containsKey(succ)) continue; if (succ.isLiteral()) { visited.put(succ, Boolean.FALSE); succ.restore(branch); } else restoreLocal((Individual) succ, branch, visited); } for (final Edge edge : ind.getInEdges()) { final Individual pred = edge.getFrom(); if (visited.containsKey(pred)) continue; restoreLocal(pred, branch, visited); } } }
/** * Sets the _blocker to the specified child of the _current _blocker and returns if the new _blocker candidate is allowed to block. The child is not allowed * to block if it is a literal, or a root, or pruned/merged, or is _blocked itself. * * @param child child of the _current _blocker * @return <code>true</code> if the new _blocker candidate is allowed to block */ public boolean moveBlockerDown(final Node child) { if (child.isLiteral() || child.isRoot() || child.isPruned() || child.isMerged() || ((Individual) child).isBlocked() || child.equals(_blocker)) return false; _blocker = (Individual) child; _rolesToBlocked = null; return true; }
/** * Find the next _individual in a given queue * * @param type */ @Override protected void findNext(final int type) { for (; _current < _cutOff; _current++) { Node node = _abox.getNode(_queue.get(_current)); //because we do not maitain the _queue during restore this _node could be non-existent if (node == null) continue; node = node.getSame(); if ((node.isLiteral() && isAllowLiterals() || node.isIndividual() && !isAllowLiterals()) && !node.isPruned()) break; } }
/** * Find the next _individual in a given queue * * @param type */ @Override protected void findNext(final int type) { for (; _current < _cutOff; _current++) { Node node = _abox.getNode(_queue.get(_current)); //because we do not maitain the _queue during restore this _node could be non-existent if (node == null) continue; node = node.getSame(); if ((node.isLiteral() && isAllowLiterals() || node.isIndividual() && !isAllowLiterals()) && !node.isPruned()) break; } }
/** * Sets the _blocker to the specified child of the _current _blocker and returns if the new _blocker candidate is allowed to block. The child is not allowed * to block if it is a literal, or a root, or pruned/merged, or is _blocked itself. * * @param child child of the _current _blocker * @return <code>true</code> if the new _blocker candidate is allowed to block */ public boolean moveBlockerDown(final Node child) { if (child.isLiteral() || child.isRoot() || child.isPruned() || child.isMerged() || ((Individual) child).isBlocked() || child.equals(_blocker)) return false; _blocker = (Individual) child; _rolesToBlocked = null; return true; }
if (!OpenlletOptions.HIDE_TOP_PROPERTY_VALUES) for (final Node node : getABox().getNodes().values()) if (node.isLiteral() && node.getTerm() != null) literals.add(node.getTerm()); return literals;
if (!OpenlletOptions.HIDE_TOP_PROPERTY_VALUES) for (final Node node : getABox().getNodes().values()) if (node.isLiteral() && node.getTerm() != null) literals.add(node.getTerm()); return literals;
if (n.isLiteral())
if (n.isLiteral())
if (node.isLiteral())
if (node.isLiteral())
if (node.isLiteral())
if (subj.isBlockable() && obj.isNominal() && !obj.isLiteral() && pred.isInverseFunctional())
if (subj.isBlockable() && obj.isNominal() && !obj.isLiteral() && pred.isInverseFunctional())