在java中的gremlin titan中过滤出顶点数量上的顶点 [英] filter vertices on number of outgoing edges in gremlin titan in java

查看:118
本文介绍了在java中的gremlin titan中过滤出顶点数量上的顶点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Java中的gremlin查询和过滤titan中具有超过500个向外边缘的所有顶点...我该怎么做?我已经开始如下

I want to query and filter all vertices with more than 500 outgoing edges in titan using gremlin in java...how do i do this?I have started off as below

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

推荐答案

然后,您需要一个过滤器功能

You then need a filter function

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的详细说明此处

Using GremlinPipeline in Java is described more here

这篇关于在java中的gremlin titan中过滤出顶点数量上的顶点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