作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
下面这段 gremlin 代码在 gremlin 控制台中运行得非常好(它找到了 k-step ego 网络的唯一起点和终点,以及到该端点的最小距离):
g.V(42062000).as("from")
.repeat(both().as("to")).emit().times(3).path()
.count(local).as("pathlen")
.select("from", "to", "pathlen")
.dedup("from", "to").toList()
==>{from=v[42062000], to=v[83607800], plen=2}
==>{from=v[42062000], to=v[23683248], plen=3}
==>{from=v[42062000], to=v[41762840], plen=3}
==>{from=v[42062000], to=v[42062000], plen=3}
==>{from=v[42062000], to=v[83599456], plen=3}
as
替换
as_
之后),我得到了错误
TypeError: Object of type GraphTraversal is not JSON serializable
,即使它是相同的查询。
最佳答案
进口static
类使用
from gremlin_python import statics
statics.load_statics(globals())
或者
from gremlin_python.process.graph_traversal import elementMap, range_,
local, count
和普通
reserved
单词必须以
_
结尾
as_, range_
关于Gremlin - 类型错误 : Object of type GraphTraversal is not JSON serializable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57115147/
我正在使用Tinkerpop3 Gremlin对照引用 TinkerGraph 实现。 我正在尝试.next()一个Vertex出这个遍历: graph.V().has(T.label, "link"
我有看起来像那样的 GraphTraversals(attrGroup: GraphTraversal attrGroupTraversal = some code generates it; Lis
如何从 Java GraphTraversal 对象输出 Gremlin 查询?默认输出 (graphTraversal.toString()) 看起来像 [HasStep([~label.eq(br
下面这段 gremlin 代码在 gremlin 控制台中运行得非常好(它找到了 k-step ego 网络的唯一起点和终点,以及到该端点的最小距离): g.V(42062000).as("from"
我是一名优秀的程序员,十分优秀!