3

如果给定的顶点没有特定的属性,那么 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]

以上对我来说很好 - 顶点没有指定的属性(设置为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)

它不返回任何结果。哪一个是对的?

4

1 回答 1

5

只是为了在 SO 中关闭这个循环——已经为这个问题创建了一个 GitHub 问题(TinkerGraph 确实显示了正确的行为):

https://github.com/thinkaurelius/titan/issues/868

请按照那里的决议。

于 2014-12-04T00:44:59.540 回答