@Override public void populateBlackListedEdges(DirectedWeightedMultigraph<ServiceNode, FlowEdge> graph) { for (ServiceNode node: serviceNodes) { if (graph.containsVertex(node)) { blacklistedEdges.addAll(graph.incomingEdgesOf(node)); blacklistedEdges.addAll(graph.outgoingEdgesOf(node)); } else { log.info("The graph " + graph + " doesn't contains node " + node.toString()); } } for( FlowEdge flowEdge: flowEdges) { if (graph.containsEdge(flowEdge)) { blacklistedEdges.add(flowEdge); } else { log.info("The graph " + graph + "doesn't contains edge " + flowEdge.toString()); } } } }
Set<FlowEdge> outgoingEdges = weightedGraph.outgoingEdgesOf(node.getNode()); for (FlowEdge outGoingEdge:outgoingEdges) {
public List<LabeledLink> getOutgoingLinks(String nodeId) { List<LabeledLink> outgoingLinks = new LinkedList<>(); Node node = this.getIdToNodeMap().get(nodeId); if (node == null) return outgoingLinks; Set<DefaultLink> allOutgoingLinks = this.getGraph().outgoingEdgesOf(node); if (allOutgoingLinks != null) { for (DefaultLink l : allOutgoingLinks) { if (l instanceof LabeledLink) { outgoingLinks.add((LabeledLink)l); } } } return outgoingLinks; }
@Override public void populateBlackListedEdges(DirectedWeightedMultigraph<ServiceNode, FlowEdge> graph) { for (ServiceNode node: serviceNodes) { if (graph.containsVertex(node)) { blacklistedEdges.addAll(graph.incomingEdgesOf(node)); blacklistedEdges.addAll(graph.outgoingEdgesOf(node)); } else { log.info("The graph " + graph + " doesn't contains node " + node.toString()); } } for( FlowEdge flowEdge: flowEdges) { if (graph.containsEdge(flowEdge)) { blacklistedEdges.add(flowEdge); } else { log.info("The graph " + graph + "doesn't contains edge " + flowEdge.toString()); } } } }
public Set<LabeledLink> getOutgoingEdgesOf(Node node) { Set<LabeledLink> edges = new HashSet<>(); for(DirectedWeightedMultigraph<Node, LabeledLink> model : models) { GraphUtil.printGraph(GraphUtil.asDefaultGraph(model)); if(model.containsVertex(node)) edges.addAll(model.outgoingEdgesOf(node)); } return edges; }
public Set<LabeledLink> getOutgoingLinksInTree(String nodeId) { Set<LabeledLink> results = new HashSet<>(); if (steinerTree == null) return results; if (steinerTree.vertexSet().isEmpty()) return results; Node node = null; for (Node n : steinerTree.vertexSet()) { if (n.getId().equals(nodeId)) { node = n; break; } } if (node == null) return results; results = this.steinerTree.outgoingEdgesOf(node); return results; }
private static HashMap<Node, Integer> outDegreeInSet(DirectedWeightedMultigraph<Node, LabeledLink> g, Set<Node> nodes, boolean includeSelfLinks) { HashMap<Node, Integer> nodeToOutDegree = new HashMap<>(); if (g == null || nodes == null) return nodeToOutDegree; for (Node n : nodes) { Set<LabeledLink> outgoingLinks = g.outgoingEdgesOf(n); if (outgoingLinks == null || outgoingLinks.isEmpty()) { nodeToOutDegree.put(n, 0); } else { int count = 0; for (LabeledLink l : outgoingLinks) { if (includeSelfLinks) { if (nodes.contains(l.getSource())) count++; } else { if (nodes.contains(l.getSource()) && !n.equals(l.getSource())) count++; } } nodeToOutDegree.put(n, count); } } return nodeToOutDegree; }
Set<LabeledLink> outgoingLinks = model.outgoingEdgesOf(n); if (outgoingLinks != null && !outgoingLinks.isEmpty()) for (LabeledLink l : outgoingLinks)
private LabeledLink getSpecializationLinkIfExists(LabeledLink link, Node sourceNode) { Set<LabeledLink> outgoingEdges = this.alignmentGraph.outgoingEdgesOf(sourceNode); for (LabeledLink olink:outgoingEdges) { // Check for the object property specialization if (olink instanceof ObjectPropertySpecializationLink ) { String splLinkId = ((ObjectPropertySpecializationLink) olink).getSpecializedLinkId(); if (splLinkId.equals(link.getId())) return olink; } // Check for the data property specialization else if (olink instanceof DataPropertyOfColumnLink) { DataPropertyOfColumnLink dlink = (DataPropertyOfColumnLink) olink; Node target = link.getTarget(); if (target instanceof ColumnNode) { ColumnNode cnode = (ColumnNode) target; if (dlink.getSpecializedColumnHNodeId().equals(cnode.getId())) return dlink; } } } return null; }
Set<DefaultLink> outgoingLinks = this.graph.outgoingEdgesOf(node); if (outgoingLinks != null) { DefaultLink[] outgoingLinksArray = outgoingLinks.toArray(new DefaultLink[0]);
Set<FlowEdge> outgoingEdges = weightedGraph.outgoingEdgesOf(node.getNode()); for (FlowEdge outGoingEdge:outgoingEdges) {
if (model.outgoingEdgesOf(in) == null || model.outgoingEdgesOf(in).isEmpty()) { this.itemsCount += model.edgeSet().size(); return;
Set<DefaultLink> outgoingLinks = tree.outgoingEdgesOf(node);
continue; Set<DefaultLink> outLinks = this.getGraphBuilder().getGraph().outgoingEdgesOf(sortedMatchedNodes.get(0)); boolean okLink = true; if (outLinks != null) {
Integer targetIndex = verticesIndex.get(target); Set<LabeledLink> outEdges = alignmentGraph .outgoingEdgesOf(target);
Integer targetIndex = verticesIndex.get(target); Set<LabeledLink> outEdges = alignmentGraph .outgoingEdgesOf(target); if (sourceIndex == null || targetIndex == null) { logger.error("Edge vertex index not found!");
Set<DefaultLink> outgoingLinks = this.getGraph().outgoingEdgesOf(node); if (outgoingLinks != null) { for (DefaultLink l : outgoingLinks) {
Set<LabeledLink> outgoingLinks = alignmentGraph.outgoingEdgesOf(node); for (LabeledLink link:outgoingLinks) {
Set<LabeledLink> outgoingEdges = alignmentGraph.outgoingEdgesOf(node); for (LabeledLink olink:outgoingEdges) { if (olink instanceof ObjectPropertySpecializationLink