【发布时间】:2014-05-18 17:37:46
【问题描述】:
我想在 java 中使用 gremlin 在 Titan 中查询和过滤所有出边超过 500 个的顶点...我该怎么做?我开始如下
pipe=pipe.start(graph.getVertices());
【问题讨论】:
我想在 java 中使用 gremlin 在 Titan 中查询和过滤所有出边超过 500 个的顶点...我该怎么做?我开始如下
pipe=pipe.start(graph.getVertices());
【问题讨论】:
然后你需要一个过滤函数
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
【讨论】: