edu.isi.karma.modeling.alignment.Alignment.getLinkById()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(105)

本文整理了Java中edu.isi.karma.modeling.alignment.Alignment.getLinkById()方法的一些代码示例,展示了Alignment.getLinkById()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Alignment.getLinkById()方法的具体详情如下:
包路径:edu.isi.karma.modeling.alignment.Alignment
类名称:Alignment
方法名:getLinkById

Alignment.getLinkById介绍

暂无

代码示例

代码示例来源:origin: usc-isi-i2/Web-Karma

public void changeLinkWeight(String linkId, double weight) {
  
  LabeledLink link = this.getLinkById(linkId);
  if (link == null) {
    logger.error("Could not find the link with the id " + linkId);
    return;
  }
  
  this.graphBuilder.changeLinkWeight(link, weight);
}

代码示例来源:origin: usc-isi-i2/Web-Karma

/**
   * This method just deletes the specified link from the graph and leaves the rest of the graph untouched.
   * @param linkId
   * @return
   */
  public boolean removeLink(String linkId) {
    
    LabeledLink link = this.getLinkById(linkId);
    if (link != null) {
//            return this.graphBuilder.removeLink(link);
      if (this.graphBuilder.removeLink(link))
        if (this.steinerTree != null) {
          this.steinerTree.removeEdge(link);
          return true;
        }
    }
    logger.debug("Cannot find the link " + linkId + " in the graph.");
    return false;
  }

代码示例来源:origin: usc-isi-i2/Web-Karma

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--;
  }
}

代码示例来源:origin: usc-isi-i2/Web-Karma

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;
}

代码示例来源:origin: usc-isi-i2/Web-Karma

for (LabeledLink e : this.steinerTree.edgeSet()) {
  LabeledLink l = this.getLinkById(e.getId());

代码示例来源:origin: usc-isi-i2/Web-Karma

newEdge.getString(LinkJsonKeys.edgeSourceId.name()),
    newEdge.getString(LinkJsonKeys.edgeTargetId.name()));
LabeledLink link = alignment.getLinkById(linkId);
if(!link.isMainProvenanceLink()) {
  link = getMainProvenanceLink(alignment, link);

代码示例来源:origin: usc-isi-i2/Web-Karma

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);
      }
    }
  }
}

代码示例来源:origin: usc-isi-i2/Web-Karma

LabeledLink link = this.getLinkById(linkId);
if (link == null) {
  logger.error("could not find the link " + linkId + " in the model.");
for (LabeledLink e : this.steinerTree.edgeSet()) {
  LabeledLink l = this.getLinkById(e.getId());

代码示例来源:origin: usc-isi-i2/Web-Karma

LabeledLink link = alignment.getLinkById(linkId);
  if (link != null) {
LabeledLink newLink = alignment.getLinkById(linkId);
if (newLink != null) {
  alignment.changeLinkStatus(linkId, LinkStatus.ForcedByUser);

代码示例来源: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

columnNode.setForced(false);
LabeledLink currentLink = alignment.getLinkById(linkId);
alignment.removeLink(linkId);
Node domain = currentLink.getSource();

代码示例来源:origin: usc-isi-i2/Web-Karma

.equals(METAPROPERTY_NAME.isSpecializationForEdge)) {
LabeledLink propertyLink = alignment.getLinkById(metaPropertyId);
Node classInstanceNode = alignment.getNodeById(LinkIdFactory
    .getLinkSourceId(metaPropertyId));
  alignment.changeLinkStatus(newLink.getId(),
      LinkStatus.ForcedByUser);
  propertyLink = alignment.getLinkById(metaPropertyId);

相关文章