内存中的 JanusGraph 用于测试

JanusGraph in memory for testing

如何在 python 中创建用于测试目的的内存图,而无需专门配置 gremlin 服务器 - 类似于 here

graph = JanusGraphFactory.build().set('storage.backend', 'inmemory').open()

我正在使用 gremlin-python 但无法构建图形,而是连接到一个图形。

我当然可以使用内存后端启动和配置 gremlin 服务器,然后连接到它。但考虑到我想在内存中用于测试目的,这似乎是多余的

JanusGraph 是用Java编写的图数据库。 JanusGraph 没有本机 Python 实现,因此您需要使用使用 inmemory 存储后端的配置来配置 Gremlin 服务器。

gremlin.graph=org.janusgraph.core.JanusGraphFactory
storage.backend=inmemory

查看此 gist 以了解有关完整配置的更多详细信息。