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

Update openCypher-Exercises-Answer-Key.ipynb #526

Merged
merged 2 commits into from
Aug 29, 2023

Conversation

mverkruyse
Copy link
Contributor

Issue #, if available: N/A

Description of changes:

As mentioned earlier in the notebook, the MERGE clause does not support partial pattern matches. When matching against patterns in MERGE, the matches are either the entire pattern, or the entire pattern is created.

Because the pattern is a partial match, it currently creates a new "person {first_name: 'Dave'}" node for each of the new "person" added to the graph.

By first doing a MERGE for (d:person {first_name: 'Dave'), when the partial match happens, the whole path is again created, but this time linking to the already existing "Dave" rather than creating new ones each time.
current_solution
proposed_solution

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

mverkruyse and others added 2 commits August 25, 2023 14:34
As mentioned earlier in the notebook, the `MERGE` clause does not support partial pattern matches.  When matching against patterns in `MERGE`, the matches are either the entire pattern, or the entire pattern is created.

Because the pattern is a partial match, it currently creates a new "person {first_name: 'Dave'}" node for each of the new "person" added to the graph. 

By first doing a MERGE for (d:person {first_name: 'Dave'), when the partial match happens, the whole path is again created, but this time linking to the already existing "Dave" rather than creating new ones each time.
Copy link
Member

@michaelnchin michaelnchin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mverkruyse !

@michaelnchin michaelnchin merged commit bca10f8 into aws:main Aug 29, 2023
@mverkruyse
Copy link
Contributor Author

Of course, happy to help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Resolved
Development

Successfully merging this pull request may close these issues.

2 participants