@Override public boolean isTopSingleton() { return isSingleton() && nodes.iterator().next().isTopNode(); }
@Override public boolean isTopSingleton() { return isSingleton() && nodes.iterator().next().isTopNode(); }
@Override public boolean isTopSingleton() { return isSingleton() && nodes.iterator().next().isTopNode(); }
@Override public boolean isTopSingleton() { return isSingleton() && nodes.iterator().next().isTopNode(); }
public boolean isTopSingleton() { return isSingleton() && nodes.iterator().next().isTopNode(); }
public boolean isTopSingleton() { return isSingleton() && nodes.iterator().next().isTopNode(); }
private Set<OWLClass> getFirstClassesNoTopBottom(NodeSet<OWLClass> nodeSet) { Set<OWLClass> concepts = new HashSet<>(); for (Node<OWLClass> node : nodeSet) { if(!node.isBottomNode() && !node.isTopNode()){ concepts.add(node.getRepresentativeElement()); } } return concepts; }
private <T extends OWLObject> SortedSet<T> getRepresentativeEntities(NodeSet<T> nodeSet){ SortedSet<T> representatives = new TreeSet<>(); for (Node<T> node : nodeSet) { if(!node.isBottomNode() && !node.isTopNode()){ representatives.add(node.getRepresentativeElement()); } } return representatives; }
private TreeSet<OWLDataProperty> getFirstDatatypeProperties(NodeSet<OWLDataProperty> nodeSet) { TreeSet<OWLDataProperty> roles = new TreeSet<>(); for (Node<OWLDataProperty> node : nodeSet) { if (node.isBottomNode() || node.isTopNode()) { continue; } if(node.getSize() == 0){ logger.warn("Reasoner returned empty property node. Could be a bug."); continue; } OWLDataProperty property = node.getRepresentativeElement(); roles.add(property); } // we ignore top and bottom properties roles.remove(df.getOWLTopDataProperty()); roles.remove(df.getOWLBottomDataProperty()); return roles; }
private TreeSet<OWLObjectProperty> getFirstObjectProperties(NodeSet<OWLObjectPropertyExpression> nodeSet) { TreeSet<OWLObjectProperty> roles = new TreeSet<>(); for (Node<OWLObjectPropertyExpression> node : nodeSet) { if (node.isBottomNode() || node.isTopNode()) { continue; } if(node.getSize() == 0){ logger.warn("Reasoner returned empty property node. Could be a bug."); continue; } // take one element from the set and ignore the rest // (TODO: we need to make sure we always ignore the same concepts) OWLObjectPropertyExpression property = node.getRepresentativeElement(); if (!property.isAnonymous()) { roles.add(property.asOWLObjectProperty()); } } // we ignore top and bottom properties roles.remove(df.getOWLTopObjectProperty()); roles.remove(df.getOWLBottomObjectProperty()); return roles; }
public NodeSet<T> getNodeHierarchyChildren(T parent, boolean direct, DefaultNodeSet<T> ns) { Node<T> node = nodeCache.getNode(parent); if (node.isBottomNode()) { return ns; } Set<T> directChildren = new HashSet<>(); for (T equiv : node) { directChildren.addAll(rawParentChildProvider.getChildren(equiv)); if (directParentsOfBottomNode.contains(equiv)) { ns.addNode(nodeCache.getBottomNode()); } } node.entities().forEach(directChildren::remove); if (node.isTopNode()) { // Special treatment directChildren.addAll(directChildrenOfTopNode); } for (Node<T> childNode : nodeCache.getNodes(directChildren)) { ns.addNode(childNode); } if (!direct) { for (T child : directChildren) { getNodeHierarchyChildren(child, direct, ns); } } return ns; }
public NodeSet<T> getNodeHierarchyParents(T child, boolean direct, DefaultNodeSet<T> ns) { Node<T> node = nodeCache.getNode(child); if (node.isTopNode()) { return ns; } Set<T> directParents = new HashSet<>(); for (T equiv : node) { directParents.addAll(rawParentChildProvider.getParents(equiv)); if (directChildrenOfTopNode.contains(equiv)) { ns.addNode(nodeCache.getTopNode()); } } node.entities().forEach(directParents::remove); if (node.isBottomNode()) { // Special treatment directParents.addAll(directParentsOfBottomNode); } for (Node<T> parentNode : nodeCache.getNodes(directParents)) { ns.addNode(parentNode); } if (!direct) { for (T parent : directParents) { getNodeHierarchyParents(parent, direct, ns); } } return ns; }
public NodeSet<T> getNodeHierarchyParents(T child, boolean direct, DefaultNodeSet<T> ns) { Node<T> node = nodeCache.getNode(child); if (node.isTopNode()) { return ns; } Set<T> directParents = new HashSet<>(); for (T equiv : node) { directParents.addAll(rawParentChildProvider.getParents(equiv)); if (directChildrenOfTopNode.contains(equiv)) { ns.addNode(nodeCache.getTopNode()); } } node.entities().forEach(directParents::remove); if (node.isBottomNode()) { // Special treatment directParents.addAll(directParentsOfBottomNode); } for (Node<T> parentNode : nodeCache.getNodes(directParents)) { ns.addNode(parentNode); } if (!direct) { for (T parent : directParents) { getNodeHierarchyParents(parent, direct, ns); } } return ns; }
public NodeSet<T> getNodeHierarchyChildren(T parent, boolean direct, DefaultNodeSet<T> ns) { Node<T> node = nodeCache.getNode(parent); if (node.isBottomNode()) { return ns; } Set<T> directChildren = new HashSet<>(); for (T equiv : node) { directChildren.addAll(rawParentChildProvider.getChildren(equiv)); if(directParentsOfBottomNode.contains(equiv)) { ns.addNode(nodeCache.getBottomNode()); } } directChildren.removeAll(node.getEntities()); if (node.isTopNode()) { // Special treatment directChildren.addAll(directChildrenOfTopNode); } for (Node<T> childNode : nodeCache.getNodes(directChildren)) { ns.addNode(childNode); } if (!direct) { for (T child : directChildren) { getNodeHierarchyChildren(child, direct, ns); } } return ns; }
public NodeSet<T> getNodeHierarchyChildren(T parent, boolean direct, DefaultNodeSet<T> ns) { Node<T> node = nodeCache.getNode(parent); if (node.isBottomNode()) { return ns; } Set<T> directChildren = new HashSet<>(); for (T equiv : node) { directChildren.addAll(rawParentChildProvider.getChildren(equiv)); if (directParentsOfBottomNode.contains(equiv)) { ns.addNode(nodeCache.getBottomNode()); } } node.entities().forEach(directChildren::remove); if (node.isTopNode()) { // Special treatment directChildren.addAll(directChildrenOfTopNode); } for (Node<T> childNode : nodeCache.getNodes(directChildren)) { ns.addNode(childNode); } if (!direct) { for (T child : directChildren) { getNodeHierarchyChildren(child, direct, ns); } } return ns; }
public NodeSet<T> getNodeHierarchyChildren(T parent, boolean direct, DefaultNodeSet<T> ns) { Node<T> node = nodeCache.getNode(parent); if (node.isBottomNode()) { return ns; } Set<T> directChildren = new HashSet<>(); for (T equiv : node) { directChildren.addAll(rawParentChildProvider.getChildren(equiv)); if (directParentsOfBottomNode.contains(equiv)) { ns.addNode(nodeCache.getBottomNode()); } } node.entities().forEach(directChildren::remove); if (node.isTopNode()) { // Special treatment directChildren.addAll(directChildrenOfTopNode); } for (Node<T> childNode : nodeCache.getNodes(directChildren)) { ns.addNode(childNode); } if (!direct) { for (T child : directChildren) { getNodeHierarchyChildren(child, direct, ns); } } return ns; }
public NodeSet<T> getNodeHierarchyChildren(T parent, boolean direct, DefaultNodeSet<T> ns) { Node<T> node = nodeCache.getNode(parent); if (node.isBottomNode()) { return ns; } Set<T> directChildren = new HashSet<T>(); for (T equiv : node) { directChildren.addAll(rawParentChildProvider.getChildren(equiv)); if (directParentsOfBottomNode.contains(equiv)) { ns.addNode(nodeCache.getBottomNode()); } } directChildren.removeAll(node.getEntities()); if (node.isTopNode()) { // Special treatment directChildren.addAll(directChildrenOfTopNode); } for (Node<T> childNode : nodeCache.getNodes(directChildren)) { ns.addNode(childNode); } if (!direct) { for (T child : directChildren) { getNodeHierarchyChildren(child, direct, ns); } } return ns; }
public NodeSet<T> getNodeHierarchyParents(T child, boolean direct, DefaultNodeSet<T> ns) { Node<T> node = nodeCache.getNode(child); if (node.isTopNode()) { return ns; } Set<T> directParents = new HashSet<>(); for (T equiv : node) { directParents.addAll(rawParentChildProvider.getParents(equiv)); if (directChildrenOfTopNode.contains(equiv)) { ns.addNode(nodeCache.getTopNode()); } } node.entities().forEach(directParents::remove); if (node.isBottomNode()) { // Special treatment directParents.addAll(directParentsOfBottomNode); } for (Node<T> parentNode : nodeCache.getNodes(directParents)) { ns.addNode(parentNode); } if (!direct) { for (T parent : directParents) { getNodeHierarchyParents(parent, direct, ns); } } return ns; }
public NodeSet<T> getNodeHierarchyParents(T child, boolean direct, DefaultNodeSet<T> ns) { Node<T> node = nodeCache.getNode(child); if (node.isTopNode()) { return ns; } Set<T> directParents = new HashSet<>(); for (T equiv : node) { directParents.addAll(rawParentChildProvider.getParents(equiv)); if (directChildrenOfTopNode.contains(equiv)) { ns.addNode(nodeCache.getTopNode()); } } node.entities().forEach(directParents::remove); if (node.isBottomNode()) { // Special treatment directParents.addAll(directParentsOfBottomNode); } for (Node<T> parentNode : nodeCache.getNodes(directParents)) { ns.addNode(parentNode); } if (!direct) { for (T parent : directParents) { getNodeHierarchyParents(parent, direct, ns); } } return ns; }
public NodeSet<T> getNodeHierarchyChildren(T parent, boolean direct, DefaultNodeSet<T> ns) { Node<T> node = nodeCache.getNode(parent); if (node.isBottomNode()) { return ns; } Set<T> directChildren = new HashSet<T>(); for (T equiv : node) { directChildren.addAll(rawParentChildProvider.getChildren(equiv)); if(directParentsOfBottomNode.contains(equiv)) { ns.addNode(nodeCache.getBottomNode()); } } directChildren.removeAll(node.getEntities()); if (node.isTopNode()) { // Special treatment directChildren.addAll(directChildrenOfTopNode); } for (Node<T> childNode : nodeCache.getNodes(directChildren)) { ns.addNode(childNode); } if (!direct) { for (T child : directChildren) { getNodeHierarchyChildren(child, direct, ns); } } return ns; }