【发布时间】:2018-05-16 23:06:27
【问题描述】:
运行下面的命令后,我的 Edge 是这样的:
[
{
"id": "ee186ef3-5b0d-4257-a0ab-cc13dbac1c84",
"label": "parent",
"type": "edge",
"outVLabel": "person",
"outV": "74e99ad8-a6f8-4580-918c-2446acaae48c",
"properties": {
"type": "Mother",
"age": "56"
}
}
]
注意边缘上没有 inV。
运行的命令是这样的:
g.V('74e99ad8-a6f8-4580-918c-2446acaae48c')
.inE('parent')
.has('type', 'Mother')
.property('age', '56')
在运行命令之前,关系是正确的 V -> E -> V
这是通过 C# .net 应用程序执行的
***** 编辑 -- 复制信息 ******
var query = client.CreateGremlinQuery<dynamic>(graph, gremlin);
var result = (await query.ExecuteNextAsync() as FeedResponse<object>);
运行命令前:
[{
"id": "7d3f2d1e-fb73-4e5d-a1b1-ea27fc429ce6",
"label": "parent",
"type": "edge",
"inVLabel": "person",
"outVLabel": "person",
"inV": "1c0d509f-6741-4555-8081-536b0c0b8667",
"outV": "f8da3c1c-0f32-4b5c-ace3-1673836807a1",
"properties": {
"type": "Mother"
}
}]
下一步是运行这个:
g.V('1c0d509f-6741-4555-8081-536b0c0b8667').inE('parent').has('type', 'Mother').property('age', '56')
服务器返回的结果:
{{
"id": "7d3f2d1e-fb73-4e5d-a1b1-ea27fc429ce6",
"label": "parent",
"type": "edge",
"inVLabel": "person",
"outVLabel": "person",
"inV": "1c0d509f-6741-4555-8081-536b0c0b8667",
"outV": "f8da3c1c-0f32-4b5c-ace3-1673836807a1",
"properties": {
"type": "Mother"
}
}}
在上面之后,我运行这个: g.E("7d3f2d1e-fb73-4e5d-a1b1-ea27fc429ce6")
结果:
[{
"id": "7d3f2d1e-fb73-4e5d-a1b1-ea27fc429ce6",
"label": "parent",
"type": "edge",
"outVLabel": "person",
"outV": "1c0d509f-6741-4555-8081-536b0c0b8667",
"properties": {
"type": "Mother",
"age": "56"
}
}]
【问题讨论】:
标签: graph azure-cosmosdb gremlin