Ada*_*yga 3 graph gremlin titan tinkerpop
如果给定的顶点没有特定的属性,g.V.hasNot('non-existent-property', 'value')
查询的结果应该是什么
?顶点是否应该由这样的查询发出?
使用 TinkerPop 和 Titan 的内存图时,我得到了矛盾的结果:
gremlin> g = TinkerGraphFactory.createTinkerGraph()
==>tinkergraph[vertices:6 edges:6]
gremlin> g.V.hasNot("abcd", true)
==>v[1]
==>v[2]
==>v[3]
==>v[4]
==>v[5]
==>v[6]
Run Code Online (Sandbox Code Playgroud)
以上对我来说很好 - 顶点没有指定的属性(设置为true
),所以所有都返回。但是如果我在 Titan 的内存图中做类似的事情:
gremlin> g2 = TitanFactory.open(com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.buildConfiguration().set(com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.STORAGE_BACKEND, "inmemory"))
==>titangraph[inmemory:[127.0.0.1]]
gremlin> g2.addVertex(null)
==>v[256]
gremlin> g2.V.hasNot("abcd", true)
Run Code Online (Sandbox Code Playgroud)
它不返回任何结果。哪一个是对的?
只是为了在 SO 中结束这个循环 - 已经为此问题创建了一个 GitHub 问题(TinkerGraph 确实显示了正确的行为):
https://github.com/thinkaurelius/titan/issues/868
请按照那里的决议进行操作。