public void changeLinkStatus(String linkId, LinkStatus newStatus) { logger.debug("changing the status of link " + linkId + " to " + newStatus.name()); LabeledLink link = this.getLinkById(linkId); if (link == null) { if (newStatus == LinkStatus.ForcedByUser) { Node source = this.getNodeById(LinkIdFactory.getLinkSourceId(linkId)); Node target = this.getNodeById(LinkIdFactory.getLinkTargetId(linkId)); String linkUri = LinkIdFactory.getLinkUri(linkId); LabeledLink newLink; if (linkUri.equalsIgnoreCase(Uris.RDFS_SUBCLASS_URI)) newLink = new SubClassLink(linkId); else newLink = new ObjectPropertyLink(linkId, this.graphBuilder.getOntologyManager().getUriLabel(linkUri), this.graphBuilder.getOntologyManager().getObjectPropertyType(source.getLabel().getUri(), target.getLabel().getUri(), linkUri)); newLink.setStatus(LinkStatus.ForcedByUser); this.graphBuilder.addLink(source, target, newLink); } } else this.graphBuilder.changeLinkStatus(link, newStatus); }
private void refineInitialEdges(Alignment alignment) { int j = initialEdges.length() - 1; while (j >= 0) { JSONObject initialEdge = initialEdges.getJSONObject(j); String edgeUri = initialEdge.getString(LinkJsonKeys.edgeId.name()); String sourceId = initialEdge.getString(LinkJsonKeys.edgeSourceId.name()); String targetId = initialEdge.getString(LinkJsonKeys.edgeTargetId.name()); String linkId = LinkIdFactory.getLinkId(edgeUri, sourceId, targetId); if (alignment.getLinkById(linkId) == null) { // the link is not even in the graph initialEdges.remove(j); } j--; } }
l = readLink(reader, weight); if (l != null) { source = idToNodes.get(LinkIdFactory.getLinkSourceId(l.getId())); target = idToNodes.get(LinkIdFactory.getLinkTargetId(l.getId())); if (source != null && target != null) { graph.addEdge(source, target, l);
target = this.getIdToNodeMap().get(f.destination().name()); if (LinkIdFactory.getLinkUri(f.label().name).equals(Uris.DEFAULT_LINK_URI)) { String id = LinkIdFactory.getLinkId(Uris.DEFAULT_LINK_URI, source.getId(), target.getId()); l = new CompactObjectPropertyLink(id, ObjectPropertyType.None);
LinkIdFactory.getLinkTargetId(edgeId); Set<LabeledLink> currentLinks = alignment.getCurrentIncomingLinksToNode(LinkIdFactory.getLinkTargetId(edgeId)); if (currentLinks != null && !currentLinks.isEmpty()) { for (LabeledLink currentLink: currentLinks) {
getLinkSourceId(link.getId())); Node edgeTarget = alignment.getNodeById(LinkIdFactory. getLinkTargetId(link.getId()));
.getLinkTargetId(specializedLinkId)); int height = nodeHeightsMap.get(specializedLinkTarget);
public DataPropertyOfColumnLink addDataPropertyOfColumnLink(Node source, Node target, String specializedColumnHNodeId, String specializedLinkId) { String id = LinkIdFactory.getLinkId(Uris.DATAPROPERTY_OF_COLUMN_LINK_URI, source.getId(), target.getId()); DataPropertyOfColumnLink link = new DataPropertyOfColumnLink(id, specializedColumnHNodeId, specializedLinkId); if (this.graphBuilder.addLink(source, target, link)) return link; return null; }
.getLinkSourceId(metaPropertyId)); Node targetNode = alignment.getNodeById(LinkIdFactory.getLinkTargetId(metaPropertyId)); Label linkLabel = new Label(LinkIdFactory.getLinkUri(metaPropertyId)); LabeledLink newLink = alignment.addObjectPropertyLink(classInstanceNode, targetNode, linkLabel);
public SubClassLink addSubClassOfLink(Node source, Node target) { String id = LinkIdFactory.getLinkId(Uris.RDFS_SUBCLASS_URI, source.getId(), target.getId()); SubClassLink link = new SubClassLink(id); if (this.graphBuilder.addLink(source, target, link)) return link; return null; }
public ClassInstanceLink addClassInstanceLink(Node source, Node target, LinkKeyInfo keyInfo) { String id = LinkIdFactory.getLinkId(Uris.CLASS_INSTANCE_LINK_URI, source.getId(), target.getId()); ClassInstanceLink link = new ClassInstanceLink(id, keyInfo); if (this.graphBuilder.addLink(source, target, link)) return link; return null; }
public ObjectPropertySpecializationLink addObjectPropertySpecializationLink(Node source, Node target, String specializedLinkId) { String id = LinkIdFactory.getLinkId(Uris.OBJECTPROPERTY_SPECIALIZATION_LINK_URI, source.getId(), target.getId()); ObjectPropertySpecializationLink link = new ObjectPropertySpecializationLink(id, specializedLinkId); if (this.graphBuilder.addLink(source, target, link)) return link; return null; }
public ColumnSubClassLink addColumnSubClassOfLink(Node source, Node target) { String id = LinkIdFactory.getLinkId(Uris.COLUMN_SUBCLASS_LINK_URI, source.getId(), target.getId()); ColumnSubClassLink link = new ColumnSubClassLink(id); if (this.graphBuilder.addLink(source, target, link)) return link; return null; }
continue; id = LinkIdFactory.getLinkId(uri, sourceId, targetId); label = new Label(ontologyManager.getUriLabel(uri));
private UpdateContainer deleteLink(Alignment alignment, OntologyManager ontMgr, JSONObject edge) throws JSONException { UpdateContainer uc = new UpdateContainer(); String targetId = edge.getString(LinkJsonKeys.edgeTargetId.name()); String edgeUri = edge.getString(LinkJsonKeys.edgeId.name()); String linkId = LinkIdFactory.getLinkId( edgeUri, edge.getString(LinkJsonKeys.edgeSourceId.name()), targetId); // Add info to description string LabeledLink delLink = alignment.getLinkById(linkId); if(delLink != null) { this.displayLabel = delLink.getLabel().getDisplayName(); } else { this.displayLabel = edgeUri; } alignment.removeLink(linkId); return uc; }
public DataPropertyLink addDataPropertyLink(Node source, Node target, Label label, boolean isProvenance) { String id = LinkIdFactory.getLinkId(label.getUri(), source.getId(), target.getId()); DataPropertyLink link = new DataPropertyLink(id, label, isProvenance); if (this.graphBuilder.addLink(source, target, link)) return link; return null; }
if(initialEdgeProv && !newEdgeProv) { String linkId = LinkIdFactory.getLinkId( newEdge.getString(LinkJsonKeys.edgeId.name()), newEdge.getString(LinkJsonKeys.edgeSourceId.name()),
private void addProvenaceLinks(Alignment alignment, Label linkLabel, LiteralNode targetNode) { String targetId = targetNode.getId(); Set<Node> internalNodes = alignment.getNodesByType(NodeType.InternalNode); String edgeUri = linkLabel.getUri(); for(Node internalNode : internalNodes) { String nodeId = internalNode.getId(); Set<LabeledLink> inLinks = alignment.getIncomingLinksInTree(nodeId); Set<LabeledLink> outLinks = alignment.getOutgoingLinksInTree(nodeId); if((inLinks != null && inLinks.size() > 0) || (outLinks != null && outLinks.size() > 0)) { String linkId = LinkIdFactory.getLinkId(edgeUri, nodeId, targetId); LabeledLink link = alignment.getLinkById(linkId); if(link == null) { link = alignment.addObjectPropertyLink(internalNode, targetNode, linkLabel); alignment.changeLinkStatus(linkId, LinkStatus.ForcedByUser); link.setProvenance(true, false); } } } }
id = LinkIdFactory.getLinkId(e.getUri(), n1.getId(), n2.getId()); LabeledLink l = this.graphBuilder.getIdToLinkMap().get(id); if (l != null) {
addedNodes.add(target); String linkId = LinkIdFactory.getLinkId(propertyUri, source.getId(), target.getId()); LabeledLink link = new DataPropertyLink(linkId, new Label(propertyUri)); if (!this.graphBuilder.addLink(source, target, link)) continue;;