Skip to content

Conversation

@lidiazuin
Copy link
Contributor

No description provided.

Copy link
Contributor

@AlexicaWright AlexicaWright left a comment

Choose a reason for hiding this comment

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

Whew..loads of comments! Useful content! Thank you @lidiazuin !

Neo4j's graph model is composed of <<nodes>> and <<relationships>>, which may also have assigned <<properties>>.
With nodes and relationships, you can build powerful patterns that can express simple or complex patterns.

Pattern recognition is a key fundamental cognitive process, making Cypher, which utilizes pattern matching, intuitive and easy to learn.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it really easy to learn? Maybe it's better to just say that it's intuitive?


image::kevinthreehopsrel.svg[Three hops from Kevin Bacon and other actors and movies, now connected through acted in, directed and produced relationships, link="{imagesdir}/kevinthreehopsrel.svg",role="popup-link"]

=== The Bacon Path to Meg Ryan
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
=== The Bacon Path to Meg Ryan
=== Use the `ShortestPath` algorithm

This doesn't solve the Six degrees of Kevin Bacon though, you would have to manually update the query for every actor and count the steps to see if it's six or less.

Comment on lines 921 to 922
When you're done experimenting, you can remove the movie data set and clean up your Aura instance.
However, for this to work, you need to delete all relationships, since nodes can't be removed if relationships to them still exist.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
When you're done experimenting, you can remove the movie data set and clean up your Aura instance.
However, for this to work, you need to delete all relationships, since nodes can't be removed if relationships to them still exist.
When you're done experimenting, you can remove all the nodes and relationships in the movie data set.

When you're done experimenting, you can remove the movie data set and clean up your Aura instance.
However, for this to work, you need to delete all relationships, since nodes can't be removed if relationships to them still exist.

You can delete both relationships and nodes in one single query:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
You can delete both relationships and nodes in one single query:
You can delete everything with one single query:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Originally there was a mention that this doesn't delete the properties, so I thought this should be specified?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need to get to the bottom of this. Maybe someone from the Cypher team can help?

The result is the following message: "Deleted 171 nodes, deleted 253 relationships".

Note that, although the database information in the left-hand panel shows no nodes or relationships in the graph, the property key names remain.
This means that the previous query delete only nodes and relationships, but not properties.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure this is accurate. The property keys remain, but aren't their values stored on the nodes? And if you remove the nodes, where are the values?
How can you REMOVE a property from a node that has been deleted?

Copy link
Contributor

@AlexicaWright AlexicaWright left a comment

Choose a reason for hiding this comment

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

Whew..loads of comments! Useful content! Thank you @lidiazuin !

Copy link
Contributor

@AlexicaWright AlexicaWright left a comment

Choose a reason for hiding this comment

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

Amazing work! Some more comments for clarification and readability.

Neo4j's graph model is composed of <<nodes>> and <<relationships>>, which may also have assigned <<properties>>.
With nodes and relationships, you can build a graph that can express both simple and complex patterns.

Pattern recognition is a key fundamental cognitive process, making Cypher, which utilizes pattern matching, more intuitive to learn.
Copy link
Contributor

Choose a reason for hiding this comment

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

It's kind of awkward to say that Cypher utilizes pattern matching, it's more the other way around, that you can use Cypher for pattern matching.

endif::[]

Cypher's constructs are based on English prose and iconography.
It allows the user to get a natural language understanding while programming.
Copy link
Contributor

Choose a reason for hiding this comment

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

Cypher is not a programming language, it's a query language. Maybe we could say something like that it's close to natural language and the syntax is designed to visually look like a graph?

==== Pattern variables

In the same way as nodes and relationships, you can also use variables for patterns.
Considering the previous example, you can turn contain the whole pattern (`(Sally)-[:LIKES]->(Technology)`) inside a pattern by creating a variable (`p`) for it all:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Considering the previous example, you can turn contain the whole pattern (`(Sally)-[:LIKES]->(Technology)`) inside a pattern by creating a variable (`p`) for it all:
Consider the previous example, you can turn the whole pattern (`(Sally)-[:LIKES]->(Technology)`) into a variable (`p`):

Copy link
Contributor

@AlexicaWright AlexicaWright left a comment

Choose a reason for hiding this comment

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

Looks great @lidiazuin ! I found just one missing space, otherwise I say it's ago! 👍

@neo4j-docops-agent
Copy link
Collaborator

neo4j-docops-agent commented Nov 24, 2025

Thanks for the documentation updates.

The preview documentation has now been torn down - reopening this PR will republish it.

@lidiazuin lidiazuin merged commit 014c584 into neo4j:dev Nov 24, 2025
5 checks passed
@lidiazuin lidiazuin deleted the cypherintro branch November 24, 2025 09:37
lidiazuin added a commit to lidiazuin/docs-getting-started that referenced this pull request Nov 24, 2025
* Review of the Cypher intro tutorial

* Apply suggestions from code review

Co-authored-by: Jessica Wright <[email protected]>

* Apply suggestions from code review

Co-authored-by: Jessica Wright <[email protected]>

* update after review

* last updates after review

* Apply suggestions from code review

Co-authored-by: Jessica Wright <[email protected]>

* updates after review

* Update modules/ROOT/pages/cypher/index.adoc

Co-authored-by: Jessica Wright <[email protected]>

---------

Co-authored-by: Jessica Wright <[email protected]>
lidiazuin added a commit that referenced this pull request Nov 24, 2025
* Review of the Cypher intro tutorial (#504)

* Review of the Cypher intro tutorial

* Apply suggestions from code review

Co-authored-by: Jessica Wright <[email protected]>

* Apply suggestions from code review

Co-authored-by: Jessica Wright <[email protected]>

* update after review

* last updates after review

* Apply suggestions from code review

Co-authored-by: Jessica Wright <[email protected]>

* updates after review

* Update modules/ROOT/pages/cypher/index.adoc

Co-authored-by: Jessica Wright <[email protected]>

---------

Co-authored-by: Jessica Wright <[email protected]>

* fixing issues

---------

Co-authored-by: Jessica Wright <[email protected]>
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