graph - hasNot() 在 Gremlin 中应该如何工作?

标签 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]

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

它没有返回结果。哪个是对的?

最佳答案

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

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

请按照那里的决议。

关于graph - hasNot() 在 Gremlin 中应该如何工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27270155/

相关文章:

Gremlin 按最大属性过滤

node.js - 使用 cassandra 和 elasticsearch 后端制作我的 titan 数据库图

scala - 是否可以为顶点中的标签建立索引

python - 如何让 Titan 图形数据库与 Python 一起工作?

java - 将 Java 类的实例传输到 xml 文件中

graph - 对于给定的遍历 gremlin 查询,如何在所有访问过的节点/边上应用静态步骤

java - 检查图是否完全连接 - java

algorithm - 图中唯一顶点权重的最大总和

gremlin - 获取 Gremlin Server 的版本

python-3.x - Gremlin 服务器连接到 Orient DB