从neo4j数据库中提取子图 [英] Extracting subgraph from neo4j database

查看:142
本文介绍了从neo4j数据库中提取子图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在neo4j数据库中有一个图形.我想提取给定特定节点和特定深度的子图.
我尝试使用遍历框架,但它仅返回一组路径.它给出了到达特定深度的路径. 如何根据获得的路径集构造子图?还有其他方法可以得到所需的结果吗?

I have a graph in neo4j database. I want to extract a sub graph given a particular node and a particular depth.
I tried using the traversal framework, but it only returns a set of paths. It gives path up to a particular depth. How can i construct a sub graph based on the set of paths that i get? Is there any other way to get the required result?

推荐答案

如果通过子图表示您是节点列表,并且已经从遍历中获取了Path对象,则可以只收集结尾列表中每个路径的节点.

In case that, by subgraph, you mean a list of nodes, and you've got the Path objects from the traversal already, you could just collect the end nodes of each path in a list.

这篇关于从neo4j数据库中提取子图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