Skip to content

Commit 6fc775c

Browse files
authored
Fix typos in Sample Notebooks (#760)
* Update 01-Basic-Read-Queries.ipynb Fix minor typos and missing words. * Update 02-Variable-Length-Paths.ipynb Fix minor typos * Update 03-Ordering-Functions-Grouping.ipynb fix typos * Update 04-Creating-Updating-Delete-Queries.ipynb Fix typos * Update 01-Basic-Read-Queries.ipynb Fix typos * Update 02-Variable-Length-Paths.ipynb Fix typos * Update 03-Ordering-Functions-Grouping.ipynb Fix typos * Update openCypher-Exercises-Answer-Key.ipynb Fix typos * Update 01-Basic-Read-Queries.ipynb Fix typos and wording * Update 02-Loops-Repeats.ipynb Fix typos and applied better standardization of US vs UK spelling to be more consistent with other docs in this repo. * Update 03-Ordering-Functions-Grouping.ipynb Fix typos and standardize US vs UK wording to be more consistent * Update 04-Creating-Updating-Deleting-Queries.ipynb Fix typos and consistency issues * Update Gremlin-Exercises-Answer-Sheet.ipynb Fix typos and wording * Update 01-SPARQL-Basics.ipynb Fix minor typos
1 parent f0f1728 commit 6fc775c

11 files changed

+79
-79
lines changed

src/graph_notebook/notebooks/04-Language-Tutorials/01-Gremlin/01-Basic-Read-Queries.ipynb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"For these notebooks, we will be leveraging a dataset from the book [Graph Databases in Action](https://www.manning.com/books/graph-databases-in-action?a_aid=bechberger) from Manning Publications. \n",
2121
"\n",
2222
"\n",
23-
"**Note** These notebooks do not cover data modeling or building a data loading pipeline. If you would like a more detailed description about how this dataset is constructed and the design of the data model came from then please read the book.\n",
23+
"**Note** These notebooks do not cover data modeling or building a data loading pipeline. If you would like a more detailed description about how this dataset is constructed and where the design of the data model came from then please read the book.\n",
2424
"\n",
2525
"To get started, the first step is to load data into the cluster. Assuming the cluster is empty, this can be accomplished by running the cell below which will load our Dining By Friends data."
2626
]
@@ -34,7 +34,7 @@
3434
"\n",
3535
"Throughout all the **Learning Gremlin on Neptune** notebooks, you will notice that each code block starts with either a `%` or `%%` command. These are called *workbench magic* commands, and are essentially shortcuts to specific Neptune APIs. For example:\n",
3636
"\n",
37-
"* `%%gremlin` - issues a Gremlin query to the Neptune endpoint usng WebSockets\n",
37+
"* `%%gremlin` - issues a Gremlin query to the Neptune endpoint using WebSockets\n",
3838
"* `%seed` - provides a convenient way to add sample data to your Neptune endpoint\n",
3939
"* `%load` - generates a form that you can use to submit a bulk load request to Neptune\n",
4040
"\n",
@@ -99,7 +99,7 @@
9999
" \"restaurant\": {\n",
100100
" \"color\": \"#ffe6cc\"\n",
101101
" },\n",
102-
" \"cusine\": {\n",
102+
" \"cuisine\": {\n",
103103
" \"color\": \"#fff2cc\"\n",
104104
" }\n",
105105
" }\n",
@@ -233,7 +233,7 @@
233233
"\n",
234234
"### Finding Nodes\n",
235235
"\n",
236-
"The simplest traversal you can do in Gremlin is to search for nodes. In Gremlin traversals, nodes are represented by `V()`. In our example, *review*, *restaurant*, *cuisine*, *person*, *state* and *city* as represented as nodes.\n",
236+
"The simplest traversal you can do in Gremlin is to search for nodes. In Gremlin traversals, nodes are represented by `V()`. In our example, *review*, *restaurant*, *cuisine*, *person*, *state* and *city* are represented as nodes.\n",
237237
"\n",
238238
"Execute the query below to search for all nodes and return them, but limit the number returned to 10."
239239
]
@@ -320,7 +320,7 @@
320320
"id": "a3093ad2",
321321
"metadata": {},
322322
"source": [
323-
"We can also do the same using the combination of `bothE()` and `otherV()`, instead of explicitly stating whether to travese outgoing or incoming edges."
323+
"We can also do the same using the combination of `bothE()` and `otherV()`, instead of explicitly stating whether to traverse outgoing or incoming edges."
324324
]
325325
},
326326
{
@@ -484,7 +484,7 @@
484484
"metadata": {},
485485
"source": [
486486
"### Filtering Edge by Label\n",
487-
"Another common item you to filter on is the type or label associated with an edge. As with nodes, you can use the `hasLabel()` step associated with an edge."
487+
"Another common item to filter on is the type or label associated with an edge. As with nodes, you can use the `hasLabel()` step associated with an edge."
488488
]
489489
},
490490
{
@@ -523,7 +523,7 @@
523523
"%%gremlin -d $node_labels\n",
524524
"g.V()\n",
525525
".hasLabel('person')\n",
526-
".where(out().hasLabel('person').count().is(gte(2))) // <-- filter only people who have at 2 or more friend connections\n",
526+
".where(out().hasLabel('person').count().is(gte(2))) // <-- filter only people who have 2 or more friend connections\n",
527527
".outE()\n",
528528
" .hasLabel('friends')\n",
529529
".inV()\n",
@@ -537,7 +537,7 @@
537537
"id": "c5abc463",
538538
"metadata": {},
539539
"source": [
540-
"What if we wanted to get a list of all the restaurants in order to find out which cuisine's they serve? After all, all this learning has made me hungry!"
540+
"What if we wanted to get a list of all the restaurants in order to find out which cuisines they serve? After all, all this learning has made me hungry!"
541541
]
542542
},
543543
{
@@ -597,7 +597,7 @@
597597
"id": "8b998cd1",
598598
"metadata": {},
599599
"source": [
600-
"Because there are no properties associated to any of our edges, running the following query won't return any records. However, you can use it to see how the same concept of filtering nodes based on properties can be applied to edge.s"
600+
"Because there are no properties associated to any of our edges, running the following query won't return any records. However, you can use it to see how the same concept of filtering nodes based on properties can be applied to edges."
601601
]
602602
},
603603
{
@@ -768,7 +768,7 @@
768768
"id": "0452038d",
769769
"metadata": {},
770770
"source": [
771-
"**Note** When using `by()` after a `select()` you must specify the same number of `by()` statements as there are variables in the `select()`. Failing to doing so, will cause Gremlin to re-use whichever by() statements have been specified, starting with the first one. Now, this may not always be a problem, as we can see in the next example:"
771+
"**Note** When using `by()` after a `select()` you must specify the same number of `by()` statements as there are variables in the `select()`. Failing to do so, will cause Gremlin to re-use whichever by() statements have been specified, starting with the first one. Now, this may not always be a problem, as we can see in the next example:"
772772
]
773773
},
774774
{
@@ -823,7 +823,7 @@
823823
"id": "943bdceb",
824824
"metadata": {},
825825
"source": [
826-
"Notice in the above query how we've combined `project()` and `select()` to provide us with the same results. This is because to we've needed to alias specific portions of the incoming traversal, e.g. the node representing *Dave*, and the nodes representing Dave's *friends*.\n",
826+
"Notice in the above query how we've combined `project()` and `select()` to provide us with the same results. This is because we've needed to alias specific portions of the incoming traversal, e.g. the node representing *Dave*, and the nodes representing Dave's *friends*.\n",
827827
"\n",
828828
"If we were to run the following query, you'll notice something very odd happen with the results."
829829
]
@@ -912,7 +912,7 @@
912912
"\n",
913913
"In addition to returning simple key-value pairs, we can construct more complex responses. This is a common requirement, especially when returning aggregations or when returning attributes from different variables in the matched patterns.\n",
914914
"\n",
915-
"These new projections are created by using the `by()` step modulator (which is discussed more in the Loops-Repeats notebook). As we're previous seen, for each traversal step, we write a `by()` step to apply to it. The example below shows how we can return a custom string with the statement \"*person* is friends with *person*\"."
915+
"These new projections are created by using the `by()` step modulator (which is discussed more in the Loops-Repeats notebook). As we've previously seen, for each traversal step, we write a `by()` step to apply to it. The example below shows how we can return a custom string with the statement \"*person* is friends with *person*\"."
916916
]
917917
},
918918
{

src/graph_notebook/notebooks/04-Language-Tutorials/01-Gremlin/02-Loops-Repeats.ipynb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
" \"restaurant\": {\n",
5555
" \"color\": \"#ffe6cc\"\n",
5656
" },\n",
57-
" \"cusine\": {\n",
57+
" \"cuisine\": {\n",
5858
" \"color\": \"#fff2cc\"\n",
5959
" }\n",
6060
" }\n",
@@ -76,7 +76,7 @@
7676
"id": "e5bebb15",
7777
"metadata": {},
7878
"source": [
79-
"We'll be using the `node_labels` variable to provide a nicer visualisation when running the queries in this notebook. To use it, we need to pass it along with the query itself, as follows:\n",
79+
"We'll be using the `node_labels` variable to provide a nicer visualization when running the queries in this notebook. To use it, we need to pass it along with the query itself, as follows:\n",
8080
"\n",
8181
"`%%gremlin -d node_labels`\n",
8282
"\n",
@@ -132,7 +132,7 @@
132132
"\n",
133133
"The `repeat()` step also supports two 'modulators'; `until()` and `emit()`, which can be both used before or after the `repeat()` step. Using the `until()` step before the `repeat()` is similar to the common [`while...do`](https://www.w3schools.com/java/java_while_loop.asp) programming paradigm, whereas using the `until()` _after_ the `repeat()` is similar to the [`do...while`](https://www.w3schools.com/cpp/cpp_do_while_loop.asp) concept.\n",
134134
"\n",
135-
"The `emit()` modulator works by returning the results of a traversal as it is executed, and can be useful when used in conjunction with other looping-limiting steps such as `times()`. An example of this is the query below where we want to limit the `repeat()` to two hops, however we also want to return paths which include only one hops."
135+
"The `emit()` modulator works by returning the results of a traversal as it is executed, and can be useful when used in conjunction with other looping-limiting steps such as `times()`. An example of this is the query below where we want to limit the `repeat()` to two hops, however we also want to return paths which include only one hop."
136136
]
137137
},
138138
{
@@ -446,7 +446,7 @@
446446
"\n",
447447
"When repeating a traversal in Gremlin using the `repeat()` it's common to come across a pattern whereby the path loops back on itself. This is called a cyclic path, and can lead to your Gremlin queries looping forever.\n",
448448
"\n",
449-
"To stop this from occurring, it's good practise to include the `simplePath()` step. This removes paths with repeated objects, thus ensuring cyclic paths are not traversed.\n",
449+
"To stop this from occurring, it's good practice to include the `simplePath()` step. This removes paths with repeated objects, thus ensuring cyclic paths are not traversed.\n",
450450
"\n",
451451
"**Important**. The `simplePath()` filters for repeated object based on the previous step, such as `in()` or `out()`.\n",
452452
"\n",
@@ -481,14 +481,14 @@
481481
"metadata": {},
482482
"source": [
483483
"\n",
484-
"### Visualising Results in a Neptune Notebook\n",
484+
"### Visualizing Results in a Neptune Notebook\n",
485485
"\n",
486-
"A key part of using any graph database is being able to visualise the way the objects stored within it are connected to each other. We've already shown how to do this in previous examples, however it's important to understand which of the Gremlin steps support this type of functionality.\n",
486+
"A key part of using any graph database is being able to visualize the way the objects stored within it are connected to each other. We've already shown how to do this in previous examples, however it's important to understand which of the Gremlin steps support this type of functionality.\n",
487487
"\n",
488488
"* `path()` - used to provide access to all nodes and edges within each unique path traversed\n",
489489
"* `simplePath()` - used to ensure we don't repeat a traversal across an object we've already covered (this can lead to infinite looping if the model supports circular references)\n",
490490
"\n",
491-
"If you're running this in a Neptune Notebook, we can use the `path()` step we tell the notebook to automatically present a visualisation of the output of a query. The following query returns 10 paths visualising the connections between `person`, `city`, `restaurant` and `cuisine`. Run the following query, and a graphical visualisation will automatically appear."
491+
"If you're running this in a Neptune Notebook, we can use the `path()` step we tell the notebook to automatically present a visualization of the output of a query. The following query returns 10 paths visualizing the connections between `person`, `city`, `restaurant` and `cuisine`. Run the following query, and a graphical visualization will automatically appear."
492492
]
493493
},
494494
{
@@ -595,7 +595,7 @@
595595
"* Find the friends of that person (i.e. traverse the `friends` edge)\n",
596596
"* Return the friends `first_name`\n",
597597
"\n",
598-
"The correct answer is a three results: \"Hank\", \"Denise\", \"Paras\""
598+
"The correct answer is three results: \"Hank\", \"Denise\", \"Paras\""
599599
]
600600
},
601601
{
@@ -676,7 +676,7 @@
676676
"source": [
677677
"## Conclusion\n",
678678
"\n",
679-
"In this notebook, we explored writing looping and repeat queries in Gremlin. These queries are a powerful and common way to explore connected data to answer questions, especially those where the exact number of connection is unknown. \n",
679+
"In this notebook, we explored writing looping and repeat queries in Gremlin. These queries are a powerful and common way to explore connected data to answer questions, especially those where the exact number of connections are unknown. \n",
680680
"\n",
681681
"In the next notebook we will take what we have learned in this notebook and extend it to demonstrate how to order, group, and aggregate values in queries."
682682
]
@@ -703,4 +703,4 @@
703703
},
704704
"nbformat": 4,
705705
"nbformat_minor": 5
706-
}
706+
}

