Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a configuration option to mergeNodes that allows to combine relationships of the same type and direction #600

Closed
jexp opened this issue Sep 19, 2017 · 4 comments
Assignees

Comments

@jexp
Copy link
Member

jexp commented Sep 19, 2017

So in case of duplicate relationships you don't end up with several of them at the end.

The default would be to not change them
And then there would be the option to combine them by type/direction if the properties are the same
And combine them if the properties differ and then apply the refactoring-config property merge thing

@sylvainroussy
Copy link
Contributor

sylvainroussy commented Nov 16, 2017

Do you want something like that?

apoc.refactor.mergeNodes([node1,node2], config)

Where config looks like:

{
   mergeRelationships : "none | identical | merge"
}

with Exception if two properties with same keys have different values (or not, based on "properties", "overwrite" config).

@AngeloBusato
Copy link
Contributor

@jexp mergeRelationships works with rels who has the same start and the same end nodes. So in this case we have to merge end/start nodes too. Right?

@AngeloBusato AngeloBusato self-assigned this Jun 28, 2018
@jexp
Copy link
Member Author

jexp commented Jul 5, 2018

This issue talks about mergeNodes not mergeRelationships ?

@jexp
Copy link
Member Author

jexp commented Jul 5, 2018

I think it's better to have this explicit.

I.e. mergeNodes on node 1 and then mergeNodes on node 2

should leave the relationships in middle merged.

AngeloBusato added a commit to larusba/neo4j-apoc-procedures that referenced this issue Jul 10, 2018
…at allows to combine relationships of the same type and direction
AngeloBusato added a commit to larusba/neo4j-apoc-procedures that referenced this issue Jul 18, 2018
…at allows to combine relationships of the same type and direction
AngeloBusato added a commit to larusba/neo4j-apoc-procedures that referenced this issue Jul 19, 2018
…at allows to combine relationships of the same type and direction
AngeloBusato added a commit to larusba/neo4j-apoc-procedures that referenced this issue Jul 20, 2018
…at allows to combine relationships of the same type and direction
@jexp jexp closed this as completed in e1be94d Jul 21, 2018
jexp pushed a commit that referenced this issue Jul 23, 2018
…combine relationships of the same type and direction (#850)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants