JanusGraph:在不迭代的情况下计算顶点上的入射边数

时间:2019-04-02 19:51:13

标签: tinkerpop janusgraph

考虑到org.apache.tinkerpop.gremlin.structure.Vertex,JanusGraph中有一种方法可以计算不需要迭代所有边缘的顶点的入射边缘数吗?

这是我在Vertex类上看到的唯一用于边缘检索的方法。

public Iterator<Edge> edges(Direction direction, String... labels) {
    return ((VertexCentricQueryBuilder)((VertexCentricQueryBuilder)this.query().direction(direction)).labels(labels)).edges().iterator();
}

从外观上,它会进一步查询图形数据库以获取该顶点上的边。

我唯一需要知道的是给定标签有多少条边连接到顶点。我担心需要对图形进行额外的调用才能获得优势。

0 个答案:

没有答案
相关问题