public Set<Node> getNodesByUri(String uri) { return this.graphBuilder.getUriToNodesMap().get(uri); }
if (sortedMatchedNodes == null) { sortedMatchedNodes = new ArrayList<>(); Set<Node> matchedNodes = this.graphBuilder.getUriToNodesMap().get(uri); if (matchedNodes != null) sortedMatchedNodes.addAll(matchedNodes); Collections.sort(sortedMatchedNodes, new NodeSupportingModelsComparator());
private void addInternalNodes(SemanticModel model, Set<InternalNode> addedNodes) { if (model == null || model.getGraph() == null) return; if (addedNodes == null) addedNodes = new HashSet<>(); HashMap<String, Integer> uriCount = new HashMap<>(); for (Node n : model.getGraph().vertexSet()) { if (n instanceof InternalNode) { Integer count = uriCount.get(n.getUri()); if (count == null) uriCount.put(n.getUri(), 1); else uriCount.put(n.getUri(), count.intValue() + 1); } } for (Map.Entry<String, Integer> stringIntegerEntry : uriCount.entrySet()) { int modelNodeCount = stringIntegerEntry.getValue(); Set<Node> matchedNodes = this.graphBuilder.getUriToNodesMap().get(stringIntegerEntry.getKey()); int graphNodeCount = matchedNodes == null ? 0 : matchedNodes.size(); for (int i = 0; i < modelNodeCount - graphNodeCount; i++) { String id = this.nodeIdFactory.getNodeId(stringIntegerEntry.getKey()); Node n = new InternalNode(id, new Label(stringIntegerEntry.getKey())); if (this.graphBuilder.addNode(n)) addedNodes.add((InternalNode)n); } } }
Set<Node> matchedNodes = this.graphBuilder.getUriToNodesMap().get(stringIntegerEntry.getKey()); int graphNodeCount = matchedNodes == null ? 0 : matchedNodes.size(); Set<Node> matchedNodes = this.graphBuilder.getUriToNodesMap().get(n.getUri()); internalNodeMatches.put(n, matchedNodes);
if (sortedMatchedNodes == null) { sortedMatchedNodes = new LinkedList<>(); Set<Node> matchedNodes = this.graphBuilder.getUriToNodesMap().get(sourceUri); if (matchedNodes != null && !matchedNodes.isEmpty()) { sortedMatchedNodes.addAll(matchedNodes); if (sortedMatchedNodes == null) { sortedMatchedNodes = new LinkedList<>(); Set<Node> matchedNodes = this.graphBuilder.getUriToNodesMap().get(targetUri); if (matchedNodes != null && !matchedNodes.isEmpty()) { sortedMatchedNodes.addAll(matchedNodes);
Set<Node> nodesWithSameUriOfDomain = this.graphBuilder.getUriToNodesMap().get(domainUri); if (nodesWithSameUriOfDomain != null) { for (Node source : nodesWithSameUriOfDomain) {
Set<Node> nodesWithSameUriOfDomain = this.graphBuilder.getUriToNodesMap().get(domainUri); if (nodesWithSameUriOfDomain != null) { for (Node source : nodesWithSameUriOfDomain) {
Node domain = l.getSource(); LabeledLink incomingLink = l; Set<Node> matchedNodes = this.graphBuilder.getUriToNodesMap().get(domain.getUri()); if (matchedNodes == null || matchedNodes.isEmpty()) { logger.error("no match found for the node " + domain.getUri() + " in the graph");
e instanceof LabeledLink) { LabeledLink l = (LabeledLink)e; Set<Node> nodesWithSourceUri = this.graphBuilder.getUriToNodesMap().get(source.getUri()); Set<Node> nodesWithTargetUri = this.graphBuilder.getUriToNodesMap().get(target.getUri()); if (nodesWithSourceUri == null || nodesWithTargetUri == null) continue; for (Node nn1 : nodesWithSourceUri) {