Skip to content

Clauses and subclauses#1272

Draft
JPryce-Aklundh wants to merge 16 commits into
neo4j:devfrom
JPryce-Aklundh:clauses_vs_subclauses2
Draft

Clauses and subclauses#1272
JPryce-Aklundh wants to merge 16 commits into
neo4j:devfrom
JPryce-Aklundh:clauses_vs_subclauses2

Conversation

@JPryce-Aklundh
Copy link
Copy Markdown
Collaborator

No description provided.


`ORDER BY` specifies how the output of a clause should be sorted.
It be used as a sub-clause following `RETURN` or `WITH`.
It be used as a subclause following `RETURN` or `WITH`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
It be used as a subclause following `RETURN` or `WITH`.
It is used as a subclause following `RETURN` or `WITH`.

Comment on lines +277 to +281
RETURN COLLECT {
MATCH (person)-[:HAS_DOG]->(d:Dog)
RETURN d.name } AS dogNames,
avg(person.age) AS averageAge
ORDER BY dogNames
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
RETURN COLLECT {
MATCH (person)-[:HAS_DOG]->(d:Dog)
RETURN d.name } AS dogNames,
avg(person.age) AS averageAge
ORDER BY dogNames
RETURN COLLECT {
MATCH (person)-[:HAS_DOG]->(d:Dog)
RETURN d.name
} AS dogNames,
avg(person.age) AS averageAge
ORDER BY dogNames

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the ending curly was very hard to spot

RETURN person.name AS name,
EXISTS {
MATCH (person)-[:HAS_DOG]->(:Dog)
} AS hasDog
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
} AS hasDog
} AS hasDog

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not sure about the correct amount of spaces, but i think this should be at the same level of the E from EXISTS, letting the curly end nicely

= Graph selection clauses
:description: Information about Cypher's graph selection clauses.

Cypher's contains one graph selection clause -- `USE` -- which allows you to select which graph a query, or query part, is executed against.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
Cypher's contains one graph selection clause -- `USE` -- which allows you to select which graph a query, or query part, is executed against.
Cypher contains one graph selection clause -- `USE` -- which allows you to select which graph a query, or query part, is executed against.

i'd say it's preference, but maybe "a" (or even "a single") instead of "one"?

= Import clauses
:description: Information about Cypher's import clauses.

Cypher's contains one clause to import data -- `LOAD CSV` -- which allows you to load csv into a graph.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
Cypher's contains one clause to import data -- `LOAD CSV` -- which allows you to load csv into a graph.
Cypher contains one clause to import data -- `LOAD CSV` -- which allows you to load csv into a graph.

same here (a vs a single vs one)

= Clauses

This section contains information on all the clauses in the Cypher query language.
This chapter contains information on all the clauses and subclauses in the Cypher query language (with the exception of the database administration commands, which are documented in the link:{neo4j-docs-base-uri}/operations-manual/current/database-administration/[Operations Manual -> Database administration], link:{neo4j-docs-base-uri}/operations-manual/current/authentication-authorization/[Authentication and authorization], and link:{neo4j-docs-base-uri}/operations-manual/current/clustering/[Clustering]).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style preference - i'd drop the parentheses

@neo4j-docops-agent
Copy link
Copy Markdown
Collaborator

@stefano-ottolenghi stefano-ottolenghi changed the base branch from cypher-25 to dev June 17, 2025 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants