public String getUri() { if (this.label != null) return this.getLabel().getUri(); return null; }
private Set<String> getTriples(DirectedWeightedMultigraph<Node, LabeledLink> g, HashMap<Node,String> nodeIds, boolean ignoreSemanticTypes, boolean ignoreColumnNodes) { String separator = "|"; Set<String> triples = new HashSet<>(); if (g == null) return triples; String s, p, o, triple; for (LabeledLink l : g.edgeSet()) { if (ignoreSemanticTypes && !(l.getTarget() instanceof InternalNode)) continue; s = nodeIds.get(l.getSource()); o = nodeIds.get(l.getTarget()); p = l.getLabel().getUri(); if (ignoreColumnNodes) triple = s + separator + p; else triple = s + separator + p + separator + o; // System.out.println(triple); triples.add(triple); } return triples; }
Label linkLabel = link.getLabel(); String edgeLabelStr = linkLabel.getDisplayName(); JSONObject edgeObj = new JSONObject();
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; }
String property = "`" + getPropertyName(link.getLabel()) + "`"; String to = getClassName(target); String from = getClassName(source);
link.put(Arguments.label.name(), property.getLabel().getDisplayName());
List<LabeledLink> links = alignment.getGraphBuilder().getIncomingLinks(node.getId()); for(LabeledLink link : links) { String property = "`" + getPropertyName(link.getLabel()) + "`"; String classname = getClassName(link.getSource()); if(link.isProvenance()) {
private void setUserTypesForColumnNodes() { if (this.graph == null) return; for (Node n : this.graph.vertexSet()) { if (!(n instanceof ColumnNode)) continue; ColumnNode cn = (ColumnNode)n; Set<LabeledLink> incomingLinks = this.graph.incomingEdgesOf(n); if (incomingLinks != null) { for (LabeledLink link : incomingLinks) { Node domain = link.getSource(); SemanticType st = new SemanticType(cn.getHNodeId(), link.getLabel(), domain.getLabel(), domain.getId(), false, Origin.User, 1.0); cn.assignUserType(st); } } else logger.debug("The column node " + ((ColumnNode)n).getColumnName() + " does not have any domain or it has more than one domain."); } }
private void addLink(LabeledLink link, LINK_DIRECTION direction, JSONArray edgesArray) throws JSONException { String linkLabel = link.getLabel().getDisplayName(); edgeObj.put(JsonKeys.edgeId.name(), link.getLabel().getUri()); edgeObj.put(JsonKeys.edgeLabel.name(), linkLabel); edgeObj.put(JsonKeys.edgeSource.name(), edgeSourceLabel);
DataPropertyLink link = new DataPropertyLink(linkId, new Label(incomingLink.getLabel())); this.graphBuilder.addLink(m, newNode, link, ModelingParams.PATTERN_LINK_WEIGHT); matches.add(newNode);
newLink.getLabel(), source.getLabel(), source.getId(), false, SemanticType.Origin.User, 1.0);
public LabeledLink copy(String newId) { Label label = this.getLabel(); if (this instanceof DataPropertyLink) newLink = new DataPropertyLink(newId, label, this.isProvenance);
private void addInversePropertyIfExists(SubjectMap subjMap, PredicateObjectMap poMap, LabeledLink olink, TriplesMap subjTrMap) { String propUri = olink.getLabel().getUri();