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

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

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

Graph.getVertex介绍

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

代码示例

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

@Override
public Vertex getVertex(final Object id) {
  return graph.getVertex(id);
}

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

@Override
public Vertex apply(Object id) {
  return delegate.getVertex(id);
}

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

@Override
public Vertex apply(Object id) {
  return delegate.getVertex(id);
}

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

protected Vertex processNextStart() {
    return this.graph.getVertex(this.starts.next());
  }
}

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

public Vertex getVertex(final Object id) {
  final Vertex vertex = this.baseGraph.getVertex(id);
  if (null == vertex)
    return null;
  else
    return new ReadOnlyVertex(vertex);
}

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

public Vertex getVertex(final Object id) {
  final Vertex vertex = this.baseGraph.getVertex(id);
  if (null == vertex)
    return null;
  else
    return new WrappedVertex(vertex);
}

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

public Vertex getVertex(final Object id) {
  final Vertex vertex = this.baseGraph.getVertex(id);
  if (vertex == null) {
    return null;
  } else {
    return new EventVertex(vertex, this);
  }
}

代码示例来源:origin: gentics/mesh

@Override
public Vertex changeType(Vertex vertex, String newType, Graph tx) {
  OrientVertex v = (OrientVertex) vertex;
  ORID newId = v.moveToClass(newType);
  return tx.getVertex(newId);
}

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

@Override
public Vertex getVertex(final Object id) {
  return new DerivedVertex(this.baseGraph.getVertex(id), this);
}

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

public boolean containsVertex(final Vertex vertex) {
  return this.graph.getVertex(vertex.getId()) != null;
}

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

public Vertex getVertex(final Object id) {
  return config.getConfiguredGraph().getVertex(id);
}

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

public Vertex getVertex(final Object id) {
  return config.getConfiguredGraph().getVertex(id);
}

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

public Vertex getVertex(final Object id) {
  final Vertex vertex = this.baseGraph.getVertex(id);
  if (null == vertex)
    return null;
  else {
    if (isInPartition(vertex))
      return new PartitionVertex(vertex, this);
    else
      return null;
  }
}

代码示例来源: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: edu.jhuapl.tinkerpop/blueprints-accumulo-graph

@Override
public VertexQuery query() {
 return new DefaultVertexQuery(getParent().getVertex(getId()));
}

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

public boolean addVertex(final Vertex vertex) {
  if (null != graph.getVertex(vertex.getId()))
    graph.addVertex(vertex.getId());
  return true;
}

代码示例来源:origin: JHUAPL/AccumuloGraph

@Override
public VertexQuery query() {
 return new DefaultVertexQuery(getParent().getVertex(getId()));
}

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

Vertex addNode(Vertex node) {
 Vertex vertex = graph.getVertex(node.getId());
 if (null == vertex) {
  vertex = graph.addVertex(node.getId());
  copyProperties(node, vertex);
 }
 return vertex;
}

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

Vertex addNode(Node node) {
 Vertex vertex = graph.getVertex(node.getId());
 if (null == vertex) {
  vertex = graph.addVertex(node.getId());
  copyProperties(node, vertex);
  Set<String> labels = new HashSet<>();
  for (Label label : node.getLabels()) {
   labels.add(label.name());
  }
  vertex.setProperty("types", labels);
 }
 return vertex;
}

代码示例来源:origin: org.vertexium/vertexium-blueprints-test

public void testVertexEdgesWithNonVisibleVertexOnOtherEnd() {
    Graph graph = graphTest.generateGraph();

    if (!(graph instanceof VertexiumBlueprintsGraph)) {
      throw new RuntimeException("Invalid graph");
    }
    org.vertexium.Graph vertexiumGraph = ((VertexiumBlueprintsGraph) graph).getGraph();

    Authorizations aAuthorizations = vertexiumGraph.createAuthorizations("a");
    org.vertexium.Vertex v1 = vertexiumGraph.addVertex("v1", new Visibility(""), aAuthorizations);
    org.vertexium.Vertex v2 = vertexiumGraph.addVertex("v2", new Visibility("a"), aAuthorizations);
    org.vertexium.Vertex v3 = vertexiumGraph.addVertex("v3", new Visibility(""), aAuthorizations);
    vertexiumGraph.addEdge("e1to2", v1, v2, "label", new Visibility(""), aAuthorizations);
    vertexiumGraph.addEdge("e1to3", v1, v3, "label", new Visibility(""), aAuthorizations);
    vertexiumGraph.flush();

    Vertex blueV1 = graph.getVertex("v1");
    assertEquals(1, count(blueV1.getEdges(Direction.BOTH, "label")));
    assertEquals(1, count(blueV1.getVertices(Direction.BOTH, "label")));
    assertEquals(1, count((Iterable) blueV1.query().direction(Direction.BOTH).vertexIds()));

    graph.shutdown();
  }
}

相关文章