计算Neo4j中的原语

时间:2009-07-10 18:37:00

标签: java neo4j

我一直在阅读documentationneo4j并且它是components并且尚未遇到让我查询基元总数(节点,关系和属性)的功能)在图中。这个功能是否存在于某个地方,或者我是否必须编写遍历整个图表的代码?

2 个答案:

答案 0 :(得分:7)

感谢您的提问!我是Neo4j团队的成员,目前我们有商业工具报告此类信息。但是,API的扩展计划用于下一个开源版本。目前您可以使用以下非官方API:

EmbeddedNeo.getConfig().getNeoModule().getNodeManager().getNumberOfIdsInUse(Class)

该课程为Node.classRelationship.classPropertyStore.class

答案 1 :(得分:1)

这对我有用:

import org.neo4j.kernel.impl.nioneo.store.PropertyStore

graph.getConfig().getGraphDbModule().getNodeManager().getNumberOfIdsInUse(Node.class);
graph.getConfig().getGraphDbModule().getNodeManager().getNumberOfIdsInUse(Relationship.class);
graph.getConfig().getGraphDbModule().getNodeManager().getNumberOfIdsInUse(PropertyStore.class)