如果给定的顶点没有特定的属性,那么
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)
它不返回任何结果。哪一个是对的?