-
Notifications
You must be signed in to change notification settings - Fork 7
fix: Fixed duplicated nodes and edges from multi-label nodes #125
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
andreachild
reviewed
Aug 6, 2025
andreachild
reviewed
Aug 7, 2025
kmcginnes
reviewed
Aug 7, 2025
kmcginnes
reviewed
Aug 7, 2025
kmcginnes
reviewed
Aug 7, 2025
kmcginnes
reviewed
Aug 7, 2025
kmcginnes
reviewed
Aug 7, 2025
kmcginnes
reviewed
Aug 7, 2025
kmcginnes
reviewed
Aug 7, 2025
kmcginnes
reviewed
Aug 11, 2025
…duplicated nodes and edges
andreachild
approved these changes
Aug 12, 2025
kmcginnes
approved these changes
Aug 13, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a bug where multi-label nodes would duplicate edges as the function
(which looks at a specific edge type in the graph database to see what kinds of nodes it connects, creating a list of all the
different from-to label pairs for that relationship) used nested for loops to go through all combinations of fromLabel and toLabel arrays. When nodes had multiple labels, this created duplicate edge directions since each label combination would generate a separate entry in edgeStructure.directions, even if the actual relationship between the node types was the same.
Also, the function
(which gets all the different node types in the graph database by querying for all nodes and their labels, then adds
each label to the schema structure) generated duplicated nodes in the generated schema as the original code was processing node labels without checking for duplicates, causing the same node label to be added multiple times
to schema.nodeStructures.
The fix creates a new empty set every time the function is called to store every processed edge or node in order to check that it has not been previously processed.