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