2016-11-07 39 views
2

我想重複一個有點穿越的小鬼,像這樣的:使用通過妖精通過數目到小鬼在python

g.V(1).repeat(out()).times(1) 

goblin包蟒蛇,和默認titan11安裝(這是,我想,泰坦+ casssandra + gremlin + elasticsearch,但是,這個東西很混亂)。

在Python中我寫或多或少完全一樣的東西上面,做了一些特殊的進口後:

from gremlin_python import statics 
from gremlin_python.process.graph_traversal import __ 
statics.load_statics(globals()) 

# ... lots of other badass async python stuff and some networkx stuff etc 

sg = g.V(seed_id).repeat(out()).times(1) 

(見https://github.com/mikedewar/graphLearning/blob/master/conditional_traversal.py#L107所有其他位和羈絆,如果你認爲它可以幫助)

當我遍歷sg遍歷使用妖精,我從得到一個Java錯誤,我認爲,精怪:

goblin.exception.GremlinServerError: 597: No signature of method: org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal.times() is applicable for argument types: (java.lang.Long) values: [1] 
Possible solutions: toSet(), size(), min(), take(int), sleep(long), is(java.lang.Object) 

所以我想,也許它不喜歡我傳給它的整數。

請幫忙!我希望能夠在gremlin中重複一些東西。

回答

2

這是舊版Groovy翻譯器實現中的一個bug,與Goblin一起提供,以提供與GraphSON版本1的向後兼容性。它導致所有整數被序列化爲長整型。由於times方法簽名需要一個整數,因此導致錯誤。我用這個commit修復它。此修復程序將包含在下一個版本中。現在,請從GitHub安裝:

pip install git+https://github.com/ZEROFAIL/goblin.git 

我知道你並不確定這個問題的來源,但也許在未來Github的問題將是一個更好的地方開始。

+0

謝謝!我真的認爲這是我的不好;不想因爲真正的用戶錯誤(我明顯濫用堆棧溢出...)的問題來破壞你的回購。 –