amazon-web-services - 有没有办法在 Amazon Neptune Graph 的边缘存储更多信息?

标签 amazon-web-services gremlin tinkerpop amazon-neptune

我正在做一个小型 POC 项目,我想在其中使用 Amazon 的 Neptune Graph 表示一个村庄的道路网络。

我打算在此图中将交叉路口用作顶点,将街道用作边。一个简单的表示是:

Intersection {
   id: 1089238983,
   name: 'Madrid & 99th'
   labels: ['has_pedestrian_signals', 'four_way_intersection']
}

Street {
   id: 9808787868,
   name: 'Madrid St'
   from_int_id: 1089238983,
   to_int_id: 1089238973, 
   labels: ['has_hospital_on_street', 'is_snow_route', 'is_one_way_street']
}

事情是AWS's documentation声明边只能有 1 个标签。

我希望最终能够根据边的属性进行遍历。我曾尝试寻找将更多数据合并到 Tinkerpop 图表中的方法,但没有找到任何有用的方法。

如果有任何建议,我将不胜感激。

最佳答案

Gremlin 确实像支持顶点属性一样支持边属性。 http://tinkerpop.apache.org/docs/3.4.6/reference/#addedge-step

// define 'a' and 'b' vertices
g.addE('friendlyCollaborator').from('a').to('b').
                 property(id,23).property('project',select('c').values('name'))

唯一的标注是,与仅读取边缘标签相比,获取边缘属性是一个额外的跃点。

例如:

g.V(1).outE('knows') -> Gets the matching out edge in 2 hops.
g.V(1).outE().hasProperty('knows') -> An added hop to get to your edge.

关于amazon-web-services - 有没有办法在 Amazon Neptune Graph 的边缘存储更多信息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61072354/

相关文章:

amazon-web-services - aws s3 是否同步 s3 ://mybucket s3://mybucket2 copy files to local?

gremlin - 如何在 gremlin 中搜索相同 propertykey 的多个值

groovy - 比较 Gremlin Groovy 中的顶点属性

java - 使用 Titan 或 TinkPop Java api 查找顶点/节点

amazon-web-services - Cloudformation 创建的 Autoscaling 组超时

amazon-web-services - CloudFormation 嵌套堆栈名称

amazon-web-services - AWS Cognito USER_PASSWORD_AUTH "Initiate Auth method not supported."

graph-databases - 获取ID + Gremlin上顶点的图?

azure - Cosmos DB 图边缘分区

graph - 我可以使用 CosmosDB(图形 API)中的触发器根据文档负载自动创建边缘吗?