我是图形数据库和 Gremlin 的新手。我想要实现的是向数据库提出一个简单的问题。提供实体的 id 和文件的 id,我想找到通过共享访问此文件的所有其他实体,并返回具有共享属性“类型”的结果。这是图表本身:
我尝试了什么:
g.V("Enity:1").out("Created").hasLabel("Share").where(out("Shared").hasId("File:1")).in("Access").path()
这让我回想起:
[
{
//Omitted empty aray
"objects": [
{
"id": "dseg:/Entity/1",
"label": "Entity",
"type": "vertex",
"properties": {}
},
{
"id": "dseg:/Share/1",
"label": "Share",
"type": "vertex",
"properties": {}
},
{
"id": "dseg:/Entity/1",
"label": "Entity",
"type": "vertex",
"properties": {}
}
]
},
{
//Omitted empty aray
"objects": [
{
"id": "dseg:/Entity/1",
"label": "Entity",
"type": "vertex",
"properties": {}
},
{
"id": "dseg:/Share/1",
"label": "Share",
"type": "vertex",
"properties": {}
},
{
"id": "dseg:/Entity/3",
"label": "Entity",
"type": "vertex",
"properties": {}
}
]
}
]
它显示了从入口点(实体:1)到目标实体 2 和 3 的路径
我的技术细节问题:有没有办法在我选择的 Entity:1 或中间顶点之后开始收集 path() ,这样我就只能得到有权访问它的 Share + Entity ?