简体   繁体   English

如何在ArangoDB中创建子图?

[英]How to create sub graph in ArangoDB?

I am not able to find the way to create subgraph in arangodb. 我找不到在arangodb中创建子图的方法。

no idea to found in the link https://docs.arangodb.com/3.0/AQL/Graphs/index.html how to create subgraph in arangodb ? https://docs.arangodb.com/3.0/AQL/Graphs/index.html链接中找不到方法如何在arangodb中创建子图?

Thanks in advance 提前致谢

When you create the graph in the ArangoDB interface, you will be prompted to list all the node and edge collections. 在ArangoDB界面中创建图形时,将提示您列出所有节点和边缘集合。 Simply choose the subset of node and edge collections you want. 只需选择所需的节点和边集合的子集。 There are equivalent ways to do this via REST and ArangoSH, but ultimately it's the same interface. 有相同的方法可以通过REST和ArangoSH进行此操作,但最终它是相同的接口。

When you create a graph, it can contain many related vertex and edge collections. 创建图形时,它可以包含许多相关的顶点和边集合。 I have some graphs with 9 or more collections. 我有一些具有9个或更多集合的图形。 You don't have to worry about creating a subgraph because ArangoDB will only use the collections that relate to your query. 您不必担心创建子图,因为ArangoDB将仅使用与您的查询相关的集合。

So if you perform a query of all inbound connected vertices to a particular vertex you specify, ArangoDB will work out which edge and vertex collections to use to answer your query. 因此,如果对指定的特定顶点执行所有入站连接顶点的查询,则ArangoDB会确定要使用哪些边和顶点集合来回答您的查询。

This is really powerful, as you don't have to track how collections are bound to each other in a 'graph space' rather just query it and the database handles it for you. 这确实非常强大,因为您不必跟踪集合在“图形空间”中的相互绑定方式,而只需查询它,数据库即可为您处理。

It is possible to reuse vertex and edge collections over multiple graphs, this can be useful if you want to reuse data in different groupings. 可以在多个图形上重用顶点和边集合,如果要重用不同分组中的数据,这可能很有用。

For me, I see graphs as another type of collection, which are really just a collection of connected vertex and edge collections. 对我而言,我将图视为另一种类型的集合,它实际上只是连接的顶点和边集合的集合。 When you query the scope of that graph it uses it's graph definition to limit the scope of path traversals. 当查询该图的范围时,它使用它的图定义来限制路径遍历的范围。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM