2014-12-03 71 views
0

如果給定的頂點不是有一個特定的屬性,應該是什麼結果 g.V.hasNot('non-existent-property', 'value')查詢?頂點應該由這樣的查詢發出?hasNot()應該如何在Gremlin中工作?

我使用TinkerPop有關和土衛六的內存曲線圖,當得到相反的結果:

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),這樣所有被返回。但是如果我在泰坦的內存圖中做類似的話:

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) 

它不返回任何結果。哪一個是對的?

回答

3

剛剛在這裏結束循環這個在SO - 一個GitHub的問題一直爲這個問題創建(TinkerGraph確實表現出正確的行爲):

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

請注意該決議在那裏。

+0

很酷,謝謝 – 2014-12-04 09:02:58