Skip to content

Commit

Permalink
Merge branch 'dev' into 5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
stefano-ottolenghi committed Feb 23, 2024
2 parents e762017 + fba1ab1 commit 10e9899
Show file tree
Hide file tree
Showing 26 changed files with 7,251 additions and 184 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
groups:
prod-dependencies:
dependency-type: "production"
dev-dependencies:
dependency-type: "development"
53 changes: 53 additions & 0 deletions .github/workflows/docs-branch-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This is an example of the docs-pr.yml workflow available from the recrwplay org
name: "Verify Branch"

on:
# push:
# branches:
# - dev
# schedule:
# - cron: '00 16 * * *'
workflow_dispatch:
inputs:
html:
description: 'Generate HTML'
type: boolean
required: false
default: true
links:
description: 'Check links'
type: boolean
required: false
default: true
lint:
description: 'Lint docs'
type: boolean
required: false
default: true

jobs:

docs-build:
if: ${{ inputs.html }}
name: Generate HTML
uses: neo4j/docs-tools/.github/workflows/reusable-docs-build.yml@v1.0.3
with:
retain-artifacts: 14
deploy-id: 0

docs-verify:
name: Verify HTML
needs: docs-build
uses: neo4j/docs-tools/.github/workflows/reusable-docs-verify.yml@v1.0.3

docs-links:
if: ${{ inputs.links }}
name: Check links
needs: docs-build
uses: neo4j/docs-tools/.github/workflows/reusable-docs-links.yml@v1.0.3

docs-lint:
if: ${{ inputs.lint }}
name: Lint docs
uses: neo4j/docs-tools/.github/workflows/reusable-docs-lint.yml@v1.0.3

12 changes: 4 additions & 8 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ To install the required packages:
npm i
----


=== Generating HTML output

To convert asciidoc source to HTML:
Expand All @@ -23,28 +24,22 @@ To convert asciidoc source to HTML:
npm run build
----


=== Viewing HTML output

To view the built site, launch a local server:

. `npm start`
. In a browser tab, go to `localhost:8000`


=== Live preview

When you run `npm start`, the project is monitored for updates to asciidoc files.

If a change to an asciidoc file is detected, the site is automatically rebuilt.


=== Errors

Check for xref errors and other warnings.

----
./node_modules/@antora/cli/bin/antora preview.yml 2>&1 | tee build.log
----

== Raising PRs

=== Branch management
Expand All @@ -59,6 +54,7 @@ The docs-cypher repo (and all CoreDB docs repos) will contain the following bran
Within Github we’ll update the branch descriptions with what the current and next versions are.
* Work on older branches (`3.5`, `4.0`, `4.1`, `4.2`, `4.3`) should be seen as “only when absolutely necessary”.


=== Raising PRs, and the publishing process

Here is the workflow for creating PRs in the repo, and our publication process:
Expand Down
4 changes: 2 additions & 2 deletions antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ nav:
asciidoc:
attributes:
neo4j-version: '5'
neo4j-version-minor: '5.16'
neo4j-version-exact: '5.16.0'
neo4j-version-minor: '5.17'
neo4j-version-exact: '5.17.0'
29 changes: 29 additions & 0 deletions modules/ROOT/pages/clauses/where.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,35 @@ The `name` and `age` for `Peter` are are returned because his name contains "ete
|===


[[match-string-is-normalized]]
=== Checking if a `STRING` `IS NORMALIZED`

The `IS NORMALIZED` operator (introduced in Neo4j 5.17) is used to check whether the given `STRING` is in the `NFC` Unicode normalization form:

.Query
[source, cypher]
----
MATCH (n:Person)
WHERE n.name IS NORMALIZED
RETURN n.name AS normalizedNames
----

The given `STRING` values contain only normalized Unicode characters, therefore all the matched `name` properties are returned.
For more information, see the section about the xref:syntax/operators.adoc#match-string-is-normalized[normalization operator].

.Result
[role="queryresult",options="header,footer",cols="1*<m"]
|===
| normalizedNames
| 'Andy'
| 'Timothy'
| 'Peter'
2+|Rows: 1
|===

Note that the `IS NORMALIZED` operator returns `null` when used on a non-`STRING` value.
For example, `RETURN 1 IS NORMALIZED` returns `null`.

[[match-string-negation]]
=== String matching negation

Expand Down
71 changes: 63 additions & 8 deletions modules/ROOT/pages/constraints/examples.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ It will be updated to say `Node property uniqueness constraints added: 1` in Neo
Creating an already existing constraint will fail.
To avoid such an error, `IF NOT EXISTS` can be added to the `CREATE` command.
This will ensure that no error is thrown and that no constraint is created if any other constraint with the given name, or another node property uniqueness constraint on the same schema, already exists.

