-
Notifications
You must be signed in to change notification settings - Fork 64
Graph type update for Cypher 5 Constraints #1395
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
base: cypher-5
Are you sure you want to change the base?
Conversation
This PR includes documentation updates New pages: Updated pages: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for not reviewing this before Jens left
* xref:constraints/list-constraints.adoc[] | ||
* xref:constraints/drop-constraints.adoc[] | ||
For reference material about the Cypher commands used to manage constraints, see xref:constraints/syntax.adoc#constraints[Syntax -> Constraints]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the syntax page has a Constraints
header or tag 🤔
For reference material about the Cypher commands used to manage constraints, see xref:constraints/syntax.adoc#constraints[Syntax -> Constraints]. | |
For reference material about the Cypher commands used to manage constraints, see xref:constraints/syntax.adoc[Syntax]. |
It may still throw an error if conflicting data, indexes, or constraints exist. | ||
Examples of this are nodes with missing properties, indexes with the same name, or constraints with same schema but a different conflicting constraint type. | ||
As of Neo4j 5.17, an informational notification is returned in case nothing happens showing the existing constraint which blocks the creation. | ||
An informational notification is returned in case nothing happens showing the existing constraint which blocks the creation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to keep the info on when the notification was added for Cypher 5 docs?
An informational notification is returned in case nothing happens showing the existing constraint which blocks the creation. | |
As of Neo4j 5.17, an informational notification is returned in case nothing happens showing the existing constraint which blocks the creation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was under the general impression we still had these for Cypher 5 to cover the 5.x releases, but has that changed so we don't want to keep it since Cypher 5 was frozen 2025.06?
|NODE [PROPERTY] UNIQUE[NESS] | ||
|REL[ATIONSHIP] [PROPERTY] UNIQUE[NESS] | ||
|[PROPERTY] UNIQUE[NESS] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, PROPERTY
isn't available for uniqueness constraint filtering in Cypher 5 (it was only added to Cypher 25)
|NODE [PROPERTY] UNIQUE[NESS] | |
|REL[ATIONSHIP] [PROPERTY] UNIQUE[NESS] | |
|[PROPERTY] UNIQUE[NESS] | |
|NODE UNIQUE[NESS] | |
|REL[ATIONSHIP] UNIQUE[NESS] | |
|UNIQUE[NESS] |
|NODE [PROPERTY] UNIQUE[NESS] | ||
|REL[ATIONSHIP] [PROPERTY] UNIQUE[NESS] | ||
|[PROPERTY] UNIQUE[NESS] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|NODE [PROPERTY] UNIQUE[NESS] | |
|REL[ATIONSHIP] [PROPERTY] UNIQUE[NESS] | |
|[PROPERTY] UNIQUE[NESS] | |
|NODE UNIQUE[NESS] | |
|REL[ATIONSHIP] UNIQUE[NESS] | |
|UNIQUE[NESS] |
This means its default behavior is to throw an error if an attempt is made to drop the same constraint twice. | ||
With the `IF EXISTS` flag, no error is thrown and nothing happens should the constraint not exist. | ||
As of Neo4j 5.17, an informational notification is instead returned detailing that the constraint does not exist. | ||
Instead, an informational notification is returned detailing that the constraint does not exist. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here as above, shouldn't we keep the introduction version in Cypher 5 docs?
Instead, an informational notification is returned detailing that the constraint does not exist. | |
As of Neo4j 5.17, an informational notification is instead returned detailing that the constraint does not exist. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was under the general impression we still had these for Cypher 5 to cover the 5.x releases, but has that changed so we don't want to keep it since Cypher 5 was frozen 2025.06?
(I'm adding this part to all comments that are relevant for the 5.x vs calVar updates, you don't need to answer all threads with the same info, was more to be able to separate them from the others that are cypher 5 vs cypher 25 changes)
[source, error] | ||
---- | ||
An equivalent constraint already exists, 'Constraint( id=5, name='sequels', type='RELATIONSHIP UNIQUENESS', schema=()-[:SEQUEL_OF {order}]-(), ownedIndex=4 )'. | ||
An equivalent constraint already exists, 'Constraint( id=5, name='sequels', type='RELATIONSHIP PROPERTY UNIQUENESS', schema=()-[:SEQUEL_OF {order}]-(), ownedIndex=4 )'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An equivalent constraint already exists, 'Constraint( id=5, name='sequels', type='RELATIONSHIP PROPERTY UNIQUENESS', schema=()-[:SEQUEL_OF {order}]-(), ownedIndex=4 )'. | |
An equivalent constraint already exists, 'Constraint( id=5, name='sequels', type='RELATIONSHIP UNIQUENESS', schema=()-[:SEQUEL_OF {order}]-(), ownedIndex=4 )'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was under the general impression we still had these for Cypher 5 to cover the 5.x releases, but has that changed so we don't want to keep it since Cypher 5 was frozen 2025.06?
(I'm adding this part to all comments that are relevant for the 5.x vs calVar updates, you don't need to answer all threads with the same info, was more to be able to separate them from the others that are cypher 5 vs cypher 25 changes)
[NOTE] | ||
The constraint type will be updated to say `RELATIONSHIP PROPERTY UNIQUENESS` in a future version of Neo4j. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And add back the note (was updated in calVar i believe)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was under the general impression we still had these for Cypher 5 to cover the 5.x releases, but has that changed so we don't want to keep it since Cypher 5 was frozen 2025.06?
(I'm adding this part to all comments that are relevant for the 5.x vs calVar updates, you don't need to answer all threads with the same info, was more to be able to separate them from the others that are cypher 5 vs cypher 25 changes)
[source, error] | ||
---- | ||
Constraint already exists: Constraint( id=3, name='book_isbn', type='UNIQUENESS', schema=(:Book {isbn}), ownedIndex=2 ) | ||
Constraint already exists: Constraint( id=3, name='book_isbn', type='NODE PROPERTY UNIQUENESS', schema=(:Book {isbn}), ownedIndex=2 ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
Constraint already exists: Constraint( id=3, name='book_isbn', type='NODE PROPERTY UNIQUENESS', schema=(:Book {isbn}), ownedIndex=2 ) | |
Constraint already exists: Constraint( id=3, name='book_isbn', type='UNIQUENESS', schema=(:Book {isbn}), ownedIndex=2 ) |
and the note below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was under the general impression we still had these for Cypher 5 to cover the 5.x releases, but has that changed so we don't want to keep it since Cypher 5 was frozen 2025.06?
(I'm adding this part to all comments that are relevant for the 5.x vs calVar updates, you don't need to answer all threads with the same info, was more to be able to separate them from the others that are cypher 5 vs cypher 25 changes)
[source, error] | ||
---- | ||
Constraint already exists: Constraint( id=7, name='book_title_year', type='UNIQUENESS', schema=(:Book {title, publicationYear}), ownedIndex=6 ) | ||
Constraint already exists: Constraint( id=7, name='book_title_year', type='NODE PROPERTY UNIQUENESS', schema=(:Book {title, publicationYear}), ownedIndex=6 ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Constraint already exists: Constraint( id=7, name='book_title_year', type='NODE PROPERTY UNIQUENESS', schema=(:Book {title, publicationYear}), ownedIndex=6 ) | |
Constraint already exists: Constraint( id=7, name='book_title_year', type='UNIQUENESS', schema=(:Book {title, publicationYear}), ownedIndex=6 ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was under the general impression we still had these for Cypher 5 to cover the 5.x releases, but has that changed so we don't want to keep it since Cypher 5 was frozen 2025.06?
(I'm adding this part to all comments that are relevant for the 5.x vs calVar updates, you don't need to answer all threads with the same info, was more to be able to separate them from the others that are cypher 5 vs cypher 25 changes)
[source, error] | ||
---- | ||
Unable to create Constraint( name='book_title', type='UNIQUENESS', schema=(:Book {title}) ): | ||
Unable to create Constraint( name='book_title', type='NODE PROPERTY UNIQUENESS', schema=(:Book {title}) ): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unable to create Constraint( name='book_title', type='NODE PROPERTY UNIQUENESS', schema=(:Book {title}) ): | |
Unable to create Constraint( name='book_title', type='UNIQUENESS', schema=(:Book {title}) ): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was under the general impression we still had these for Cypher 5 to cover the 5.x releases, but has that changed so we don't want to keep it since Cypher 5 was frozen 2025.06?
(I'm adding this part to all comments that are relevant for the 5.x vs calVar updates, you don't need to answer all threads with the same info, was more to be able to separate them from the others that are cypher 5 vs cypher 25 changes)
ToDo:
Related PRs: