【发布时间】:2021-10-11 11:31:30
【问题描述】:
如何在 Gremlin 查询中检索从根顶点开始的所有顶点属性?
我们有以下结构:
根顶点:员工
优势:教育公司、教育部门、教育角色
顶点:公司、部门、角色
我们正在尝试接收与根顶点连接的其他顶点的数据。 有这样的想法:
{
"employee": [
{
"id": "1",
"label": "Employee",
"type": "vertex",
"properties": { ... },
"company": {
"id": "A220",
"label": "Company",
"type": "vertex",
"properties": { ... },
},
"department": { ... },
"edge": { ... }
},
{ ... }
]
}
我们已经尝试过该查询,但返回了一个复杂的 JSON:
g.V().hasLabel("Employee").inE().outV().tree()
编辑:
我们也尝试过 Kelvin 建议的查询:
g.V().hasLabel("Employee").inE().outV().tree().by(valueMap())
Stacktrace:
提交查询失败:gV().hasLabel("Employee").inE().outV().tree().by(valueMap()):服务器序列化错误: ActivityId:29f4b64e-c476-44b8-8e35-a07dd31d4242 ExceptionType:GraphSerializeException ExceptionMessage:Gremlin 序列化错误:GraphSON V1_0 序列化程序无法将类型对象序列化:MapField 为原始值以执行所需的 Gremlin 步骤
【问题讨论】:
标签: json gremlin azure-cosmosdb-gremlinapi gremlinnet