org.janusgraph.core.JanusGraph.vertices()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(94)

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

JanusGraph.vertices介绍

暂无

代码示例

代码示例来源:origin: apache/atlas

@Override
public Iterable<AtlasVertex<AtlasJanusVertex, AtlasJanusEdge>> getVertices() {
  Iterator<Vertex> vertices = getGraph().vertices();
  return wrapVertices(vertices);
}

代码示例来源:origin: org.jboss.windup.web.addons/windup-web-support-impl

@Override
public List<Map<String, Object>> getEdges(Long executionID, Integer vertexID, String edgeDirection, String edgeLabel, Boolean dedup)
{
  GraphContext graphContext = getGraph(executionID);
  if (vertexID == null)
    throw new IllegalArgumentException("ID not specified");
  Vertex vertex = graphContext.getGraph().vertices(vertexID).next();
  List<Map<String, Object>> vertices = new ArrayList<>();
  Iterator<Vertex> relatedVertices = vertex.vertices(Direction.valueOf(edgeDirection), edgeLabel);
  while (relatedVertices.hasNext())
  {
    Vertex v = relatedVertices.next();
    vertices.add(convertToMap(executionID, v, 0, dedup));
  }
  return vertices;
}

代码示例来源:origin: apache/atlas

@Override
public AtlasVertex<AtlasJanusVertex, AtlasJanusEdge> getVertex(String vertexId) {
  Iterator<Vertex> it     = getGraph().vertices(vertexId);
  Vertex           vertex = getSingleElement(it, vertexId);
  return GraphDbObjectFactory.createVertex(this, vertex);
}

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

@Override
public void vertexPropertyChanged(Vertex element, Property oldValue, Object setValue, Object... vertexPropertyKeyValues)
{
  String key = oldValue.key();
  if (!FileModel.FILE_PATH.equals(key))
    return;
  FileService fileService = new FileService(event.getGraphContext());
  // Reload it to make sure that we have one that is attached to the graph
  element = event.getGraphContext().getGraph().vertices(element.id()).next();
  FileModel model = fileService.frame(element);
  if (model.isDirectory())
    return;
  Map<String, List<Class<? extends WindupVertexFrame>>> mappings = FileMapping.getMappings(event);
  // Compare the value being set to "fileType" against file mapping patterns.
  // If it matches, add the vertex types to this vertex.
  for (Entry<String, List<Class<? extends WindupVertexFrame>>> entry : mappings.entrySet())
  {
    String pattern = entry.getKey();
    List<Class<? extends WindupVertexFrame>> types = entry.getValue();
    if (((String) setValue).matches(pattern))
    {
      for (Class<? extends WindupVertexFrame> type : types)
      {
        GraphService.addTypeToModel(event.getGraphContext(), model, type);
      }
      LOG.fine("Mapped file [" + model.getFilePath() + "] matching pattern [" + pattern + "] "
            + "to the following [" + types.size() + "] types: " + types);
    }
  }
}

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

@Override
public void vertexPropertyChanged(Vertex element, Property oldValue, Object setValue, Object... vertexPropertyKeyValues)
{
  String key = oldValue.key();
  if (!FileModel.FILE_PATH.equals(key))
    return;
  FileService fileService = new FileService(event.getGraphContext());
  // Reload it to make sure that we have one that is attached to the graph
  element = event.getGraphContext().getGraph().vertices(element.id()).next();
  FileModel model = fileService.frame(element);
  if (model.isDirectory())
    return;
  Map<String, List<Class<? extends WindupVertexFrame>>> mappings = FileMapping.getMappings(event);
  // Compare the value being set to "fileType" against file mapping patterns.
  // If it matches, add the vertex types to this vertex.
  for (Entry<String, List<Class<? extends WindupVertexFrame>>> entry : mappings.entrySet())
  {
    String pattern = entry.getKey();
    List<Class<? extends WindupVertexFrame>> types = entry.getValue();
    if (((String) setValue).matches(pattern))
    {
      for (Class<? extends WindupVertexFrame> type : types)
      {
        GraphService.addTypeToModel(event.getGraphContext(), model, type);
      }
      LOG.fine("Mapped file [" + model.getFilePath() + "] matching pattern [" + pattern + "] "
            + "to the following [" + types.size() + "] types: " + types);
    }
  }
}

相关文章