简体   繁体   English

如何在 apache tinkerpop gremlin 或图形数据库中实现查找/引用数据?

[英]How to implement lookup/reference data in apache tinkerpop gremlin or graph database?

How to implement lookup/reference data in a gremlin or graph database ?如何在gremlin or graph database中实现lookup/reference数据?

I need to collect all types of identification ,我需要收集所有类型的identification

1. Diving license,
2. Social security number,
3....

For UI, I need to send the "identification_type" list (above list).对于 UI,我需要发送"identification_type"列表(上方列表)。

& &

What is the best way to implement this?实现这个的最佳方法是什么? Create an edge b/w type and actual value?创建edge黑白类型和实际值? or type as a property ?或类型作为property

The model mostly depends on your required queries. model 主要取决于您所需的查询。 Will you be looking at persons who share the same SSN or driving license (Lots of fraud detection work that way), then use an edge to a node with a value.您是否会查看共享相同 SSN 或驾驶执照的人(很多欺诈检测都是这样工作的),然后使用边缘到具有值的节点。 If you don't care about users who have the same identification values, then simply use node properties.如果您不关心具有相同标识值的用户,那么只需使用节点属性即可。

As Tomaž Bratanič had answered , graph modeling depends on your needs(pattern of querying).正如 Tomaž Bratanič回答的那样,图形建模取决于您的需求(查询模式)。

For example, tradeoff in detail:例如,详细权衡:

Putting the SSN as a node/vertex will make the query pattern: Find vertices/nodes with certain SSN easier as underlying it's a native graph query, where you are doing graph walk/traverse from a starting vertex/node.将 SSN 作为节点/顶点将使查询模式成为可能: Find vertices/nodes with certain SSN更容易,因为它是本机图形查询的基础,您正在从起始顶点/节点进行图形遍历/遍历。

Instead, putting SSN into different types of nodes/vertices(different labels/tags) as a property will make that query more costly in a graph database, where, it will scan nodes/vertices' properties(and if we index/make an ordered duplicated data for this to accelerate such query pattern, the writing path will be more costly comparing).相反,将 SSN 作为属性放入不同类型的节点/顶点(不同的标签/标签)将使该查询在图形数据库中的成本更高,它将扫描节点/顶点的属性(如果我们索引/制作一个有序的重复数据为此加速此类查询模式,写入路径将比较昂贵)。 The PRO of this property approach will make the query pattern/partial query pattern of Fetch node/vertex properties less costly.这种property approach的 PRO 将使Fetch node/vertex properties的查询模式/部分查询模式的成本更低。

One experience I also could share when designing the graph model is, to do it following your intuition(as graph model is intuitive).在设计图表 model 时,我也可以分享一个经验,就是按照你的直觉去做(因为图表 model 很直观)。 Revisit/revise it when your system involves.当您的系统涉及时,重新访问/修改它。

Also, put some ref from Nebula Graph, the project I am working on;)另外,放一些来自 Nebula Graph 的参考,这是我正在从事的项目;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.io.InvalidClassException:org.apache.tinkerpop.gremlin.hadoop.structure.HadoopConfiguration; 无法创建实例 - java.io.InvalidClassException: org.apache.tinkerpop.gremlin.hadoop.structure.HadoopConfiguration; unable to create instance SQL 图数据库 VS Cosmos Gremlin 图数据库 - SQL Graph Database VS Cosmos Gremlin graph DB 使用 TinkerPop Gremlin 和 Java 从 GraphTraversal 操作中获取结果 - Get result from GraphTraversal operations with TinkerPop Gremlin and Java Gremlin-Lambda - 如何自动创建图形 - Gremlin-Lambda - how to automate graph creation Gremlin 加载数据格式 - Gremlin load data format Neo4j cypher查询对应的Gremlin查询如何实现? - How to implement Gremlin query corresponding to Neo4j cypher query? 如何为 Apache Beam/Dataflow 经典模板(Python)和数据管道实现 CI/CD 管道 - How to implement a CI/CD pipeline for Apache Beam/Dataflow classic templates (Python) & data pipelines Firebase 实时数据库,如何通知引用中没有数据 - Firebase Realtime database, how to notify there is no data in a reference Neptune,Python,Gremlin:使用值数组更新图形顶点中的属性 - Neptune, Python, Gremlin: Update a property in a graph vertex with an array of values 使用来自 Go 的 Gremlin 在 Neptune 中创建图形时出错 - Error creating graph in Neptune using Gremlin from Go
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM