Cypher query to display all disabled Neo4j graph DB graphs?

The Neo4j graph database contains about 50,000 nodes and> 50,000 relationships. There is a main graph that contains most nodes. But there are several charts that are not yet connected to the main chart.

To associate a different graph with one large main graph, I intend to use the Cypher query to list the paths or sets of related nodes ordered by size (the largest unrelated graph).

There are several posts in stackoverflow, for example:

Here is a small sample graph that poses a problem: A sample graph of the Neo4j console

The following Cypher request does not solve the problem, but is a starting point. It lists all those nodes that are not tied to the main chart. It skips the union of these nodes in the node collection. He works on a small chart. On a large chart, it returns "undefined" ... after starting more than 10 minutes.

START s=node(3), n=node(*) MATCH s-[*1..10]-m WITH collect(m) as members, n WHERE NOT n in members RETURN DISTINCT id(n), n.name? ORDER BY id(n) LIMIT 10; 

How to use Cypher to list all disabled (sub) charts?

Environment: - Neo4j - Graph database engine 1.9.M05 kernel - Java - SE runtime (creation 1.7.0_17-b02)

+4
source share
1 answer

This is not a complete answer, but I think you should (if you can) drop the Traversal Framework for this use case.

Cypher is a mapping of certain parts of a chart, no matter how you want to do it. The Traversal structure is really about HOW you want to cross the chart.

In your case, traversal is more important than the corresponding graph. Here is what I suggest, use the Traversal Framework for

  • node label groups you want
  • aggregate results on a map (or something more advanced) while you are on it
+3
source

All Articles