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

x33g5p2x  于2022-01-31 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(78)

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

Vertex.getId介绍

暂无

代码示例

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

public Object vertexIds() {
  final List<Object> list = new ArrayList<Object>();
  for (final Vertex vertex : this.vertices()) {
    list.add(vertex.getId());
  }
  return list;
}

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

public String toString() {
  final StringBuilder sb = new StringBuilder();
  sb.append("id: " + super.getId());
  sb.append(", from: " + from.getId());
  sb.append(", to: " + to.getId());
  sb.append(", label: " + label);
  sb.append(", props: ");
  super.appendProps(sb);
  return sb.toString();
}

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

public void setProperty(final Vertex vertex, final String key, final Object value) {
  Map<String, Object> map = this.memory.get(vertex.getId());
  if (null == map) {
    map = new HashMap<String, Object>();
    this.memory.put(vertex.getId(), map);
  }
  final String bspKey = generateSetKey(key);
  if (isConstantKey(key) && map.containsKey(bspKey))
    throw new IllegalStateException("The constant property " + bspKey + " has already been set for vertex " + vertex);
  else
    map.put(bspKey, value);
}

代码示例来源:origin: joshsh/ripple

@Override
  public void print(Vertex instance, RipplePrintStream p, ModelConnection mc) throws RippleException {
    p.print("[vertex " + instance.getId() + "]");
  }
}

代码示例来源:origin: edu.jhuapl.tinkerpop/blueprints-accumulo-graph

public BaseEdgeMutator(Edge edge) {
 this(edge.getId().toString(),
   edge.getVertex(Direction.OUT).getId().toString(),
   edge.getVertex(Direction.IN).getId().toString(),
   edge.getLabel());
}
public BaseEdgeMutator(String id, String outVertexId, String inVertexId, String label) {

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

public BaseEdgeMutator(Edge edge) {
 this(edge.getId().toString(),
   edge.getVertex(Direction.OUT).getId().toString(),
   edge.getVertex(Direction.IN).getId().toString(),
   edge.getLabel());
}
public BaseEdgeMutator(String id, String outVertexId, String inVertexId, String label) {

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

private void writeGraphEdges(OutputStream os) throws IOException {
  IOUtils.write(GexfConstants.EDGES_OPEN, os);
  
  
  
  for(Edge edge : graph.getEdges()) {
    String id = ""+edge.getId().hashCode();
    String source = ""+edge.getVertex(Direction.IN).getId().hashCode();
    String target = ""+edge.getVertex(Direction.OUT).getId().hashCode();
    writeGraphEdge(id, source, target, os);
  }
  
  IOUtils.write(GexfConstants.EDGES_CLOSE, os);
}

代码示例来源:origin: org.jboss.windup.legacy.application/grapher

private void writeGraphEdges(OutputStream os) throws IOException {
  IOUtils.write(GexfConstants.EDGES_OPEN, os);
  
  
  
  for(Edge edge : graph.getEdges()) {
    String id = ""+edge.getId().hashCode();
    String source = ""+edge.getVertex(Direction.IN).getId().hashCode();
    String target = ""+edge.getVertex(Direction.OUT).getId().hashCode();
    writeGraphEdge(id, source, target, os);
  }
  
  IOUtils.write(GexfConstants.EDGES_CLOSE, os);
}

代码示例来源:origin: net.fortytwo.extendo/extendo-brain

private void setTypeOf(final Atom a,
            final BottomUpType type) {
  BottomUpType existingType = typeOfAtom.get(a);
  if (null == existingType) {
    typeOfAtom.put(a, type);
    changed = true;
  } else if (existingType != type) {
    LOGGER.warning("conflicting types for atom " + a.asVertex().getId() + ": {"
        + existingType.getName() + ", " + type.getName() + "}. Only the former will be used.");
  }
}

代码示例来源:origin: org.jboss.windup.legacy.application/grapher

private void writeGraphNodes(OutputStream os) throws IOException {
  //iterate the nodes.
  for(Vertex vertex : graph.getVertices()) {
    String id = ""+vertex.getId().hashCode();
    String label = vertex.getProperty(vertexLabelProperty);
    
    if(StringUtils.isBlank(label)) {
      label = vertex.toString();
    }
    writeGraphNode(id, label, os);
  }
  
}

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

private void writeGraphNodes(OutputStream os) throws IOException {
  //iterate the nodes.
  for(Vertex vertex : graph.getVertices()) {
    String id = ""+vertex.getId().hashCode();
    String label = vertex.getProperty(vertexLabelProperty);
    
    if(StringUtils.isBlank(label)) {
      label = vertex.toString();
    }
    writeGraphNode(id, label, os);
  }
  
}

代码示例来源:origin: org.jboss.windup.legacy.application/grapher

private void writeGraphEdges(OutputStream os) throws IOException {
  for(Edge edge : graph.getEdges()) {
    String label = edge.getLabel();
    String source = ""+edge.getVertex(Direction.IN).getId().hashCode();
    String target = ""+edge.getVertex(Direction.OUT).getId().hashCode();
    writeGraphEdge(label, source, target, os);
  }
}

代码示例来源:origin: org.jboss.windup.rules.apps/rules-java

private AddDecompiledItemsToGraph(ArchiveModel archiveModel, GraphContext context)
{
  this.context = context;
  this.archiveModelID = archiveModel.asVertex().getId();
  this.fileService = new FileService(context);
}

代码示例来源:origin: edu.jhuapl.tinkerpop/blueprints-accumulo-graph

/**
 * Write a vertex with the given id.
 * Note: This does not currently write the vertex's properties.
 * @param vertex
 */
public void writeVertex(Vertex vertex) {
 Mutators.apply(getWriter(), new AddVertexMutator(vertex.getId().toString()));
 globals.checkedFlush();
}

代码示例来源:origin: fr.inria.atlanmod.neoemf/neoemf-data-blueprints-core

@Override
protected boolean containsReference(PersistentEObject object, EReference reference, PersistentEObject value) {
  Vertex v = backend.getOrCreateVertex(object);
  for (Vertex vOut : v.getVertices(Direction.OUT, reference.getName())) {
    if (Objects.equals(vOut.getId(), value.id().toString())) {
      return true;
    }
  }
  return false;
}

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

private void migrateProperty(Vertex vertex, String oldPropertyKey, String newPropertyKey) {
  log.info("Migrating vertex: " + vertex.getId());
  String value = vertex.getProperty(oldPropertyKey);
  vertex.removeProperty(oldPropertyKey);
  if (value != null) {
    vertex.setProperty(newPropertyKey, value);
  }
}

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

private void writeVertexProperties(final Writer writer, final Vertex e) throws IOException {
  final Object blueprintsId = e.getId();
  if (!useId) {
    writeKey(writer, vertexIdKey);
    if (blueprintsId instanceof Number) {
      writeNumberProperty(writer, (Number) blueprintsId);
    } else {
      writeStringProperty(writer, blueprintsId);
    }
  }
  writeProperties(writer, e);
}

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

public static void dumpRelationship(Edge relationship) {
 System.out.println(String.format("%s [%s->%s] (%s)", 
   relationship.getId(), relationship.getVertex(Direction.OUT).getId(),
   relationship.getVertex(Direction.IN).getId(),
   relationship.getLabel()));
 dumpProperties(relationship);
}

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

@Test
public void idsAreTranslated() {
 TinkerGraphUtil tgu = new TinkerGraphUtil(graph, curieUtil);
 Vertex v = tgu.addNode(node);
 assertThat(v.getId(), is((Object)"0"));
}

相关文章