public String getUri() { if (this.label != null) return this.getLabel().getUri(); return Uris.DEFAULT_NODE_URI; }
sourceObject.put(Arguments.uri.name(), property.getSource().getUri()); sourceObject.put(Arguments.id.name(), property.getSource().getId()); sourceObject.put(Arguments.label.name(), property.getSource().getLabel().getDisplayName()); targetObject.put(Arguments.label.name(), property.getTarget().getLabel().getDisplayName());
String nodeLabelStr = node.getDisplayId(); Label nodeLabel = node.getLabel(); if (nodeLabel.getUri() != null && nodeLabel.getNs() != null && nodeLabel.getUri().equalsIgnoreCase(nodeLabel.getNs())) {
public ObjectPropertyLink addObjectPropertyLink(Node source, Node target, Label label) { String id = LinkIdFactory.getLinkId(label.getUri(), source.getId(), target.getId()); ObjectPropertyLink link = new ObjectPropertyLink(id, label, this.graphBuilder.getOntologyManager().getObjectPropertyType(source.getLabel().getUri(), target.getLabel().getUri(), label.getUri())); if (this.graphBuilder.addLink(source, target, link)) { return link; } else if(this.graphBuilder.getIdToLinkMap().containsKey(link.getId())) { return (ObjectPropertyLink) this.graphBuilder.getIdToLinkMap().get(link.getId()); } else { return null; } }
if (!linkUri.equalsIgnoreCase(Uris.DEFAULT_LINK_URI)) { if (link.getTarget() instanceof InternalNode && !linkUri.equalsIgnoreCase(Uris.RDFS_SUBCLASS_URI)) { key = "domain:" + link.getSource().getLabel().getUri() + ",link:" + linkUri + ",range:" + link.getTarget().getLabel().getUri(); Integer count = this.graphBuilder.getLinkCountMap().get(key); if (count != null) key1 = link.getSource().getLabel().getUri() + link.getTarget().getLabel().getUri(); key2 = link.getTarget().getLabel().getUri() + link.getSource().getLabel().getUri(); lf1 = this.graphBuilder.getMoreFrequentLinkBetweenNodes(link.getSource().getLabel().getUri(), link.getTarget().getLabel().getUri()); sourceTargetLinkFrequency.put(key1, lf1); lf2 = this.graphBuilder.getMoreFrequentLinkBetweenNodes(link.getTarget().getLabel().getUri(), link.getSource().getLabel().getUri()); sourceTargetLinkFrequency.put(key2, lf2);
String hNodeId = ((ColumnNode)n).getHNodeId(); String attId = "att" + String.valueOf(attributeList.size() + 1); Attribute att = new Attribute(attId, this.getUri(), n.getLabel().getLocalName(), IOType.NONE, AttributeRequirement.NONE); att.sethNodeId(hNodeId); attributeList.add(att); continue; Label classPredicate = new Label(n.getLabel().getUri(), n.getLabel().getNs(), n.getLabel().getPrefix(), n.getLabel().getRdfsLabel(), n.getLabel().getRdfsComment());
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."); } }
String edgeTargetUri = edgeTarget.getUri(); Label srcNodeLabel = edgeSource.getLabel(); if (srcNodeLabel.getUri() !=null && srcNodeLabel.getNs() != null && srcNodeLabel.getUri().equalsIgnoreCase(srcNodeLabel.getNs())) { edgeSourceLabel = edgeSource.getId(); Label trgNodeLabel = edgeTarget.getLabel(); if (trgNodeLabel.getUri() !=null && trgNodeLabel.getNs() != null && trgNodeLabel.getUri().equalsIgnoreCase(trgNodeLabel.getNs())) {
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); }
if (node.getLabel() != null) { nodeIdFactory.getNodeId(node.getUri());
StringTemplateTerm typeTerm = new StringTemplateTerm(node.getLabel().getUri(), true); TemplateTermSet typeTermSet = new TemplateTermSet(); typeTermSet.addTemplateTermToSet(typeTerm); HashMap<String,Label> superClassLabelsMap = ontMgr.getSuperClasses(node.getLabel().getUri(), true); for(String key: superClassLabelsMap.keySet())