From 234729c0239b83586fe68cc478ec3784de18f3db Mon Sep 17 00:00:00 2001 From: Ian Pollard <96181669+ian-neo4j@users.noreply.github.com> Date: Mon, 31 Oct 2022 16:10:42 +0000 Subject: [PATCH 01/13] Update northwind.adoc --- documentation/northwind.adoc | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/documentation/northwind.adoc b/documentation/northwind.adoc index 19e08cb..f088bd8 100644 --- a/documentation/northwind.adoc +++ b/documentation/northwind.adoc @@ -1,37 +1,34 @@ -= Learn about graphs, how to load data, explore and query. += Learn graph fundamentals with Neo4j == What you will learn -This guide will teach you about the power of graph databases. +This guide will teach you about the power of graph databases. We recommend it as the starting place for all new users as it will touch upon the concepts and tools you need to work with graphs. It will take around 10 minutes and by the end of it you will: -Know what the graph property model is and what problems it can help you solve. -Learn how to convert an understanding of a relational database model to a graph. -Get familiar with Neo4j's tools to import, visualize, and query data in a graph. +- Know what the _graph property model_ is and what problems it can help you solve. +- Learn how to convert an understanding of a _relational database model_ to a graph. +- Import and model data from CSV files and map them to a graph. +- Visually explore that data, without code, in a graph. +- Write your first simple graph queries using Cypher. -The guide uses the classic (relational) Northwind dataset. +We will be using the classic relational dataset known as Northwind. -1. Model: What is a graph model and its elements -2. Load a graph from external CSV files -3. Explore the loaded data visually -4. Query patterns in your data +Let's get started! It's time to bring this dataset and fictional company into an exciting graph-enabled future. == What is a graph? -A graph database stores entities (nodes) and their relationships instead of tables, or documents. -Data is stored just like you might sketch ideas on a whiteboard. -Your data is managed without restricting it to a pre-defined schema, allowing a very flexible way of thinking and evolving it. +A graph database stores entities (we call them _nodes_) and their _relationships_ instead of tables, or documents. Data is stored just like you might sketch ideas on a whiteboard. image::https://github.com/neo4j-graph-examples/northwind/raw/main/documentation/img/model.svg[] -In relational databases, references to other rows and tables computed at query time through the use of joins. -These can be complex, slow, and expensive. +Nodes are things like Northwind's your customers and products. The graph store node relationships; for example, a customer may _purchase_ a product. + +In relational databases, those relationships between rows and other tables are not stored. Instead, in a relational database a user must sometimes write queries that use joins. These operations can be complex, slow, and expensive. -In the graph property model, those relationships are stored in the database. -Queries that follow relationships are then simple and fast. +In a graph, you get them insantly and for free. This has powerful implications for many data-driven applications. -This can have exciting and powerful implications for what you can do with your data. +Your data is managed without restricting it to a pre-defined schema, allowing a very flexible way of thinking and evolving it. == Nodes, properties, relationships From e9037d2ef64b315e04fa9df2a3f6f174d37815c9 Mon Sep 17 00:00:00 2001 From: Ian Pollard <96181669+ian-neo4j@users.noreply.github.com> Date: Mon, 31 Oct 2022 16:44:37 +0000 Subject: [PATCH 02/13] Update northwind.adoc --- documentation/northwind.adoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/documentation/northwind.adoc b/documentation/northwind.adoc index f088bd8..e6eefd3 100644 --- a/documentation/northwind.adoc +++ b/documentation/northwind.adoc @@ -1,9 +1,11 @@ = Learn graph fundamentals with Neo4j -== What you will learn +== Let's get started This guide will teach you about the power of graph databases. We recommend it as the starting place for all new users as it will touch upon the concepts and tools you need to work with graphs. +=== What you will learn + It will take around 10 minutes and by the end of it you will: - Know what the _graph property model_ is and what problems it can help you solve. From 6787e721dcfbee575376be22d8b8b7c7be3e91e4 Mon Sep 17 00:00:00 2001 From: Ian Pollard <96181669+ian-neo4j@users.noreply.github.com> Date: Tue, 1 Nov 2022 08:00:45 +0000 Subject: [PATCH 03/13] Update northwind.adoc --- documentation/northwind.adoc | 97 +++++++++++++++++++++--------------- 1 file changed, 58 insertions(+), 39 deletions(-) diff --git a/documentation/northwind.adoc b/documentation/northwind.adoc index e6eefd3..606a71f 100644 --- a/documentation/northwind.adoc +++ b/documentation/northwind.adoc @@ -1,126 +1,145 @@ = Learn graph fundamentals with Neo4j + == Let's get started This guide will teach you about the power of graph databases. We recommend it as the starting place for all new users as it will touch upon the concepts and tools you need to work with graphs. === What you will learn -It will take around 10 minutes and by the end of it you will: +This guide will take around 10 minutes and by the end of it you will: -- Know what the _graph property model_ is and what problems it can help you solve. -- Learn how to convert an understanding of a _relational database model_ to a graph. +- Understand the *graph property model* and what problems it can help you solve. +- Learn how to convert an understanding of a relational database model to a graph. - Import and model data from CSV files and map them to a graph. - Visually explore that data, without code, in a graph. -- Write your first simple graph queries using Cypher. +- Write your first simple graph queries using *Cypher*. + +=== Let's get started! -We will be using the classic relational dataset known as Northwind. +We will be using the classic relational dataset known as Northwind. It's time to bring this dataset and fictional company into an exciting graph-enabled future. -Let's get started! It's time to bring this dataset and fictional company into an exciting graph-enabled future. == What is a graph? -A graph database stores entities (we call them _nodes_) and their _relationships_ instead of tables, or documents. Data is stored just like you might sketch ideas on a whiteboard. +=== Concepts -image::https://github.com/neo4j-graph-examples/northwind/raw/main/documentation/img/model.svg[] +A graph database stores *nodes* (`Customer`, `Product`, etc) and their *relationships* (e.g. `Customer PURCHASED Product`). -Nodes are things like Northwind's your customers and products. The graph store node relationships; for example, a customer may _purchase_ a product. +Unlike other types of database, which may use tables or documents, in a graph data is stored just like you might sketch ideas on a whiteboard. + +image::https://github.com/neo4j-graph-examples/northwind/raw/main/documentation/img/model.svg[] -In relational databases, those relationships between rows and other tables are not stored. Instead, in a relational database a user must sometimes write queries that use joins. These operations can be complex, slow, and expensive. +In relational databases, the relationships between rows and other tables are not stored. Instead, you must write queries that use a `join`. These operations can be complex, slow, and expensive. In a graph, you get them insantly and for free. This has powerful implications for many data-driven applications. -Your data is managed without restricting it to a pre-defined schema, allowing a very flexible way of thinking and evolving it. +=== Schema free + +In a relational database, you must define your schema (the structure of the data). In a graph, your data is managed without restricting it to a pre-defined schema. This allows a very flexible way of thinking and evolving it. + == Nodes, properties, relationships -A graph is made up of nodes, and relationships each with type(s) and properties. +The nodes and relationships in your graph can have *Types* and *Properties*. === Nodes and Properties - -Nodes can be tagged with _Labels_, representing their different roles in your domain. (`Supplier`, `Employee`, `Customer`). -They can hold any number of key-value pairs as _Properties_. (`name:"Jane"`). +Nodes can be tagged with *Labels*, representing their different roles in your dataset (e.g. `Supplier`, `Employee`, `Customer`). +They can also hold any number of key-value pairs as *Properties*. (`name:"Jane"`). === Relationships -_Relationships_ provide directed, typed, attributed connections between two node entities (e.g. `Shipper SHIPS Order`). +*Relationships* provide directed, typed, or attributed, connections between two node entities (e.g. `Shipper SHIPS Order`). -Relationships always have a _direction_, a _type_, a start node, and an end node, and they can hold properties, just like nodes. +Relationships always have a *direction*, a *type*, a start node, and an end node. They can also hold properties, just like nodes. Nodes can have any number of relationships without sacrificing performance. + Although relationships are always directed, they can be navigated efficiently in any direction. In our example, you could find who shipped an order; you could also reverse that and find what orders were shipped. -== Step3: Re-imagining a classic (Northwind) +== Re-imagining a classic (Northwind) // await signals.emit(SIGNAL_NAME.WorkspaceNavigate, { scope: APP_SCOPE.import }); image::https://neo4j-graph-examples.github.io/northwind/documentation/img/product-category-supplier.png[] -The classic Northwind dataset represents an online shop. -Here we're going transform this relational database example into a graph database. +The classic Northwind dataset represents an online shop. You're going transform this relational database example into a graph database. image::https://neo4j-graph-examples.github.io/northwind/documentation/img/product-graph.png[] - //// .TODO diagram of Northwind customer, order, and product image::https://github.com/neo4j-graph-examples/northwind/blob/main/documentation/img/example.svg[] //// -Click the button to download a zip file with the CSVs and an initial graph model. +Click the button to download a zip file with the CSVs and an initial graph model we have prepared for you. +//// TODO: Button Download the Northwind dataset +//// -Drag the zip file into the left file sidebar of the Import tab. +Drag the zip file into the left file sidebar of the import tab on the left. You can now see the CSV files from Northwind's tables represented as a graph model. + Notice the relationships connecting the nodes: a `Customer PURCHASED an Order` and the `Order CONTAINED Products`. image::https://neo4j-graph-examples.github.io/northwind/documentation/img/model.svg[] == Finish the Northwind import -For each node and relationship in the model you can see which parts of the CSV file is mapped to which properties. +For each node and relationship in the model you can see which parts of the CSV file are mapped to which properties. -And to connect Nodes with Relationships we use source and target ids from the original join tables or foreign keys. +To connect Nodes with Relationships we use source and target ids from the original join tables or foreign keys. -Explore the model a bit by clicking around. +The model is interactive; you click around and explore its Nodes and Relationships. -You can see a preview of the imported data if you'd like by clicking the *Preview Graph* button that allows you to check node labels, the property names and values and relationship types and directions. +=== Preview your data import -And if you're satisfied, click the *Run Import* button to load your data into your graph. +You can see a preview of the data import by clicking the *Preview Graph* button that allows you to check node labels, the property names and values, and relationship types and directions. -Don't worry if something goes wrong, the tool can import the same data multiple times and you can reset your database to blank in the AuraDB UI. +If you're satisfied, click the *Run Import* button to load your data into your graph. + +Don't worry if something goes wrong, the tool can import the same data multiple times and you can reset your database to blank in the AuraDB Console. // A/B Test: TBD we could leave off one simple mapping, e.g. shipper and let the user do it (or prepare the node without mapping the rel and properties (but pick one that lends itself well to auto-mapping) in an area of the model that is non-crucial for later steps but not sure if that would have too many folks fail here -Now let's explore our data visually, after the import finished, click the *Explore the Import Results* button in the report popup, or switch to the *Explore* tab. +=== Explore your data + +After you have imported the Northwind dataset, click the *Explore the Import Results* button in the report popup or switch to the *Explore* tab. -TODO button switch to explore +It's time see the power of graph visualization. + +// TODO button switch to explore == Explore your graphs -Now that your data is in the graph, let's get familiar with the retail data in a graph shape in the *Explore* tab. +Now that your data is in the graph, let's get familiar with in the *Explore* tab. -The "Show me a graph" search phrase should have been run and shows an example subset of the data. +The `Show me a graph` search phrase should have been run automatically to show an example subset of the data. You can also run it yourself in the top-left search bar. -There you can use simple search phrases based on your node labels and relationship types to visualize your graph. +=== Searching for data in Explore + +You can use simple search phrases based on your node labels and relationship types to visualize your graph. + +Try to enter `Category` and then press return; it should fetch and display all categories. + +Which you now can explore and expand the graph visualization. -Try to enter `Category` and then press return, it should fetch and display all categories. -Which you now can explore and expand. +This is a great way to discover interesting relationships and formulate questions about your data. -TODO captions!! +///TODO captions!! One neat feature is to select two nodes (`Shift-Click`) and select *Paths -> Shortest Path* from the right-click context menu on one of them. -TBD educate about paths in search box! +// TBD educate about paths in search box! You can select all `Categories` by clicking on their box in the right side legend and then choose *Expand -> All* in the context menu to see all the products contained in these categories. @@ -140,7 +159,7 @@ There you can explore your data structurally. Learn more in the https://neo4j.com/docs/bloom-user-guide/current/bloom-visual-tour/[documentation^] and videos. -TODO switch to Query +// TODO switch to Query == Basic Querying From a3a27d46c369c929bab91cf2d9d725fb29745613 Mon Sep 17 00:00:00 2001 From: Ian Pollard <96181669+ian-neo4j@users.noreply.github.com> Date: Tue, 1 Nov 2022 10:18:00 +0000 Subject: [PATCH 04/13] Update northwind.adoc --- documentation/northwind.adoc | 62 +++++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 19 deletions(-) diff --git a/documentation/northwind.adoc b/documentation/northwind.adoc index 606a71f..e1261a4 100644 --- a/documentation/northwind.adoc +++ b/documentation/northwind.adoc @@ -68,12 +68,12 @@ shipped. image::https://neo4j-graph-examples.github.io/northwind/documentation/img/product-category-supplier.png[] -The classic Northwind dataset represents an online shop. You're going transform this relational database example into a graph database. +The classic Northwind dataset represents an online shop. We're going transform this relational database example into a graph database. image::https://neo4j-graph-examples.github.io/northwind/documentation/img/product-graph.png[] //// -.TODO diagram of Northwind customer, order, and product +TODO: diagram of Northwind customer, order, and product image::https://github.com/neo4j-graph-examples/northwind/blob/main/documentation/img/example.svg[] //// @@ -83,14 +83,15 @@ Click the button to download a zip file with the CSVs and an initial graph model TODO: Button Download the Northwind dataset //// -Drag the zip file into the left file sidebar of the import tab on the left. +If the Import tab, drag the zip file into the the import sidebar on the left. -You can now see the CSV files from Northwind's tables represented as a graph model. +You can now see the CSV files from Northwind's tables represented as a graph model. We have prepared the mappings for these files for you. Notice the relationships connecting the nodes: a `Customer PURCHASED an Order` and the `Order CONTAINED Products`. image::https://neo4j-graph-examples.github.io/northwind/documentation/img/model.svg[] + == Finish the Northwind import For each node and relationship in the model you can see which parts of the CSV file are mapped to which properties. @@ -117,25 +118,24 @@ It's time see the power of graph visualization. // TODO button switch to explore + == Explore your graphs Now that your data is in the graph, let's get familiar with in the *Explore* tab. The `Show me a graph` search phrase should have been run automatically to show an example subset of the data. -You can also run it yourself in the top-left search bar. +You can also run it yourself by typing the phrase in the top-left search bar. === Searching for data in Explore You can use simple search phrases based on your node labels and relationship types to visualize your graph. -Try to enter `Category` and then press return; it should fetch and display all categories. - -Which you now can explore and expand the graph visualization. +Try to enter `Category` and then press return; it should fetch and display all categories. You can now explore and expand the graph visualization. This is a great way to discover interesting relationships and formulate questions about your data. -///TODO captions!! +// TODO captions!! One neat feature is to select two nodes (`Shift-Click`) and select *Paths -> Shortest Path* from the right-click context menu on one of them. @@ -143,19 +143,20 @@ One neat feature is to select two nodes (`Shift-Click`) and select *Paths -> Sho You can select all `Categories` by clicking on their box in the right side legend and then choose *Expand -> All* in the context menu to see all the products contained in these categories. -That context menu also offers many more options like editing, partial expansion, clearing the scene or dismissing (un-)selected. nodes. +That context menu also offers many more options like editing, partial expansion, clearing the scene, or dismissing (un-)selected. nodes. == Advanced exploration Above the zoomed out view, you can switch between layouts. You can style your data in the right legend using colors, icons, sizes, captions and even apply rules for these. -Try to click on `Category` in the Legend and pick a different color, icon and size for your nodes. + +- Click on `Category` in the Legend and pick a different color, icon, and size for your nodes. Selected nodes and relationships are highlighted and counted in the legend and shown in the card view in the lower left corner. There you can explore your data structurally. -*Explore* also offers options to filter your on-screen nodes with a advanced filter menu, and even rudimentary end user programming by storing *Cypher Phrases* to be available later. +*Explore* also offers options to filter your on-screen nodes with a advanced filter menu, and even rudimentary user programming by storing *Cypher Phrases* to re-use later. Learn more in the https://neo4j.com/docs/bloom-user-guide/current/bloom-visual-tour/[documentation^] and videos. @@ -163,8 +164,9 @@ Learn more in the https://neo4j.com/docs/bloom-user-guide/current/bloom-visual-t == Basic Querying -On the left sidebar in the first entry (database) you can see the counts of types of nodes and relationships. -Click on `(Product)` - the database will fetch a few elements with that label with a minimal query. +If you haven't already, switch to the Query tab. + +On the left sidebar in the first entry (database) you can see the counts of types of nodes and relationships. Click on `(Product)` - the database will fetch a few elements with that label with a minimal query. .Load query for product nodes [source,cypher] @@ -175,9 +177,11 @@ LIMIT 25 ---- In the *graph view* the result nodes are visualized and you can double-click them to see their neighbors. + In the right properties side-panel you can inspect more properties and also style the nodes (size, color, caption) if you click on the `(Product)` label on top. You can also switch to the *table view* to see your results in a tabular fashion, nodes and relationships are visualized in a JSON structure. + That view shows by default if you return only scalar values. // TBD Alternatively we could have them click on [:SUPPLIES] and then they would already see a graph visualization, it would use graph patterns and pattern variable, but it might be too complex. I would actually prefer this one. @@ -186,20 +190,22 @@ That view shows by default if you return only scalar values. == Writing your first query Like any other database Neo4j can be queried with a query language. -As SQL joins get really convoluted for graphs, our graph query language called *Cypher* is much better suited for finding patterns. + +Our graph query language called *Cypher* and is much better suited for finding patterns. Compared to SQL there is no reliance on writing complex joins. In Cypher you represent the graph patterns that you've seen in Import and Explore with ascii-art. Parentheses `(p:Product {name:'Camembert Pierrot'})` forming "circles" around nodes and arrows `+-[:SUPPLIES]->+` depicting relationships. + You draw in text what you would draw on the whiteboard. -These patterns are used to find, create and update graph data. +These patterns are used to find, create, and update graph data. You've already seen the `MATCH (n:Product) RETURN n LIMIT 25` statement that was run for you. Click on the statement to edit it and change the pattern to: `(n:Product)<-[r:SUPPLIES]-(s:Supplier)` and the result to `RETURN n,r,s LIMIT 25` and click on the run icon icon:PlayIcon[]. -Congratulations, you've written and run your first Cypher query. +Congratulations, you've written and run your first Cypher query! .Show products and their suppliers [source,cypher] @@ -211,7 +217,9 @@ LIMIT 25 To learn more about Cypher check out the interactive https://graphacademy.neo4j.com/categories/beginners/[GraphAcademy course^] and have a look at the https://neo4j.com/docs/cypher-cheat-sheet/current/[Cypher Cheat Sheet^]. -A more complex query would find all products ordered by a customer and who supplies those. +== A more advanced query + +A more complex query would find all products ordered by a customer and who supplies them. .All products ordered by a customer and who supplies those [source,cypher] @@ -233,4 +241,20 @@ MATCH (cust:Customer)-[:PURCHASED]->(:Order)-[o:ORDERS]->(p:Product), RETURN DISTINCT cust.contactName as CustomerName, SUM(o.quantity) AS TotalProductsPurchased ---- -As you get more familiar with Cypher, you can use the https://neo4j.com/docs/drivers-apis/[Neo4j drivers^] for JavaScript, Python, Java, C# and Go to build your applications, or use our GraphQL or Spring Data Neo4j integrations for building APIs. \ No newline at end of file +== Next steps + +=== Creating applications + +As you get more familiar with Cypher, you can use the https://neo4j.com/docs/drivers-apis/[Neo4j drivers^] for JavaScript, Python, Java, C# and Go to build your applications, or use our GraphQL or Spring Data Neo4j integrations for building APIs. + +=== Mastering data importer + +// TODO: expand this + +=== Mastering Cypher + +// TODO: expand this + +=== Introducing Graph Data Science + +// TODO: expand this \ No newline at end of file From 345961717005f15fd17649b611a171441e4344d3 Mon Sep 17 00:00:00 2001 From: Ian Pollard <96181669+ian-neo4j@users.noreply.github.com> Date: Tue, 1 Nov 2022 11:36:46 +0000 Subject: [PATCH 05/13] Updated copy and structure --- documentation/northwind.adoc | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/documentation/northwind.adoc b/documentation/northwind.adoc index e1261a4..5c27a20 100644 --- a/documentation/northwind.adoc +++ b/documentation/northwind.adoc @@ -3,7 +3,8 @@ == Let's get started -This guide will teach you about the power of graph databases. We recommend it as the starting place for all new users as it will touch upon the concepts and tools you need to work with graphs. +This guide will teach you about the power of graph databases. +We recommend it as the starting place for all new users as it will touch upon the concepts and tools you need to work with graphs. === What you will learn @@ -17,7 +18,8 @@ This guide will take around 10 minutes and by the end of it you will: === Let's get started! -We will be using the classic relational dataset known as Northwind. It's time to bring this dataset and fictional company into an exciting graph-enabled future. +We will be using the classic relational dataset known as Northwind. +It's time to bring this dataset and fictional company into an exciting graph-enabled future. == What is a graph? @@ -30,7 +32,8 @@ Unlike other types of database, which may use tables or documents, in a graph da image::https://github.com/neo4j-graph-examples/northwind/raw/main/documentation/img/model.svg[] -In relational databases, the relationships between rows and other tables are not stored. Instead, you must write queries that use a `join`. These operations can be complex, slow, and expensive. +In relational databases, the relationships between rows and other tables are not stored. +Instead, you must write queries that use a `join`. These operations can be complex, slow, and expensive. In a graph, you get them insantly and for free. This has powerful implications for many data-driven applications. @@ -45,7 +48,7 @@ The nodes and relationships in your graph can have *Types* and *Properties*. === Nodes and Properties -Nodes can be tagged with *Labels*, representing their different roles in your dataset (e.g. `Supplier`, `Employee`, `Customer`). +Nodes can be tagged with *Labels*, representing their different roles in your dataset (e.g. `Supplier`, `Employee`, `Customer`). They can also hold any number of key-value pairs as *Properties*. (`name:"Jane"`). === Relationships @@ -68,7 +71,8 @@ shipped. image::https://neo4j-graph-examples.github.io/northwind/documentation/img/product-category-supplier.png[] -The classic Northwind dataset represents an online shop. We're going transform this relational database example into a graph database. +The classic Northwind dataset represents an online shop. +We're going transform this relational database example into a graph database. image::https://neo4j-graph-examples.github.io/northwind/documentation/img/product-graph.png[] @@ -85,7 +89,8 @@ TODO: Button Download the Northwind dataset If the Import tab, drag the zip file into the the import sidebar on the left. -You can now see the CSV files from Northwind's tables represented as a graph model. We have prepared the mappings for these files for you. +You can now see the CSV files from Northwind's tables represented as a graph model. +We have prepared the mappings for these files for you. Notice the relationships connecting the nodes: a `Customer PURCHASED an Order` and the `Order CONTAINED Products`. @@ -131,7 +136,8 @@ You can also run it yourself by typing the phrase in the top-left search bar. You can use simple search phrases based on your node labels and relationship types to visualize your graph. -Try to enter `Category` and then press return; it should fetch and display all categories. You can now explore and expand the graph visualization. +Try to enter `Category` and then press return; it should fetch and display all categories. +You can now explore and expand the graph visualization. This is a great way to discover interesting relationships and formulate questions about your data. @@ -151,7 +157,7 @@ Above the zoomed out view, you can switch between layouts. You can style your data in the right legend using colors, icons, sizes, captions and even apply rules for these. -- Click on `Category` in the Legend and pick a different color, icon, and size for your nodes. +Click on `Category` in the Legend and pick a different color, icon, and size for your nodes. Selected nodes and relationships are highlighted and counted in the legend and shown in the card view in the lower left corner. There you can explore your data structurally. @@ -166,7 +172,8 @@ Learn more in the https://neo4j.com/docs/bloom-user-guide/current/bloom-visual-t If you haven't already, switch to the Query tab. -On the left sidebar in the first entry (database) you can see the counts of types of nodes and relationships. Click on `(Product)` - the database will fetch a few elements with that label with a minimal query. +On the left sidebar in the first entry (database) you can see the counts of types of nodes and relationships. +Click on `(Product)` - the database will fetch a few elements with that label with a minimal query. .Load query for product nodes [source,cypher] @@ -191,7 +198,8 @@ That view shows by default if you return only scalar values. Like any other database Neo4j can be queried with a query language. -Our graph query language called *Cypher* and is much better suited for finding patterns. Compared to SQL there is no reliance on writing complex joins. +Our graph query language called *Cypher* and is much better suited for finding patterns. +Compared to SQL there is no reliance on writing complex joins. In Cypher you represent the graph patterns that you've seen in Import and Explore with ascii-art. From ac18ac4930bfb4b3140d9e3d4b14567cd972c518 Mon Sep 17 00:00:00 2001 From: Ian Pollard <96181669+ian-neo4j@users.noreply.github.com> Date: Tue, 1 Nov 2022 16:16:44 +0000 Subject: [PATCH 06/13] Update northwind.adoc Reationalizing nouns, text amends, structural changes, new CTAs on the final section --- documentation/northwind.adoc | 111 ++++++++++++++++++++--------------- 1 file changed, 63 insertions(+), 48 deletions(-) diff --git a/documentation/northwind.adoc b/documentation/northwind.adoc index 5c27a20..b1da269 100644 --- a/documentation/northwind.adoc +++ b/documentation/northwind.adoc @@ -10,11 +10,11 @@ We recommend it as the starting place for all new users as it will touch upon th This guide will take around 10 minutes and by the end of it you will: -- Understand the *graph property model* and what problems it can help you solve. +- Understand the _graph property model_ and what problems it can help you solve. - Learn how to convert an understanding of a relational database model to a graph. - Import and model data from CSV files and map them to a graph. - Visually explore that data, without code, in a graph. -- Write your first simple graph queries using *Cypher*. +- Write your first simple graph queries using _Cypher_. === Let's get started! @@ -26,41 +26,44 @@ It's time to bring this dataset and fictional company into an exciting graph-ena === Concepts -A graph database stores *nodes* (`Customer`, `Product`, etc) and their *relationships* (e.g. `Customer PURCHASED Product`). +A graph database stores _nodes_ (`Supplier`, `Product`, etc) and their _relationships_ (e.g. `Supplier SUPPLIES Product`). Unlike other types of database, which may use tables or documents, in a graph data is stored just like you might sketch ideas on a whiteboard. image::https://github.com/neo4j-graph-examples/northwind/raw/main/documentation/img/model.svg[] -In relational databases, the relationships between rows and other tables are not stored. -Instead, you must write queries that use a `join`. These operations can be complex, slow, and expensive. +In relational databases, you are often required to add explicit joins to your queries. +In doing this, relationships are calculated at run time. +This can be an expensive and slow operation. -In a graph, you get them insantly and for free. This has powerful implications for many data-driven applications. +In a graph, where the relationships are stored, many powerful operations are faster and simpler. === Schema free -In a relational database, you must define your schema (the structure of the data). In a graph, your data is managed without restricting it to a pre-defined schema. This allows a very flexible way of thinking and evolving it. +In a relational database, you must define your schema (the structure of the data). +In a graph, your data is managed without restricting it to a pre-defined schema. +This allows a very flexible way of thinking and evolving it. == Nodes, properties, relationships -The nodes and relationships in your graph can have *Types* and *Properties*. +The nodes and relationships in your graph can have _types_ and _properties_. -=== Nodes and Properties +=== Nodes and properties -Nodes can be tagged with *Labels*, representing their different roles in your dataset (e.g. `Supplier`, `Employee`, `Customer`). -They can also hold any number of key-value pairs as *Properties*. (`name:"Jane"`). +Nodes can be tagged with _labels_, representing their different roles in your dataset (e.g. `Supplier`, `Employee`, `Customer`). +They can also hold any number of key-value pairs as _properties_ (e.g. `name:"Jane"`). === Relationships -*Relationships* provide directed, typed, or attributed, connections between two node entities (e.g. `Shipper SHIPS Order`). +_Relationships_ provide directed, typed, or attributed, connections between two node entities (e.g. `Shipper SHIPS Order`). -Relationships always have a *direction*, a *type*, a start node, and an end node. They can also hold properties, just like nodes. +Relationships always have a _direction_, a _type_, a start node, and an end node. +They can also hold properties, just like nodes. Nodes can have any number of relationships without sacrificing performance. Although relationships are always directed, they can be navigated efficiently in any direction. - In our example, you could find who shipped an order; you could also reverse that and find what orders were shipped. @@ -72,7 +75,7 @@ shipped. image::https://neo4j-graph-examples.github.io/northwind/documentation/img/product-category-supplier.png[] The classic Northwind dataset represents an online shop. -We're going transform this relational database example into a graph database. +We will now transform this relational database into a graph database. image::https://neo4j-graph-examples.github.io/northwind/documentation/img/product-graph.png[] @@ -87,12 +90,12 @@ Click the button to download a zip file with the CSVs and an initial graph model TODO: Button Download the Northwind dataset //// -If the Import tab, drag the zip file into the the import sidebar on the left. +If the _Import_ tab, drag the zip file into the the import sidebar on the left. You can now see the CSV files from Northwind's tables represented as a graph model. We have prepared the mappings for these files for you. -Notice the relationships connecting the nodes: a `Customer PURCHASED an Order` and the `Order CONTAINED Products`. +Notice the relationships connecting the nodes, e.g. a `Customer PURCHASED an Order` and the `Order CONTAINED Products`. image::https://neo4j-graph-examples.github.io/northwind/documentation/img/model.svg[] @@ -101,36 +104,37 @@ image::https://neo4j-graph-examples.github.io/northwind/documentation/img/model. For each node and relationship in the model you can see which parts of the CSV file are mapped to which properties. -To connect Nodes with Relationships we use source and target ids from the original join tables or foreign keys. +To connect nodes with relationships we use source and target ids from the original join tables or foreign keys. -The model is interactive; you click around and explore its Nodes and Relationships. +The model is interactive; you can click around and explore its nodes and relationships. === Preview your data import -You can see a preview of the data import by clicking the *Preview Graph* button that allows you to check node labels, the property names and values, and relationship types and directions. +You can see a preview of the data import by clicking the _Preview Graph_ button that allows you to check node labels, the property names and values, and the relationship types and directions. -If you're satisfied, click the *Run Import* button to load your data into your graph. +If you're satisfied, click the _Run Import_ button to load your data into your graph. -Don't worry if something goes wrong, the tool can import the same data multiple times and you can reset your database to blank in the AuraDB Console. +Don't worry if something goes wrong; the tool can import the same data multiple times and you can reset your database to blank in the AuraDB Console. // A/B Test: TBD we could leave off one simple mapping, e.g. shipper and let the user do it (or prepare the node without mapping the rel and properties (but pick one that lends itself well to auto-mapping) in an area of the model that is non-crucial for later steps but not sure if that would have too many folks fail here === Explore your data -After you have imported the Northwind dataset, click the *Explore the Import Results* button in the report popup or switch to the *Explore* tab. +After you have imported the Northwind dataset, click the _Explore the Import Results_ button in the report popup or switch to the _Explore_ tab. It's time see the power of graph visualization. // TODO button switch to explore -== Explore your graphs +== Explore your graph -Now that your data is in the graph, let's get familiar with in the *Explore* tab. +Now that your data is in a graph, let's get familiar with in the _Explore_ tab. The `Show me a graph` search phrase should have been run automatically to show an example subset of the data. +The visualized graph represents the relationships in the data in a much more intuitive way than tables. -You can also run it yourself by typing the phrase in the top-left search bar. +_Note: you can also run it yourself by typing the phrase in the top-left search bar._ === Searching for data in Explore @@ -143,26 +147,28 @@ This is a great way to discover interesting relationships and formulate question // TODO captions!! -One neat feature is to select two nodes (`Shift-Click`) and select *Paths -> Shortest Path* from the right-click context menu on one of them. +One neat feature is to select two nodes (`Shift-Click`) and select _Paths -> Shortest Path_ from the right-click context menu on one of them. // TBD educate about paths in search box! -You can select all `Categories` by clicking on their box in the right side legend and then choose *Expand -> All* in the context menu to see all the products contained in these categories. +You can select all `Categories` by clicking on their box in the right side legend and then choose _Expand -> All_ in the context menu to see all the products contained in these categories. That context menu also offers many more options like editing, partial expansion, clearing the scene, or dismissing (un-)selected. nodes. == Advanced exploration -Above the zoomed out view, you can switch between layouts. +In the bottom-right of _Explore_ you can switch between the default force-based layout or a hierarchical layout. You can style your data in the right legend using colors, icons, sizes, captions and even apply rules for these. +// TODO: a screenshot here might be good to inspire or show what's possible. + Click on `Category` in the Legend and pick a different color, icon, and size for your nodes. Selected nodes and relationships are highlighted and counted in the legend and shown in the card view in the lower left corner. There you can explore your data structurally. -*Explore* also offers options to filter your on-screen nodes with a advanced filter menu, and even rudimentary user programming by storing *Cypher Phrases* to re-use later. +Explore also offers options to filter your on-screen nodes with a advanced filter menu, and even rudimentary user programming by storing Cypher phrases to re-use later. Learn more in the https://neo4j.com/docs/bloom-user-guide/current/bloom-visual-tour/[documentation^] and videos. @@ -170,10 +176,10 @@ Learn more in the https://neo4j.com/docs/bloom-user-guide/current/bloom-visual-t == Basic Querying -If you haven't already, switch to the Query tab. +If you haven't already, switch to the _Query_ tab. On the left sidebar in the first entry (database) you can see the counts of types of nodes and relationships. -Click on `(Product)` - the database will fetch a few elements with that label with a minimal query. +Click on `(Product)` - the database will fetch a few elements with that label with a minimal query. .Load query for product nodes [source,cypher] @@ -183,12 +189,13 @@ RETURN n LIMIT 25 ---- -In the *graph view* the result nodes are visualized and you can double-click them to see their neighbors. +In the _graph view_ the result nodes are visualized and you can double-click them to see their neighbors. -In the right properties side-panel you can inspect more properties and also style the nodes (size, color, caption) if you click on the `(Product)` label on top. - -You can also switch to the *table view* to see your results in a tabular fashion, nodes and relationships are visualized in a JSON structure. +In the right properties sidepanel you can inspect more properties. +You can also style nodes (size, color, caption) if you click on the `(Product)` label on top. +Results can also be shown in a tabular view by clicking the _table view_ option. +Nodes and relationships are visualized in a JSON structure. That view shows by default if you return only scalar values. // TBD Alternatively we could have them click on [:SUPPLIES] and then they would already see a graph visualization, it would use graph patterns and pattern variable, but it might be too complex. I would actually prefer this one. @@ -198,7 +205,7 @@ That view shows by default if you return only scalar values. Like any other database Neo4j can be queried with a query language. -Our graph query language called *Cypher* and is much better suited for finding patterns. +Our graph query language called _Cypher_ and is much better suited for finding patterns. Compared to SQL there is no reliance on writing complex joins. In Cypher you represent the graph patterns that you've seen in Import and Explore with ascii-art. @@ -211,7 +218,7 @@ These patterns are used to find, create, and update graph data. You've already seen the `MATCH (n:Product) RETURN n LIMIT 25` statement that was run for you. -Click on the statement to edit it and change the pattern to: `(n:Product)<-[r:SUPPLIES]-(s:Supplier)` and the result to `RETURN n,r,s LIMIT 25` and click on the run icon icon:PlayIcon[]. +Now click on the statement to edit it and change the pattern to: `(n:Product)<-[r:SUPPLIES]-(s:Supplier)` and the result to `RETURN n,r,s LIMIT 25` and click on the run icon icon:PlayIcon[]. Congratulations, you've written and run your first Cypher query! @@ -223,11 +230,12 @@ RETURN n,r,s LIMIT 25 ---- -To learn more about Cypher check out the interactive https://graphacademy.neo4j.com/categories/beginners/[GraphAcademy course^] and have a look at the https://neo4j.com/docs/cypher-cheat-sheet/current/[Cypher Cheat Sheet^]. == A more advanced query -A more complex query would find all products ordered by a customer and who supplies them. +For the last part of this guide we will look at some more powerful queries. + +First, this query will find all products ordered by a customer and who supplies them. .All products ordered by a customer and who supplies those [source,cypher] @@ -239,7 +247,7 @@ RETURN path; image::https://neo4j-graph-examples.github.io/northwind/documentation/img/example.svg[] -Or how many products in the "Produce" category each customer ordered. +We can also see how many products in the `Produce` category each customer ordered. .Find total quantity per customer in the "Produce" category [source,cypher] @@ -251,18 +259,25 @@ RETURN DISTINCT cust.contactName as CustomerName, SUM(o.quantity) AS TotalProduc == Next steps -=== Creating applications +Congratulations on completing this tutorial. -As you get more familiar with Cypher, you can use the https://neo4j.com/docs/drivers-apis/[Neo4j drivers^] for JavaScript, Python, Java, C# and Go to build your applications, or use our GraphQL or Spring Data Neo4j integrations for building APIs. +You can do more with the Northwind dataset or you can reset your instance in AuraDB Console and import your own data. -=== Mastering data importer +For you next steps, why not look at furthering your Cypher knowledge or building an application using Neo4j's popular language drivers? -// TODO: expand this +=== Next steps with Cypher + +To learn more about Cypher check out the interactive https://graphacademy.neo4j.com/categories/beginners/[GraphAcademy course^] and have a look at the https://neo4j.com/docs/cypher-cheat-sheet/current/[Cypher Cheat Sheet^]. + +=== Creating applications + +As you get more familiar with Cypher, you can use the https://neo4j.com/docs/drivers-apis/[Neo4j drivers^] for JavaScript, Python, Java, C# and Go to build your applications, or use our GraphQL or Spring Data Neo4j integrations for building APIs. -=== Mastering Cypher +=== Become a graph master with GraphAcademy -// TODO: expand this +GraphAcademy is provided by Neo4j and offers in-depth courses on many aspects of graph databases. +Check out the https://graphacademy.neo4j.com/[GraphAcademy website^]. -=== Introducing Graph Data Science +//=== Mastering data importer // TODO: expand this \ No newline at end of file From 99722551183f5f7818a7a10481a7eb5924feeaff Mon Sep 17 00:00:00 2001 From: Ian Pollard <96181669+ian-neo4j@users.noreply.github.com> Date: Tue, 1 Nov 2022 16:21:17 +0000 Subject: [PATCH 07/13] Update northwind.adoc --- documentation/northwind.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/northwind.adoc b/documentation/northwind.adoc index b1da269..e7cc375 100644 --- a/documentation/northwind.adoc +++ b/documentation/northwind.adoc @@ -273,7 +273,7 @@ To learn more about Cypher check out the interactive https://graphacademy.neo4j. As you get more familiar with Cypher, you can use the https://neo4j.com/docs/drivers-apis/[Neo4j drivers^] for JavaScript, Python, Java, C# and Go to build your applications, or use our GraphQL or Spring Data Neo4j integrations for building APIs. -=== Become a graph master with GraphAcademy +=== Go further with GraphAcademy GraphAcademy is provided by Neo4j and offers in-depth courses on many aspects of graph databases. Check out the https://graphacademy.neo4j.com/[GraphAcademy website^]. From b6a2690bf46b7b3a51757e1c4d011fcfecb48695 Mon Sep 17 00:00:00 2001 From: Ian Pollard <96181669+ian-neo4j@users.noreply.github.com> Date: Tue, 1 Nov 2022 16:25:37 +0000 Subject: [PATCH 08/13] Update northwind.adoc --- documentation/northwind.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/northwind.adoc b/documentation/northwind.adoc index e7cc375..6861544 100644 --- a/documentation/northwind.adoc +++ b/documentation/northwind.adoc @@ -52,7 +52,7 @@ The nodes and relationships in your graph can have _types_ and _properties_. === Nodes and properties Nodes can be tagged with _labels_, representing their different roles in your dataset (e.g. `Supplier`, `Employee`, `Customer`). -They can also hold any number of key-value pairs as _properties_ (e.g. `name:"Jane"`). +They can also hold any number of key-value pairs as _properties_ (e.g. `name:"Camembert Pierrot"`). === Relationships From 97949488dd65ec04ebe4669fefa5a21533532f78 Mon Sep 17 00:00:00 2001 From: AlexicaWright <49636617+AlexicaWright@users.noreply.github.com> Date: Mon, 7 Nov 2022 17:18:16 +0100 Subject: [PATCH 09/13] suggestions for improvements for readbility, clarity and consistency --- documentation/northwind.adoc | 126 ++++++++++++++++++----------------- 1 file changed, 64 insertions(+), 62 deletions(-) diff --git a/documentation/northwind.adoc b/documentation/northwind.adoc index 6861544..f320819 100644 --- a/documentation/northwind.adoc +++ b/documentation/northwind.adoc @@ -1,25 +1,24 @@ = Learn graph fundamentals with Neo4j -== Let's get started +== Get started -This guide will teach you about the power of graph databases. -We recommend it as the starting place for all new users as it will touch upon the concepts and tools you need to work with graphs. +This guide teaches you about the power of graph databases. +It is the recommended starting place for all new users as it touches upon the concepts and tools you need to work with graphs. === What you will learn -This guide will take around 10 minutes and by the end of it you will: +This guide takes around 10 minutes and by the end of it you will able to: - Understand the _graph property model_ and what problems it can help you solve. -- Learn how to convert an understanding of a relational database model to a graph. +- Convert an understanding of a relational database model to a graph. - Import and model data from CSV files and map them to a graph. - Visually explore that data, without code, in a graph. - Write your first simple graph queries using _Cypher_. -=== Let's get started! +=== Get started! -We will be using the classic relational dataset known as Northwind. -It's time to bring this dataset and fictional company into an exciting graph-enabled future. +You are going to use the classic relational dataset known as Northwind and bring the fictional company into a graph-enabled future. == What is a graph? @@ -28,22 +27,20 @@ It's time to bring this dataset and fictional company into an exciting graph-ena A graph database stores _nodes_ (`Supplier`, `Product`, etc) and their _relationships_ (e.g. `Supplier SUPPLIES Product`). -Unlike other types of database, which may use tables or documents, in a graph data is stored just like you might sketch ideas on a whiteboard. +Other types of databases may use tables and documents, but in a graph, data is stored in the same way as you may sketch ideas on a whiteboard. image::https://github.com/neo4j-graph-examples/northwind/raw/main/documentation/img/model.svg[] In relational databases, you are often required to add explicit joins to your queries. -In doing this, relationships are calculated at run time. -This can be an expensive and slow operation. +In doing this, relationships are calculated at runtime, which can be an expensive and slow operation. In a graph, where the relationships are stored, many powerful operations are faster and simpler. -=== Schema free +=== Schema-free In a relational database, you must define your schema (the structure of the data). -In a graph, your data is managed without restricting it to a pre-defined schema. -This allows a very flexible way of thinking and evolving it. - +In a graph, your data is managed without restricting it to a predefined schema. +This allows more flexibility in thinking about the data and in evolving it.0 == Nodes, properties, relationships @@ -52,19 +49,19 @@ The nodes and relationships in your graph can have _types_ and _properties_. === Nodes and properties Nodes can be tagged with _labels_, representing their different roles in your dataset (e.g. `Supplier`, `Employee`, `Customer`). -They can also hold any number of key-value pairs as _properties_ (e.g. `name:"Camembert Pierrot"`). +They can also have any number of key-value pairs as _properties_ (e.g. `name:"Camembert Pierrot"`). === Relationships _Relationships_ provide directed, typed, or attributed, connections between two node entities (e.g. `Shipper SHIPS Order`). Relationships always have a _direction_, a _type_, a start node, and an end node. -They can also hold properties, just like nodes. +They can also have properties, just like nodes. Nodes can have any number of relationships without sacrificing performance. Although relationships are always directed, they can be navigated efficiently in any direction. -In our example, you could find who shipped an order; you could also reverse that and find what orders were +In this example, you can find who shipped an order and you can also reverse that and find what orders were shipped. @@ -75,7 +72,7 @@ shipped. image::https://neo4j-graph-examples.github.io/northwind/documentation/img/product-category-supplier.png[] The classic Northwind dataset represents an online shop. -We will now transform this relational database into a graph database. +You are now going to transform this relational database into a graph database. image::https://neo4j-graph-examples.github.io/northwind/documentation/img/product-graph.png[] @@ -84,16 +81,16 @@ TODO: diagram of Northwind customer, order, and product image::https://github.com/neo4j-graph-examples/northwind/blob/main/documentation/img/example.svg[] //// -Click the button to download a zip file with the CSVs and an initial graph model we have prepared for you. +Click the button to download a zip file with the CSV files and an initial graph model prepared for you. //// TODO: Button Download the Northwind dataset //// -If the _Import_ tab, drag the zip file into the the import sidebar on the left. +From the _Import_ tab, drag the zip file into the the import sidebar on the left. You can now see the CSV files from Northwind's tables represented as a graph model. -We have prepared the mappings for these files for you. +The mappings for these files are already prepared for you. Notice the relationships connecting the nodes, e.g. a `Customer PURCHASED an Order` and the `Order CONTAINED Products`. @@ -104,17 +101,18 @@ image::https://neo4j-graph-examples.github.io/northwind/documentation/img/model. For each node and relationship in the model you can see which parts of the CSV file are mapped to which properties. -To connect nodes with relationships we use source and target ids from the original join tables or foreign keys. +Source and target IDs from the original join tables or foreign keys are used to create relationships to connect nodes. The model is interactive; you can click around and explore its nodes and relationships. === Preview your data import -You can see a preview of the data import by clicking the _Preview Graph_ button that allows you to check node labels, the property names and values, and the relationship types and directions. +You can see a preview of the data import by clicking the _Preview Graph_ button. +This allows you to check node labels, the property names and values, and the relationship types and directions. If you're satisfied, click the _Run Import_ button to load your data into your graph. -Don't worry if something goes wrong; the tool can import the same data multiple times and you can reset your database to blank in the AuraDB Console. +If something goes wrong, keep in mind that the tool can import the same data multiple times and you can reset your database to blank in the AuraDB Console. // A/B Test: TBD we could leave off one simple mapping, e.g. shipper and let the user do it (or prepare the node without mapping the rel and properties (but pick one that lends itself well to auto-mapping) in an area of the model that is non-crucial for later steps but not sure if that would have too many folks fail here @@ -122,64 +120,67 @@ Don't worry if something goes wrong; the tool can import the same data multiple After you have imported the Northwind dataset, click the _Explore the Import Results_ button in the report popup or switch to the _Explore_ tab. -It's time see the power of graph visualization. +Next you are going to see the power of graph visualization. // TODO button switch to explore == Explore your graph -Now that your data is in a graph, let's get familiar with in the _Explore_ tab. +With the data in a graph, it is time to get familiar with the _Explore_ tab. -The `Show me a graph` search phrase should have been run automatically to show an example subset of the data. -The visualized graph represents the relationships in the data in a much more intuitive way than tables. +The `Show me a graph` Search Phrase runs automatically to show an example subset of the data. +The visualized graph represents the relationships in the data in an intuitive way. -_Note: you can also run it yourself by typing the phrase in the top-left search bar._ +[NOTE] +==== +You can also run the _Show me a graph_ example Search Phrase yourself by typing the _Show me a graph_ in the top-left search bar. +==== === Searching for data in Explore You can use simple search phrases based on your node labels and relationship types to visualize your graph. -Try to enter `Category` and then press return; it should fetch and display all categories. +If you enter `Category` and then press return; it fetches and displays all categories. You can now explore and expand the graph visualization. This is a great way to discover interesting relationships and formulate questions about your data. // TODO captions!! -One neat feature is to select two nodes (`Shift-Click`) and select _Paths -> Shortest Path_ from the right-click context menu on one of them. +Another useful feature is to select two nodes (`Shift-Click`) and select _Paths -> Shortest Path_ from the right-click context menu on one of them. // TBD educate about paths in search box! You can select all `Categories` by clicking on their box in the right side legend and then choose _Expand -> All_ in the context menu to see all the products contained in these categories. -That context menu also offers many more options like editing, partial expansion, clearing the scene, or dismissing (un-)selected. nodes. +The context menu also offers many more options like editing, partial expansion, clearing the scene, or dismissing (un-)selected nodes. == Advanced exploration -In the bottom-right of _Explore_ you can switch between the default force-based layout or a hierarchical layout. +In the bottom-right of _Explore_ you can switch between the default force-based layout and a hierarchical layout. -You can style your data in the right legend using colors, icons, sizes, captions and even apply rules for these. +You can style your data in the right legend using colors, icons, sizes, and captions, and even apply rules for these. // TODO: a screenshot here might be good to inspire or show what's possible. -Click on `Category` in the Legend and pick a different color, icon, and size for your nodes. +Click on `Category` in the legend panel and pick a different color, icon, and/or size for your nodes. -Selected nodes and relationships are highlighted and counted in the legend and shown in the card view in the lower left corner. +Selected nodes and relationships are highlighted and counted in the legend panel and shown in the card view in the lower left corner. There you can explore your data structurally. -Explore also offers options to filter your on-screen nodes with a advanced filter menu, and even rudimentary user programming by storing Cypher phrases to re-use later. +Explore also offers options to filter your on-screen nodes with a advanced filter menu, and even rudimentary user programming by storing Cypher phrases to reuse later. -Learn more in the https://neo4j.com/docs/bloom-user-guide/current/bloom-visual-tour/[documentation^] and videos. +Learn more in the link:https://neo4j.com/docs/bloom-user-guide/current/bloom-visual-tour/[documentation^] and videos. // TODO switch to Query == Basic Querying -If you haven't already, switch to the _Query_ tab. +Switch to the _Query_ tab, if you haven't already done so. On the left sidebar in the first entry (database) you can see the counts of types of nodes and relationships. -Click on `(Product)` - the database will fetch a few elements with that label with a minimal query. +Click on `(Product)` - the database fetches a few elements with the `Product`-label using a minimal query. .Load query for product nodes [source,cypher] @@ -189,53 +190,54 @@ RETURN n LIMIT 25 ---- -In the _graph view_ the result nodes are visualized and you can double-click them to see their neighbors. +The result nodes are visualized in the _graph view_, and you can double-click nodes to see their neighbors. -In the right properties sidepanel you can inspect more properties. -You can also style nodes (size, color, caption) if you click on the `(Product)` label on top. +In the right properties side-panel you can inspect more properties. +You can also style nodes (size, color, caption) by clicking on the `(Product)` label on top. Results can also be shown in a tabular view by clicking the _table view_ option. Nodes and relationships are visualized in a JSON structure. -That view shows by default if you return only scalar values. +That view is shown by default if you return only scalar values. // TBD Alternatively we could have them click on [:SUPPLIES] and then they would already see a graph visualization, it would use graph patterns and pattern variable, but it might be too complex. I would actually prefer this one. // See screenhots below. == Writing your first query -Like any other database Neo4j can be queried with a query language. +Like any other database, Neo4j can be queried with a query language. -Our graph query language called _Cypher_ and is much better suited for finding patterns. -Compared to SQL there is no reliance on writing complex joins. +Neo4j's graph query language is called _Cypher_ and is very well-suited for finding patterns. +Unlike SQL, there is no reliance on writing complex joins. -In Cypher you represent the graph patterns that you've seen in Import and Explore with ascii-art. +In Cypher, you represent the graph patterns that you've seen in Import and Explore with ascii-art. -Parentheses `(p:Product {name:'Camembert Pierrot'})` forming "circles" around nodes and arrows `+-[:SUPPLIES]->+` depicting relationships. +Parentheses `(p:Product {name:'Camembert Pierrot'})` form "circles" around nodes and arrows `+-[:SUPPLIES]->+` depicts relationships. You draw in text what you would draw on the whiteboard. These patterns are used to find, create, and update graph data. -You've already seen the `MATCH (n:Product) RETURN n LIMIT 25` statement that was run for you. - -Now click on the statement to edit it and change the pattern to: `(n:Product)<-[r:SUPPLIES]-(s:Supplier)` and the result to `RETURN n,r,s LIMIT 25` and click on the run icon icon:PlayIcon[]. +You've already seen the `MATCH (n:Product) RETURN n LIMIT 25` statement that was run previously. -Congratulations, you've written and run your first Cypher query! +Now click on the statement to edit it and change the pattern and result to: -.Show products and their suppliers [source,cypher] ---- -MATCH (n:Product)<-[r:SUPPLIES]-(s) +MATCH (n:Product)<-[r:SUPPLIES]-(s:Supplier) RETURN n,r,s LIMIT 25 ---- +then click on the run icon icon:PlayIcon[]. + +Congratulations, you've written and run your first Cypher query! + == A more advanced query -For the last part of this guide we will look at some more powerful queries. +For the last part of this guide you get the opportunity to try some more powerful queries. -First, this query will find all products ordered by a customer and who supplies them. +First, this query finds all products ordered by a customer and who supplies them. .All products ordered by a customer and who supplies those [source,cypher] @@ -247,7 +249,7 @@ RETURN path; image::https://neo4j-graph-examples.github.io/northwind/documentation/img/example.svg[] -We can also see how many products in the `Produce` category each customer ordered. +You can also see how many products in the `Produce` category each customer ordered. .Find total quantity per customer in the "Produce" category [source,cypher] @@ -263,15 +265,15 @@ Congratulations on completing this tutorial. You can do more with the Northwind dataset or you can reset your instance in AuraDB Console and import your own data. -For you next steps, why not look at furthering your Cypher knowledge or building an application using Neo4j's popular language drivers? +For you next steps, a suggestion is to look at furthering your Cypher knowledge or building an application using Neo4j's popular language drivers. === Next steps with Cypher -To learn more about Cypher check out the interactive https://graphacademy.neo4j.com/categories/beginners/[GraphAcademy course^] and have a look at the https://neo4j.com/docs/cypher-cheat-sheet/current/[Cypher Cheat Sheet^]. +To learn more about Cypher, check out the interactive https://graphacademy.neo4j.com/categories/beginners/[GraphAcademy course^] and have a look at the https://neo4j.com/docs/cypher-cheat-sheet/current/[Cypher Cheat Sheet^]. === Creating applications -As you get more familiar with Cypher, you can use the https://neo4j.com/docs/drivers-apis/[Neo4j drivers^] for JavaScript, Python, Java, C# and Go to build your applications, or use our GraphQL or Spring Data Neo4j integrations for building APIs. +As you get more familiar with Cypher, you can use the https://neo4j.com/docs/drivers-apis/[Neo4j drivers^] for C#, Go, Java, JavaScript, and Python to build your applications, or use our GraphQL or Spring Data Neo4j integrations for building APIs. === Go further with GraphAcademy From 1d0f881c500ddef87f9ed59d14e565fe2572b2f2 Mon Sep 17 00:00:00 2001 From: Ian Pollard <96181669+ian-neo4j@users.noreply.github.com> Date: Tue, 8 Nov 2022 11:12:00 +0000 Subject: [PATCH 10/13] Update northwind.adoc Added link to Northwind zip --- documentation/northwind.adoc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/documentation/northwind.adoc b/documentation/northwind.adoc index f320819..9ac4875 100644 --- a/documentation/northwind.adoc +++ b/documentation/northwind.adoc @@ -81,11 +81,9 @@ TODO: diagram of Northwind customer, order, and product image::https://github.com/neo4j-graph-examples/northwind/blob/main/documentation/img/example.svg[] //// -Click the button to download a zip file with the CSV files and an initial graph model prepared for you. +Click the link below to download a zip file with the CSV files and an initial graph model prepared for you. Once saved to your computer you can use the data importer to upload it. -//// -TODO: Button Download the Northwind dataset -//// +https://github.com/neo4j-graph-examples/northwind/blob/main/import/northwind-data-importer-mode-data.zip?raw=true[Download Northwind sample data zip file] From the _Import_ tab, drag the zip file into the the import sidebar on the left. From e4c1228bc40e611b793f4e2e370606524df07378 Mon Sep 17 00:00:00 2001 From: AlexicaWright <49636617+AlexicaWright@users.noreply.github.com> Date: Tue, 8 Nov 2022 15:22:22 +0100 Subject: [PATCH 11/13] fixed tiny little typos --- documentation/northwind.adoc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/documentation/northwind.adoc b/documentation/northwind.adoc index f320819..8a142e5 100644 --- a/documentation/northwind.adoc +++ b/documentation/northwind.adoc @@ -40,7 +40,7 @@ In a graph, where the relationships are stored, many powerful operations are fas In a relational database, you must define your schema (the structure of the data). In a graph, your data is managed without restricting it to a predefined schema. -This allows more flexibility in thinking about the data and in evolving it.0 +This allows more flexibility in thinking about the data and in evolving it. == Nodes, properties, relationships @@ -61,8 +61,7 @@ They can also have properties, just like nodes. Nodes can have any number of relationships without sacrificing performance. Although relationships are always directed, they can be navigated efficiently in any direction. -In this example, you can find who shipped an order and you can also reverse that and find what orders were -shipped. +In this example, you can find who shipped an order and you can also reverse that and find what orders were shipped. == Re-imagining a classic (Northwind) @@ -265,7 +264,7 @@ Congratulations on completing this tutorial. You can do more with the Northwind dataset or you can reset your instance in AuraDB Console and import your own data. -For you next steps, a suggestion is to look at furthering your Cypher knowledge or building an application using Neo4j's popular language drivers. +For your next steps, a suggestion is to look at furthering your Cypher knowledge or building an application using Neo4j's popular language drivers. === Next steps with Cypher From e5b4da237f6cf2f07a26298f1d054c7eb869dfcf Mon Sep 17 00:00:00 2001 From: Ian Pollard <96181669+ian-neo4j@users.noreply.github.com> Date: Tue, 8 Nov 2022 15:36:19 +0000 Subject: [PATCH 12/13] Created /workspace folder and relocated adoc --- {documentation => workspace}/northwind.adoc | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {documentation => workspace}/northwind.adoc (100%) diff --git a/documentation/northwind.adoc b/workspace/northwind.adoc similarity index 100% rename from documentation/northwind.adoc rename to workspace/northwind.adoc From 48a39bea09ec51224beaaf86b3372f8bb94b7b51 Mon Sep 17 00:00:00 2001 From: Ian Pollard <96181669+ian-neo4j@users.noreply.github.com> Date: Thu, 10 Nov 2022 14:18:23 +0000 Subject: [PATCH 13/13] Update northwind.adoc Added automated mapping for the Northwind zip --- workspace/northwind.adoc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/workspace/northwind.adoc b/workspace/northwind.adoc index 48e713d..2729aa2 100644 --- a/workspace/northwind.adoc +++ b/workspace/northwind.adoc @@ -80,11 +80,12 @@ TODO: diagram of Northwind customer, order, and product image::https://github.com/neo4j-graph-examples/northwind/blob/main/documentation/img/example.svg[] //// -Click the link below to download a zip file with the CSV files and an initial graph model prepared for you. Once saved to your computer you can use the data importer to upload it. +We have prepared a zip of CSV files and an initial graph model from the Northwind dataset. +You can https://github.com/neo4j-graph-examples/northwind/blob/main/import/northwind-data-importer-mode-data.zip?raw=true[download this as a zip file] if you'd like to take a closer look. -https://github.com/neo4j-graph-examples/northwind/blob/main/import/northwind-data-importer-mode-data.zip?raw=true[Download Northwind sample data zip file] +Click the button below and we will automatically map the Northwind dataset for you. -From the _Import_ tab, drag the zip file into the the import sidebar on the left. +button::Load the Northwind dataset[role=NX_IMPORT_LOAD,endpoint=https://raw.githubusercontent.com/neo4j-graph-examples/northwind/main/import/northwind-data-importer-mode-data.zip] You can now see the CSV files from Northwind's tables represented as a graph model. The mappings for these files are already prepared for you.