Regroup and set group labels

I have some data nodes and several evaluation agencies. Each organization groups some or all of these data and sets its own group label. Our needs are: merge the nodes that were originally grouped together into a new group, and reset the new group label. For example: there are 8 nodes of A, B, C, D, E, F, G, H, I, J, and there are 3 evaluation agencies a, b, ca. The data grouping and labeling of the agency are: A, B is 1 group, C, D, E are 2 groups. The organization's data grouping and grouping labels are: A, F for group 1, C, D for group 2, G for group 3. c The data grouping and grouping labels of the organization are: A, B is group 1, C, E is group 2, G, H is group 3, I, J is group 4. Therefore, our final grouping and group labels are: A, B, F for 1 group, C, D, E for 2 groups, G, H for 3 groups, I, J for 4 groups. What should I do with neo4j?Thank you very much!

Hello @ruanlovelin,

Could you provide some samples of the Cypher you've attempted, and a sample graph of what you're describing? This question reads like an an math exam word problem, and that's not a great way to get help.

Put code within tripple ticks

MATCH (a:Thing)

MATCH (a:Thing)

Post visuals of your graph

It's much easier to see a graph, than build in in your head from a text description. Either screenshots from the Neo4j Browser (I prefer Greenshot), or with a simple graph tool, like Arrows.

Sorry, I did n’t describe it clearly. Now the problem is solved. My problem is : I only have nodes, but no relationship between the nodes, so I can not carry out the next analysis and query. My solution is t: use the attributes shared by the nodes in each group as relationships.Thank you very much!

The next problem I encountered was: I exported some data from neo4j through Brower's "Export CSV". Some of the data has changed. For example: "0000612" is transformed into "612". what should I do?Thank you very much!


If it's an integer, that's normal but if you want to keep the zeros, you can cast as string before to export:



Thank you very much!

No problem, if that's all, you can close this subject:)