-
Notifications
You must be signed in to change notification settings - Fork 41
Review of the Cypher intro tutorial #504
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
Conversation
AlexicaWright
left a comment
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.
Whew..loads of comments! Useful content! Thank you @lidiazuin !
modules/ROOT/pages/cypher/index.adoc
Outdated
| 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. |
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.
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 |
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.
| === 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.
| 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. |
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.
| 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: |
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.
| You can delete both relationships and nodes in one single query: | |
| You can delete everything with one single query: |
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.
Originally there was a mention that this doesn't delete the properties, so I thought this should be specified?
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 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. |
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'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?
AlexicaWright
left a comment
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.
Whew..loads of comments! Useful content! Thank you @lidiazuin !
Co-authored-by: Jessica Wright <[email protected]>
Co-authored-by: Jessica Wright <[email protected]>
AlexicaWright
left a comment
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.
Amazing work! Some more comments for clarification and readability.
modules/ROOT/pages/cypher/index.adoc
Outdated
| 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. |
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.
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.
modules/ROOT/pages/cypher/index.adoc
Outdated
| endif::[] | ||
|
|
||
| Cypher's constructs are based on English prose and iconography. | ||
| It allows the user to get a natural language understanding while programming. |
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.
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?
modules/ROOT/pages/cypher/index.adoc
Outdated
| ==== 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: |
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.
| 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`): |
Co-authored-by: Jessica Wright <[email protected]>
AlexicaWright
left a comment
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.
Looks great @lidiazuin ! I found just one missing space, otherwise I say it's ago! 👍
Co-authored-by: Jessica Wright <[email protected]>
|
Thanks for the documentation updates. The preview documentation has now been torn down - reopening this PR will republish it. |
* 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]>
* 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]>
No description provided.