label:new[Introduced in 5.17] An informational notification is instead returned showing the existing constraint which blocks the creation.

.+CREATE CONSTRAINT+
======
Expand Down Expand Up @@ -452,7 +452,7 @@ It will be updated to say `Relationship property uniqueness constraints added: 1
Creating an already existing constraint will fail.
To avoid such an error, `IF NOT EXISTS` can be added to the `CREATE` command.
This will ensure that no error is thrown and that no constraint is created if any other constraint with the given name, or another relationship property uniqueness constraint on the same schema, already exists.

label:new[Introduced in 5.17] An informational notification is instead returned showing the existing constraint which blocks the creation.

.+CREATE CONSTRAINT+
======
Expand All @@ -472,6 +472,13 @@ Assuming a constraint with the name `sequels` already exists:
(no changes, no records)
----
.Notification
[source]
----
`CREATE CONSTRAINT sequels IF NOT EXISTS FOR ()-[e:SEQUEL_OF]-() REQUIRE (e.order) IS UNIQUE` has no effect.
`CONSTRAINT sequels FOR ()-[e:SEQUEL_OF]-() REQUIRE (e.order, e.seriesTitle) IS UNIQUE` already exists.
----
[NOTE]
====
The detailed statistics view currently says `Relationship uniqueness constraints added: 1`.
Expand Down Expand Up @@ -792,7 +799,7 @@ For the node property existence constraints, they will say `Node property existe
Creating an already existing constraint will fail.
To avoid such an error, `IF NOT EXISTS` can be added to the `CREATE` command.
This will ensure that no error is thrown and that no constraint is created if any other constraint with the given name, or another node property existence constraint on the same schema, already exists.

label:new[Introduced in 5.17] An informational notification is instead returned showing the existing constraint which blocks the creation.

.+CREATE CONSTRAINT+
======
Expand Down Expand Up @@ -820,6 +827,13 @@ Assuming a constraint with the name `author_pseudonym` already exists:
(no changes, no records)
----
.Notification
[source]
----
`CREATE CONSTRAINT author_pseudonym IF NOT EXISTS FOR (e:Author) REQUIRE (e.pseudonym) IS NOT NULL` has no effect.
`CONSTRAINT author_pseudonym FOR (e:Author) REQUIRE (e.pseudonym) IS UNIQUE` already exists.
----
======


