com.tinkerpop.blueprints.Graph.getEdge()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(138)

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

Graph.getEdge介绍

[英]Return the edge referenced by the provided object identifier. If no edge is referenced by that identifier, then return null.
[中]返回由提供的对象标识符引用的边。如果该标识符未引用任何边,则返回null。

代码示例

代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core

@Override
public Edge getEdge(final Object id) {
  return graph.getEdge(id);
}

代码示例来源:origin: BrynCooke/totorom

@Override
public Edge apply(Object id) {
  return delegate.getEdge(id);
}

代码示例来源:origin: BrynCooke/totorom

@Override
public Edge apply(Object id) {
  return delegate.getEdge(id);
}

代码示例来源:origin: com.tinkerpop/pipes

protected Edge processNextStart() {
    return this.graph.getEdge(this.starts.next());
  }
}

代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core

public Edge getEdge(final Object id) {
  final Edge edge = this.baseGraph.getEdge(id);
  if (null == edge)
    return null;
  else
    return new ReadOnlyEdge(edge);
}

代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core

public Edge getEdge(final Object id) {
  final Edge edge = this.baseGraph.getEdge(id);
  if (null == edge)
    return null;
  else
    return new WrappedEdge(edge);
}

代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core

public Edge getEdge(final Object id) {
  final Edge edge = this.baseGraph.getEdge(id);
  if (edge == null) {
    return null;
  } else {
    return new EventEdge(edge, this);
  }
}

代码示例来源:origin: tinkerpop/furnace

@Override
public Edge getEdge(final Object id) {
  return new DerivedEdge(this.baseGraph.getEdge(id), this);
}

代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core

public Edge getEdge(final Object id) {
  final Edge edge = this.baseGraph.getEdge(id);
  if (null == edge)
    return null;
  else
    return new PartitionEdge(edge, this);
}

代码示例来源:origin: com.tinkerpop/frames

public Edge getEdge(final Object id) {
  return config.getConfiguredGraph().getEdge(id);
}

代码示例来源:origin: org.jboss.windup.graph.frames/windup-frames

public Edge getEdge(final Object id) {
  return config.getConfiguredGraph().getEdge(id);
}

代码示例来源:origin: com.tinkerpop.blueprints/blueprints-graph-jung

public boolean containsEdge(final Edge edge) {
  return this.graph.getEdge(edge.getId()) != null;
}

代码示例来源:origin: SciGraph/SciGraph

boolean removeEdge(Relationship relationship) {
 Edge edge = graph.getEdge(relationship.getId());
 if (null != edge) {
  graph.removeEdge(edge);
  return true;
 } else {
  return false;
 }
}

代码示例来源:origin: org.jboss.windup.graph.frames/windup-frames

public Element getElement() {
  Element element = elementReference.get();
  if (element == null) {
    if (this.isVertex)
      element = framedGraph.getBaseGraph().getVertex(this.id);
    else
      element = framedGraph.getBaseGraph().getEdge(this.id);
    elementReference = new SoftReference<Element>(element);
  }
  return element;
}

代码示例来源:origin: SciGraph/SciGraph

Edge addEdge(Relationship relationship) {
 Edge edge = graph.getEdge(relationship.getId());
 if (null == edge) {
  Vertex outVertex = addNode(relationship.getStartNode());
  Vertex inVertex = addNode(relationship.getEndNode());
  String label = relationship.getType().name();
  Optional<String> curieLabel = curieUtil.getCurie(label);
  edge = graph.addEdge(relationship.getId(), outVertex, inVertex, curieLabel.orElse(label));
  copyProperties(relationship, edge);
 }
 return edge;
}

代码示例来源:origin: SciGraph/SciGraph

Edge addEdge(Edge edge) {
 Edge newEdge = graph.getEdge(edge.getId());
 if (null == newEdge) {
  Vertex outVertex = addNode(edge.getVertex(Direction.OUT));
  Vertex inVertex = addNode(edge.getVertex(Direction.IN));
  String label = edge.getLabel();
  newEdge = graph.addEdge(edge.getId(), outVertex, inVertex, label);
  copyProperties(edge, edge);
 }
 return newEdge;
}

代码示例来源:origin: iTransformers/netTransformer

private void mergeEdge(Graph graph1, Edge edge2) {
  Edge edge1 = graph1.getEdge(edge2.getId());
  if (edge1 == null) {
    Vertex outVertex1 = graph1.getVertex(edge2.getVertex(Direction.OUT).getId());
    Vertex outVertex2 = graph1.getVertex(edge2.getVertex(Direction.IN).getId());
    edge1 = graph1.addEdge(edge2.getId(), outVertex1, outVertex2, edge2.getLabel());
    for (String key2 : edge2.getPropertyKeys()) {
      edge1.setProperty(key2,edge2.getProperty(key2));
    }
  } else {
    Set<String> keys1 = edge1.getPropertyKeys();
    Set<String> keys2 = edge2.getPropertyKeys();
    for (String key2 : keys2) {
      if (keys1.contains(key2)) {
        MergeConflictResolver conflictResolver = getEdgeConflictResolver(key2);
        Object merge =  conflictResolver.resolveConflict(edge1.getProperty(key2), edge2.getProperty(key2));
        edge1.setProperty(key2, merge);
      } else {
        edge1.setProperty(key2, edge2.getProperty(key2));
      }
    }
  }
}

相关文章