public Set<E> getEntitiesMinusBottom() { return getEntitiesMinus(getBottomEntity()); }
public Set<E> getEntitiesMinusTop() { return getEntitiesMinus(getTopEntity()); }
@Override public boolean isBottomNode() { if (!getBottomEntity().isPresent()) { return false; } return entities.contains(getBottomEntity().get()); }
@Override public boolean isTopNode() { if (!getTopEntity().isPresent()) { return false; } return entities.contains(getTopEntity().get()); }
public Node<T> getEquivalents(T element) { Node<T> node = cycles.get(element); if (node == null) { DefaultNode<T> newNode = createNode(); newNode.add(element); node = newNode; } return node; } }
private void addCycles(HashSet<Set<T>> forCycles) { for (Set<T> entity : forCycles) { DefaultNode<T> node = createNode(entity); for (T cls : entity) { cycles.put(cls, node); Set<T> rawSupers = new HashSet<T>(rawHierarchyProvider.getParents(cls)); rawSupers.removeAll(node.getEntities()); if (rawSupers.isEmpty()) { roots.add(cls); } } } roots.remove(topEntity); }
@Override public boolean isBottomNode() { if (!getBottomEntity().isPresent()) { return false; } return entities.contains(getBottomEntity().get()); }
@Override public boolean isTopNode() { if (!getTopEntity().isPresent()) { return false; } return entities.contains(getTopEntity().get()); }
@Override public Node<OWLNamedIndividual> asNode() { if (!isNode()) throw new OWLRuntimeException("Contains anonymous individuals. Conversion not possible. See isNode()"); DefaultNode<OWLNamedIndividual> node = NodeFactory.getOWLNamedIndividualNode(); for (OWLIndividual indi : this.individuals) node.add(indi.asOWLNamedIndividual()); return node; }
public Set<E> getEntitiesMinusBottom() { return getEntitiesMinus(getBottomEntity()); }
public Set<E> getEntitiesMinusTop() { return getEntitiesMinus(getTopEntity()); }
public boolean isBottomNode() { return entities.contains(getBottomEntity()); }
public boolean isTopNode() { return entities.contains(getTopEntity()); }
@Override public Node<OWLNamedIndividual> asNode() { if (!isNode()) throw new OWLRuntimeException("Contains anonymous individuals. Conversion not possible. See isNode()"); DefaultNode<OWLNamedIndividual> node = NodeFactory.getOWLNamedIndividualNode(); for (OWLIndividual indi : this.individuals) node.add(indi.asOWLNamedIndividual()); return node; } }
@Override public Set<E> getEntitiesMinusBottom() { Optional<E> bottomEntity = getBottomEntity(); if (bottomEntity.isPresent()) { return getEntitiesMinus(bottomEntity.get()); } return asUnorderedSet(entities.stream()); }
@Override public Set<E> getEntitiesMinusTop() { Optional<E> topEntity = getTopEntity(); if (topEntity.isPresent()) { return getEntitiesMinus(topEntity.get()); } return asUnorderedSet(entities.stream()); }
@Override public boolean isBottomNode() { if (!getBottomEntity().isPresent()) { return false; } return entities.contains(getBottomEntity().get()); }
@Override public boolean isTopNode() { if (!getTopEntity().isPresent()) { return false; } return entities.contains(getTopEntity().get()); }
@Override public Set<E> getEntitiesMinusBottom() { Optional<E> bottomEntity = getBottomEntity(); if (bottomEntity.isPresent()) { return getEntitiesMinus(bottomEntity.get()); } return asUnorderedSet(entities.stream()); }
@Override public Set<E> getEntitiesMinusTop() { Optional<E> topEntity = getTopEntity(); if (topEntity.isPresent()) { return getEntitiesMinus(topEntity.get()); } return asUnorderedSet(entities.stream()); }