src/graph_notebook/notebooks/04-Language-Tutorials/01-Gremlin/03-Ordering-Functions-Grouping.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
" \"restaurant\": {\n",
5454
" \"color\": \"#ffe6cc\"\n",
5555
" },\n",
56-
" \"cusine\": {\n",
56+
" \"cuisine\": {\n",
5757
" \"color\": \"#fff2cc\"\n",
5858
" }\n",
5959
" }\n",
@@ -75,7 +75,7 @@
7575
"id": "111cfabb",
7676
"metadata": {},
7777
"source": [
78-
"We'll be using the `node_labels` variable to provide a nicer visualisation when running the queries in this notebook. To use it, we need to pass it along with the query itself, as follows:\n",
78+
"We'll be using the `node_labels` variable to provide a nicer visualization when running the queries in this notebook. To use it, we need to pass it along with the query itself, as follows:\n",
7979
"\n",
8080
"`%%gremlin -d node_labels`\n",
8181
"\n",
@@ -109,7 +109,7 @@
109109
"\n",
110110
"When working with data, one common requirement is to return that data in a consistent and ordered fashion. \n",
111111
"\n",
112-
"By default, data returned from an Gremlin query does not have a specified order, and consistent order cannot be assumed across multiple executions of the same query. To give our data a consistent order we must use the combination of the `order()` and `by()` steps. These enable you sort your results using the values that a query can return, such as nodes/edges, ID values, as well as via many expressions. \n",
112+
"By default, data returned from a Gremlin query does not have a specified order, and consistent order cannot be assumed across multiple executions of the same query. To give our data a consistent order we must use the combination of the `order()` and `by()` steps. These enable you to sort your results using the values that a query can return, such as nodes/edges, ID values, as well as via many expressions. \n",
113113
"\n",
114114
"**Note** When the data being ordered contains a `null` value, these will be sorted to the end of the results for ascending sort order and the beginning of the list for descending sort order.\n",
115115
"\n",
@@ -436,7 +436,7 @@
436436
".fold()\n",
437437
"\n",
438438
"// Results in:\n",
439-
"// [\"Perryman's\", 'Spicy Heat', 'Rare Choice', 'Super Delish', 'Eastern Winds', 'Saucy-Cheesy-Saucers', 'With Pasta', 'With Brine', 'With Wine', 'U-S-A', 'Pick & Go', 'Rare Bull', 'Satiated', 'Good Bull', 'Southern Fire', 'With Salsa', 'With Curry', 'With Shell', 'Taters', 'Awesome Suace', 'Prancing Pony', 'Mexican Hut', 'Rabbitfood', 'Hand Roll', 'Northern Quench', 'Western Granola', 'With Noodles', 'With Sauce', 'Without Chaser', 'With Rice', 'Food For Thought', \"Dave's Big Deluxe\", 'Quick N Greasy', 'Lonely Grape', 'Breaded & Fried', 'All Night Long', 'Black Pit of Des Pair', 'Without Heat', 'With Ginger', 'Fat Fried Fast']"
439+
"// [\"Perryman's\", 'Spicy Heat', 'Rare Choice', 'Super Delish', 'Eastern Winds', 'Saucy-Cheesy-Saucers', 'With Pasta', 'With Brine', 'With Wine', 'U-S-A', 'Pick & Go', 'Rare Bull', 'Satiated', 'Good Bull', 'Southern Fire', 'With Salsa', 'With Curry', 'With Shell', 'Taters', 'Awesome Sauce', 'Prancing Pony', 'Mexican Hut', 'Rabbitfood', 'Hand Roll', 'Northern Quench', 'Western Granola', 'With Noodles', 'With Sauce', 'Without Chaser', 'With Rice', 'Food For Thought', \"Dave's Big Deluxe\", 'Quick N Greasy', 'Lonely Grape', 'Breaded & Fried', 'All Night Long', 'Black Pit of Des Pair', 'Without Heat', 'With Ginger', 'Fat Fried Fast']"
440440
]
441441
},
442442
{
@@ -589,7 +589,7 @@
589589
"id": "e31b0932",
590590
"metadata": {},
591591
"source": [
592-
"An important point to note that `union` works in the same way as other Gremlin steps in that it uses the *incoming traversal* as its starting point. \n",
592+
"An important point to note is that `union` works in the same way as other Gremlin steps in that it uses the *incoming traversal* as its starting point. \n",
593593
"\n",
594594
"The following query traverses to the `With Pasta` restaurant and then uses a `union` step to combine the results with a traversal to the `With Wine` restaurants. Let's take a look at the results."
595595
]
@@ -638,7 +638,7 @@
638638
"\n",
639639
"* `Lookup Cache` - This is an always-on caching technique, but is **only available for D instances, e.g. R5d, and not Serverless**. It uses local instance SSD storage to store property values (strings) or RDF literals for fast retrieval. This can be useful when frequently returning or filtering on a large number of property values.\n",
640640
"\n",
641-
"As a general rule, you should look to optimise your queries by only filtering on, and returning properties that you need. \n",
641+
"As a general rule, you should look to optimize your queries by only filtering on, and returning properties that you need. \n",
642642
"\n",
643643
"In addition, monitoring your cluster and instance health using [CloudWatch metrics](https://docs.aws.amazon.com/neptune/latest/userguide/cw-metrics.html) can alert you to causes for query performance degradation.\n"
644644
]

0 commit comments

Comments
 (0)