【问题标题】:filter vertices on number of outgoing edges in gremlin titan in java在java中的gremlin titan中过滤出边数的顶点
【发布时间】:2014-05-18 17:37:46
【问题描述】:

我想在 java 中使用 gremlin 在 Titan 中查询和过滤所有出边超过 500 个的顶点...我该怎么做?我开始如下

    pipe=pipe.start(graph.getVertices());

【问题讨论】:

    标签: java gremlin titan


    【解决方案1】:

    然后你需要一个过滤函数

    p.start(
      g.getVertices()
       .filter(new PipeFunction<Vertex,Boolean>() {    
                 public Boolean compute(Vertex v) {
                   // write your logic here to count edges on the vertex and 
                   // return true if over 500 and false otherwise
                 }));
    

    在 Java 中使用 GremlinPipeline 描述更多 here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-02-06
      • 2017-09-26
      • 1970-01-01
      • 1970-01-01
      • 2016-09-15
      • 1970-01-01
      • 2019-05-14
      • 2023-02-25
      相关资源
      最近更新 更多