Expand Down Expand Up @@ -1068,7 +1082,7 @@ For the relationship property existence constraints, they will say `Relationship
Creating an already existing constraint will fail.
To avoid such an error, `IF NOT EXISTS` can be added to the `CREATE` command.
This will ensure that no error is thrown and that no constraint is created if any other constraint with the given name, or another relationship property existence constraint on the same schema, already exists.

label:new[Introduced in 5.17] An informational notification is instead returned showing the existing constraint which blocks the creation.

.+CREATE CONSTRAINT+
======
Expand All @@ -1088,6 +1102,13 @@ Assuming that such a constraint already exists:
(no changes, no records)
----
.Notification
[source]
----
`CREATE CONSTRAINT wrote_year IF NOT EXISTS FOR ()-[e:WROTE]-() REQUIRE (e.year) IS NOT NULL` has no effect.
`CONSTRAINT wrote_year FOR ()-[e:WROTE]-() REQUIRE (e.year) IS NOT NULL` already exists.
----
======


Expand Down Expand Up @@ -1389,7 +1410,7 @@ Added 1 constraint.
Creating an already existing constraint will fail.
To avoid such an error, `IF NOT EXISTS` can be added to the `CREATE` command.
This will ensure that no error is thrown and that no constraint is created if any other constraint with the given name, or another node property type constraint on the same schema and property type, already exists.

label:new[Introduced in 5.17] An informational notification is instead returned showing the existing constraint which blocks the creation.

.+CREATE CONSTRAINT+
======
Expand All @@ -1409,6 +1430,13 @@ Assuming a node property type constraint on the label `Movie` which restricts th
(no changes, no records)
----
.Notification
[source]
----
`CREATE CONSTRAINT movie_titles IF NOT EXISTS FOR (e:Movie) REQUIRE (e.title) IS :: STRING` has no effect.
`CONSTRAINT movie_title FOR (e:Movie) REQUIRE e.title IS :: STRING` already exists.
----
======


Expand Down Expand Up @@ -1791,7 +1819,7 @@ Added 1 constraint.
Creating an already existing constraint will fail.
To avoid such an error, `IF NOT EXISTS` can be added to the `CREATE` command.
This will ensure that no error is thrown and that no constraint is created if any other constraint with the given name, or another relationship property type constraint on the same schema and property type, already exists.

label:new[Introduced in 5.17] An informational notification is instead returned showing the existing constraint which blocks the creation.

.+CREATE CONSTRAINT+
======
Expand All @@ -1811,6 +1839,13 @@ Assuming that such a constraint already exists:
(no changes, no records)
----
.Notification
[source]
----
`CREATE CONSTRAINT part_of IF NOT EXISTS FOR ()-[e:PART_OF]-() REQUIRE (e.order) IS :: INTEGER` has no effect.
`CONSTRAINT part_of FOR ()-[e:PART_OF]-() REQUIRE (e.order) IS :: INTEGER` already exists.
----
======


Expand Down Expand Up @@ -2141,7 +2176,7 @@ Added 1 constraint.
Creating an already existing constraint will fail.
To avoid such an error, `IF NOT EXISTS` can be added to the `CREATE` command.
This will ensure that no error is thrown and that no constraint is created if any other constraint with the given name, or another node key constraint on the same schema, already exists.

label:new[Introduced in 5.17] An informational notification is instead returned showing the existing constraint which blocks the creation.

.+CREATE CONSTRAINT+
======
Expand All @@ -2161,6 +2196,13 @@ Assuming a node key constraint on `(:Actor {firstname, surname})` already exists
(no changes, no records)
----
.Notification
[source]
----
`CREATE CONSTRAINT actor_names IF NOT EXISTS FOR (e:Actor) REQUIRE (e.firstname, e.surname) IS NODE KEY` has no effect.
`CONSTRAINT actor_fullname FOR (e:Actor) REQUIRE (e.firstname, e.surname) IS NODE KEY` already exists.
----
======


Expand Down Expand Up @@ -2488,7 +2530,7 @@ Added 1 constraint.
Creating an already existing constraint will fail.
To avoid such an error, `IF NOT EXISTS` can be added to the `CREATE` command.
This will ensure that no error is thrown and that no constraint is created if any other constraint with the given name, or another relationship key constraint on the same schema, already exists.

label:new[Introduced in 5.17] An informational notification is instead returned showing the existing constraint which blocks the creation.

.+CREATE CONSTRAINT+
======
Expand All @@ -2508,6 +2550,13 @@ Assuming a relationship key constraint on `()-[:KNOWS {since, how}]-()` already
(no changes, no records)
----
.Notification
[source]
----
`CREATE CONSTRAINT knows IF NOT EXISTS FOR ()-[e:KNOWS]-() REQUIRE (e.since, e.how) IS RELATIONSHIP KEY` has no effect.
`CONSTRAINT knows_since_how FOR ()-[e:KNOWS]-() REQUIRE (e.since, e.how) IS RELATIONSHIP KEY` already exists.
----
======


Expand Down Expand Up @@ -2850,6 +2899,12 @@ DROP CONSTRAINT missing_constraint_name IF EXISTS
(no changes, no records)
----
.Notification
[source]
----
`DROP CONSTRAINT missing_constraint_name IF EXISTS` has no effect. `missing_constraint_name` does not exist.
----
======


Expand Down
4 changes: 3 additions & 1 deletion modules/ROOT/pages/constraints/syntax.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ Best practice when creating a constraint is to give the constraint a name.
This name must be unique among both indexes and constraints.
If a name is not explicitly given, a unique name will be auto-generated.

The `CREATE CONSTRAINT` command is optionally idempotent.
The `CREATE CONSTRAINT` command is optionally idempotent.
This means its default behavior is to throw an error if an attempt is made to create the same constraint twice.
With the `IF NOT EXISTS` flag, no error is thrown and nothing happens should a constraint with the same name or same schema and constraint type already exist.
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.
label:new[Introduced in 5.17] In case nothing happens an informational notification is returned showing the existing constraint which blocks the creation.

For constraints that are backed by an index, the index provider for the backing index can be specified using the `OPTIONS` clause.
Only one valid value exists for the index provider, `range-1.0`, which is the default value.
Expand Down Expand Up @@ -284,6 +285,7 @@ DROP CONSTRAINT constraint_name [IF EXISTS]

This drop command is optionally idempotent. 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.
label:new[Introduced in 5.17] An informational notification is instead returned detailing that the constraint does not exist.

[NOTE]
====
Expand Down
Loading

0 comments on commit 10e9899

Please sign in to comment.