本文整理了Java中edu.isi.karma.modeling.alignment.Alignment.getNodeById()
方法的一些代码示例,展示了Alignment.getNodeById()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Alignment.getNodeById()
方法的具体详情如下:
包路径:edu.isi.karma.modeling.alignment.Alignment
类名称:Alignment
方法名:getNodeById
暂无
代码示例来源:origin: usc-isi-i2/Web-Karma
public Set<LabeledLink> getCurrentOutgoingLinksToNode(String nodeId) {
Node node = this.getNodeById(nodeId);
if (node == null)
return null;
return this.graphBuilder.getOutgoingLinksMap().get(nodeId);
}
代码示例来源:origin: usc-isi-i2/Web-Karma
public Set<LabeledLink> getCurrentIncomingLinksToNode(String nodeId) {
Node node = this.getNodeById(nodeId);
if (node == null)
return null;
return this.graphBuilder.getIncomingLinksMap().get(nodeId);
}
代码示例来源:origin: usc-isi-i2/Web-Karma
public void deleteForcedInternalNode(String nodeId) {
Node node = getNodeById(nodeId);
if(node != null) {
this.removeNode(nodeId);
// if (this.graphBuilder.removeNode(node))
// this.steinerTree.removeVertex(node);
}
}
代码示例来源:origin: usc-isi-i2/Web-Karma
public boolean isNodeIsolatedInTree(String nodeId) {
Node node = this.getNodeById(nodeId);
if (node != null) {
if (this.steinerTree != null && this.steinerTree.containsVertex(node)) {
Set<LabeledLink> inLinks = this.steinerTree.edgesOf(node);
if (inLinks == null || inLinks.isEmpty())
return true;
}
}
logger.debug("Cannot find the link " + nodeId + " in the graph.");
return false;
}
代码示例来源:origin: usc-isi-i2/Web-Karma
public ColumnNode addColumnNode(String hNodeId, String columnName, Label rdfLiteralType, String language) {
if(this.getNodeById(hNodeId) != null)
{
return null;
}
// use hNodeId as id of the node
ColumnNode node = new ColumnNode(hNodeId, hNodeId, columnName, rdfLiteralType, language);
if (this.graphBuilder.addNodeAndUpdate(node)) {
this.sourceColumnNodes.add(node);
return node;
}
return null;
}
代码示例来源:origin: usc-isi-i2/Web-Karma
public void updateLiteralNode(String nodeId, String value, String type, String language, boolean isUri) {
LiteralNode node = (LiteralNode) getNodeById(nodeId);
if(node != null) {
type = type.replace(Prefixes.XSD + ":", Namespaces.XSD);
Label literalType = new Label(type, Namespaces.XSD, Prefixes.XSD);
node.setDatatype(literalType);
node.setValue(value);
node.setLanguage(language);
node.setUri(isUri);
} else {
addLiteralNode(nodeId, value, type, language, isUri);
}
}
代码示例来源:origin: usc-isi-i2/Web-Karma
public InternalNode addInternalNode(InternalNode node) {
Node n = this.getNodeById(node.getId());
if (n == null) {
if (this.graphBuilder.addNodeAndUpdate(node)) {
this.nodeIdFactory.addNodeId(node.getId(), node.getUri());
return node;
} else {
logger.error("error in adding the internal node " + node.getId() + " to the graph");
return null;
}
}
if (n instanceof InternalNode)
return (InternalNode)n;
return null;
}
代码示例来源:origin: usc-isi-i2/Web-Karma
public boolean removeNode(String nodeId) {
Node node = this.getNodeById(nodeId);
if (node != null) {
node.setForced(false);
this.graphBuilder.getForcedNodes().remove(node);
if (this.steinerTree != null && this.steinerTree.containsVertex(node)) {
Set<LabeledLink> links = this.steinerTree.edgesOf(node);
if (links != null) {
for (LabeledLink l : links) {
this.changeLinkStatus(l.getId(), LinkStatus.Normal);
}
}
this.steinerTree.removeVertex(node);
return true;
}
}
logger.debug("Cannot find the link " + nodeId + " in the graph.");
return false;
}
代码示例来源:origin: usc-isi-i2/Web-Karma
public void updateColumnNodesInAlignment(Worksheet worksheet) {
for (HNodePath path : worksheet.getHeaders().getAllPaths()) {
HNode node = path.getLeaf();
String hNodeId = node.getId();
Node n = getNodeById(hNodeId);
if (n == null) {
addColumnNode(hNodeId, node.getColumnName(), null, null);
}
}
}
代码示例来源:origin: usc-isi-i2/Web-Karma
Node n = this.getNodeById(nodeId);
if (n == null) {
logger.error("could not find the node " + nodeId + " in the model.");
代码示例来源:origin: usc-isi-i2/Web-Karma
List<Node> columnNodes = new ArrayList<>();
for(String hNodeId: hNodeIdList) {
Node columnNode = alignment.getNodeById(hNodeId);
if(columnNode != null)
columnNodes.add(columnNode);
代码示例来源:origin: usc-isi-i2/Web-Karma
Node source = this.getNodeById(link.getSource().getId());
if (source == null) {
logger.error("could not find the source node " + link.getSource().getId() + " in the model.");
Node target = this.getNodeById(link.getTarget().getId());
if (target == null) {
logger.error("could not find the source node " + link.getTarget().getId() + " in the model.");
代码示例来源:origin: usc-isi-i2/Web-Karma
String linkLabel = link.getLabel().getDisplayName();
Node edgeSource = alignment.getNodeById(LinkIdFactory.
getLinkSourceId(link.getId()));
Node edgeTarget = alignment.getNodeById(LinkIdFactory.
getLinkTargetId(link.getId()));
代码示例来源:origin: usc-isi-i2/Web-Karma
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);
}
代码示例来源:origin: usc-isi-i2/Web-Karma
LiteralNode provenanceNode = null;
if(isProvenance) {
Node node = alignment.getNodeById(targetId);
if(node != null && node instanceof LiteralNode) {
provenanceNode = (LiteralNode)node;
if(sourceId.endsWith(" (add)"))
sourceId = sourceId.substring(0, sourceId.length()-5).trim();
sourceNode = alignment.getNodeById(sourceId);
if(targetId.endsWith(" (add)"))
targetId = targetId.substring(0, targetId.length()-5).trim();
targetNode = alignment.getNodeById(targetId);
代码示例来源:origin: usc-isi-i2/Web-Karma
isProvenance = type.getBoolean(ClientJsonKeys.isProvenance.name());
Node source = alignment.getNodeById(sourceId);
if (source == null) {
代码示例来源:origin: usc-isi-i2/Web-Karma
iNode = (InternalNode)this.getNodeById(n.getId());
if (iNode != null) {
modelToAlignmentNode.put(n, iNode);
代码示例来源:origin: usc-isi-i2/Web-Karma
Node node = alignment.getNodeById(nodeId);
if(node instanceof LiteralNode) {
final LiteralNode lNode = (LiteralNode)node;
代码示例来源:origin: usc-isi-i2/Web-Karma
hasLastNodeFromSteinerTree = true;
} else {
Node graphNode = alignment.getNodeById(domainURI.getUri() + i);
if (graphNode != null)
insertSemanticTypeSuggestion(arr, clazzLocalNameWithPrefix + i + " (add)",
typeURI.getUri(), typeURI.getUri() + i, probability);
} else {
Node graphNode = alignment.getNodeById(typeURI.getUri() + i);
if (graphNode != null)
insertSemanticTypeSuggestion(arr, "", "", "", clazzLocalNameWithPrefix + i + " (add)",
代码示例来源:origin: usc-isi-i2/Web-Karma
Node classNode = alignment.getNodeById(metaPropertyId);
Node classInstanceNode = alignment.getNodeById(LinkIdFactory
.getLinkSourceId(metaPropertyId));
Node targetNode = alignment.getNodeById(LinkIdFactory.getLinkTargetId(metaPropertyId));
Label linkLabel = new Label(LinkIdFactory.getLinkUri(metaPropertyId));
LabeledLink newLink = alignment.addObjectPropertyLink(classInstanceNode,
Node classNode = alignment.getNodeById(metaPropertyId);
内容来源于网络,如有侵权,请联系作者删除!