From 20cfd53194f444482028c16c7124e2c6b5d2767f Mon Sep 17 00:00:00 2001 From: Kelvin Lawrence Date: Tue, 3 May 2022 17:48:41 -0500 Subject: [PATCH 01/10] Fix typo in comment --- sample-code/RemoteQueryPool.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-code/RemoteQueryPool.java b/sample-code/RemoteQueryPool.java index 0a9056a..da8a971 100644 --- a/sample-code/RemoteQueryPool.java +++ b/sample-code/RemoteQueryPool.java @@ -247,7 +247,7 @@ public static void main(String[] args) long stop = System.currentTimeMillis(); - // All done, shit down the pool, close the server connection and calculate how long the + // All done, shut down the pool, close the server connection and calculate how long the // workload took to run. rqp.closeConnection(); rqp.shutdown(); From 1699fddb9a0be1a332577356e9f0553be4b29375 Mon Sep 17 00:00:00 2001 From: Kelvin Lawrence Date: Tue, 3 May 2022 21:10:08 -0500 Subject: [PATCH 02/10] Update tested version as precursor to 3.6 material --- book/Gremlin-Graph-Guide.adoc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/book/Gremlin-Graph-Guide.adoc b/book/Gremlin-Graph-Guide.adoc index c8b73a6..4ad8312 100755 --- a/book/Gremlin-Graph-Guide.adoc +++ b/book/Gremlin-Graph-Guide.adoc @@ -2,9 +2,9 @@ PRACTICAL GREMLIN: An Apache TinkerPop Tutorial =============================================== Kelvin R. Lawrence //v281 (TP 3.3.5), January 28th 2019 -v283-preview, August 2nd 2021 +v283-preview, May 3rd 2022 // vim: set tw=85 cc=+1 wrap spell redrawtime=20000: -// Mon Aug 02, 2021 14:22:17 CDT +// Tue May 03, 2022 21:08:26 CDT //:Author: Kelvin R. Lawrence //:Email: gfxman@yahoo.com :Numbered: @@ -25,8 +25,8 @@ v283-preview, August 2nd 2021 :doctype: book :icons: font //:pdf-page-size: Letter -:draftdate: August 2nd 2021 -:tpvercheck: 3.5.1 +:draftdate: May 3rd 2022 +:tpvercheck: 3.5.2 // NOTE1: I updated the paraiso-dark style so that source code with a style of text // has a white foreground color. The default was unreadable, @@ -550,7 +550,8 @@ with Gremlin when entering queries into the Console or sending them via REST API Gremlin Server. All of these topics are covered in detail in this book. The queries used as examples in this book have been tested with Apache TinkerPop -version 3.3. using the TinkerGraph graph and the Gremlin console as well as some +version {tpvercheck} as well as many prior releases. Tests were performed using the +TinkerGraph in memory graph and the Gremlin console, as well as other TinkerPop 3 enabled graph stores. [[gconsole]] From 303ea86d4d897884cd1612e1e4a1822c561e9ce2 Mon Sep 17 00:00:00 2001 From: Kelvin Lawrence Date: Wed, 4 May 2022 08:18:44 -0500 Subject: [PATCH 03/10] Add front matter summarizing 3.6.0 #115 #240 --- book/Gremlin-Graph-Guide.adoc | 47 +++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/book/Gremlin-Graph-Guide.adoc b/book/Gremlin-Graph-Guide.adoc index 4ad8312..0edae27 100755 --- a/book/Gremlin-Graph-Guide.adoc +++ b/book/Gremlin-Graph-Guide.adoc @@ -344,13 +344,56 @@ removed from the Gremlin language. The newer 'Order.asc' and 'Order.desc' must b used instead. The examples in this book and those in the `sample-code` folder have been updated to reflect these changes. -As always, check the level of ApacheTinkerPop the graph database you are using -supports to make sure the features you want to use are supported. +In January 2022, the TinkerPop 3.5.2 release added a native `datetime` operator to +the Gremlin language such that dates can be added without needing programming +language specific constructs. This is useful when sending Gremlin queries as text +strings. NOTE: Full details of all the new features added in the TinkerPop 3.5.x releases can be found at the following link: https://github.com/apache/tinkerpop/blob/master/CHANGELOG.asciidoc +[[tp36intro]] +Introducing TinkerPop 3.6 +~~~~~~~~~~~~~~~~~~~~~~~~~ + +Apache TinkerPop 3.6.0 was released in April 2022. Coming almost exactly a year after +the initial 3.5.0 release, this is one of the most significant TinkerPop releases +since TinkerPop 3.4.0 appeared in January 2019. The release contains many +improvements, including several new Gremlin steps, designed to make commonly +performed tasks much easier. Notable improvements include: + +- New 'mergeV' and 'mergeE' steps that make "create if not exist" + type queries, sometimes referred to as "upserts", much easier to write. Over time, + these steps will replace use of the 'fold...coalesce' pattern, and will also + replace the various "map injection" patterns that can be used to create multiple + vertices and edges in a single query. +- A new 'TextP.regex' predicate that allows regular expressions to be + used when comparing strings. +- The 'property' step can now be given a map of key/value pairs so that several + properties can be created at once. +- A new 'element' step that can be used to find the parent element (vertex or edge) + of a property. +- A new `call` step that lays the foundation enabling Gremlin queries to call other + endpoints. This opens up many types of interesting use cases such as query + federation, and looking up values from other services. +- A lot of effort has been put into removing unnecessary exceptions by filtering out + parts of traversals instead of failing with an error. This is especially so in the + case of `by` modulators that now filter when a value does not exist rather than + throw an exception. This work began as part of the TinkerPop 3.5.2 update and is + completed as of TinkerPop 3.6.0. +- A new 'fail' step that can be used to abort a query in a controlled way. + +Over time, new sections will be added to this book that cover each of these features +in detail. + +As always, check the level of ApacheTinkerPop the graph database you are using +supports before trying to use these new features. + +NOTE: Full details of all the new features added in the TinkerPop 3.6.x releases can be +found at the following link: +https://github.com/apache/tinkerpop/blob/master/CHANGELOG.asciidoc + [[whygraph]] So what is a graph database and why should I care? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From ee4f7f4940ce56988b6a74f24de5013fc35a086b Mon Sep 17 00:00:00 2001 From: Kelvin Lawrence Date: Wed, 4 May 2022 08:20:47 -0500 Subject: [PATCH 04/10] Add front matter summarizing 3.6.0 #115 #240 --- book/Gremlin-Graph-Guide.adoc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/book/Gremlin-Graph-Guide.adoc b/book/Gremlin-Graph-Guide.adoc index 0edae27..80c2004 100755 --- a/book/Gremlin-Graph-Guide.adoc +++ b/book/Gremlin-Graph-Guide.adoc @@ -2,9 +2,9 @@ PRACTICAL GREMLIN: An Apache TinkerPop Tutorial =============================================== Kelvin R. Lawrence //v281 (TP 3.3.5), January 28th 2019 -v283-preview, May 3rd 2022 +v283-preview, May 4th 2022 // vim: set tw=85 cc=+1 wrap spell redrawtime=20000: -// Tue May 03, 2022 21:08:26 CDT +// Wed May 04, 2022 08:20:08 CDT //:Author: Kelvin R. Lawrence //:Email: gfxman@yahoo.com :Numbered: @@ -25,7 +25,7 @@ v283-preview, May 3rd 2022 :doctype: book :icons: font //:pdf-page-size: Letter -:draftdate: May 3rd 2022 +:draftdate: May 4th 2022 :tpvercheck: 3.5.2 // NOTE1: I updated the paraiso-dark style so that source code with a style of text @@ -374,12 +374,12 @@ performed tasks much easier. Notable improvements include: properties can be created at once. - A new 'element' step that can be used to find the parent element (vertex or edge) of a property. -- A new `call` step that lays the foundation enabling Gremlin queries to call other +- A new 'call' step that lays the foundation enabling Gremlin queries to call other endpoints. This opens up many types of interesting use cases such as query federation, and looking up values from other services. - A lot of effort has been put into removing unnecessary exceptions by filtering out parts of traversals instead of failing with an error. This is especially so in the - case of `by` modulators that now filter when a value does not exist rather than + case of 'by' modulators that now filter when a value does not exist rather than throw an exception. This work began as part of the TinkerPop 3.5.2 update and is completed as of TinkerPop 3.6.0. - A new 'fail' step that can be used to abort a query in a controlled way. From 32e7b3a754cc8e215741cc52fc4db6aa383b81e6 Mon Sep 17 00:00:00 2001 From: Kelvin Lawrence Date: Wed, 4 May 2022 19:26:49 -0500 Subject: [PATCH 05/10] New Go sample, start of 3.6.0 coverage #240 #115 --- ChangeHistory.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeHistory.md b/ChangeHistory.md index e095576..bc089b9 100755 --- a/ChangeHistory.md +++ b/ChangeHistory.md @@ -5,7 +5,8 @@ Starting with the v275 release, this file will contain a record of the major cha ## Release 283 change history (Release date TBD) Here is a link to the [Git diffs](https://github.com/krlawrence/graph/compare/v282-tp-3.4.4...master) between this release and the prior one. -- Moved the supported TinkerPop version up to 3.5.1. Issue #228 +- Moved the supported TinkerPop version up to 3.5.2. Issue #228 +- Added a section describing the changes added as part of the TinkerPop 3.6.0 release. - Upated all sections to remove any use of `Order.decr` and `Order.incr` except where explicitly discussing their removal from Gremlin as of 3.5.0 in favor of `Order.asc` and `Order.desc`. Issue #228 - Added a new section "Comparing properties to the value of a sack". Issue #163 - Added a new section "Using `index` to reverse a list" Issue #220 @@ -37,6 +38,7 @@ Here is a link to the [Git diffs](https://github.com/krlawrence/graph/compare/v2 - Added `RemoteWriteText.java` which shows how to turn traversals and GraphSON back into text queries. - Fixed a compile error in TinkerGraphTest.java caused by a change to the `valueMap` return type. Issue #181 - Fixed two compile errors in RemoteClient.java caused by a change to the `valueMap` return type. Issue #181 + - Added a new sample `go-basic.go` that provides examples of using the new Gremlin Go client - Sample data updates - Added a SQL version of the air routes data to a new `SQL` sub folder under `sample-data`. Issue #214 - Added an RDF version of the air routes data to a new `RDF` sub folder under `sample-data`. Issue #232 From 55cf67ca82422840de6b915044305ca6db16f4c0 Mon Sep 17 00:00:00 2001 From: Kelvin Lawrence Date: Wed, 4 May 2022 19:36:05 -0500 Subject: [PATCH 06/10] Include 3.6.x in allowed versions --- sample-code/regression.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sample-code/regression.groovy b/sample-code/regression.groovy index 1a0cfed..94c77e1 100644 --- a/sample-code/regression.groovy +++ b/sample-code/regression.groovy @@ -24,7 +24,8 @@ println "Reported version is $ver";[] assert ver[0]=='3' && ((ver[2]=='3' && ver[4].toInteger() >= 1) || (ver[2]=='4' && ver[4].toInteger() >= 0) - || (ver[2]=='5' && ver[4].toInteger() >= 0));[] + || (ver[2]=='5' && ver[4].toInteger() >= 0)) + || (ver[2]=='6' && ver[4].toInteger() >= 0));[] n=status( "Checking air-routes version",n);[] ver=g.V().hasLabel('version').values('code').next();[] From 5a8b0290e285a0201b145cd8c0bdf5ff3d8ab82f Mon Sep 17 00:00:00 2001 From: Kelvin Lawrence Date: Wed, 4 May 2022 19:40:24 -0500 Subject: [PATCH 07/10] Update regression.groovy --- sample-code/regression.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-code/regression.groovy b/sample-code/regression.groovy index 94c77e1..b035341 100644 --- a/sample-code/regression.groovy +++ b/sample-code/regression.groovy @@ -24,7 +24,7 @@ println "Reported version is $ver";[] assert ver[0]=='3' && ((ver[2]=='3' && ver[4].toInteger() >= 1) || (ver[2]=='4' && ver[4].toInteger() >= 0) - || (ver[2]=='5' && ver[4].toInteger() >= 0)) + || (ver[2]=='5' && ver[4].toInteger() >= 0) || (ver[2]=='6' && ver[4].toInteger() >= 0));[] n=status( "Checking air-routes version",n);[] From 5273d9f1dd7930ed70bfb8602afdaaab9aa1f274 Mon Sep 17 00:00:00 2001 From: Kelvin Lawrence Date: Thu, 5 May 2022 09:33:46 -0500 Subject: [PATCH 08/10] Minor change --- sample-code/go-basic.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-code/go-basic.go b/sample-code/go-basic.go index bd47320..14c45f0 100644 --- a/sample-code/go-basic.go +++ b/sample-code/go-basic.go @@ -19,7 +19,7 @@ import ( ) // Server and port we want to connect to -const Host = "krl-6-i1-cluster.cluster-cm9t6tfwbtsr.us-east-1.neptune.amazonaws.com" +const Host = "" const Port = 8182 // Define a few shortcuts to commonly used Gremlin constructs From 15abfa2bc2e5c4678497cb192182cc4be60147cb Mon Sep 17 00:00:00 2001 From: Kelvin Lawrence Date: Sat, 11 Jun 2022 17:04:41 -0500 Subject: [PATCH 09/10] Include mention of May 2022 update --- book/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/book/README.md b/book/README.md index 09a524c..4c6f4a7 100644 --- a/book/README.md +++ b/book/README.md @@ -3,7 +3,7 @@ This folder contains the AsciiDoc source file used to produce the HTML, XML (DOC **LATEST NEWS:** -- [Aug-2-2021] The latest preview draft of revision 283 (TP 3.5.1) is now available in HTML and PDF versions. See [change history](https://github.com/krlawrence/graph/blob/master/ChangeHistory.md) for details. +- [May-4-2022] The latest preview draft of revision 283 (TP 3.5.2) is now available in HTML and PDF versions. See [change history](https://github.com/krlawrence/graph/blob/master/ChangeHistory.md) for details. - [Oct-26-2019] Revision 282 (TP 3.4.4) was just published in all formats. See [change history](https://github.com/krlawrence/graph/blob/master/ChangeHistory.md) for details. @@ -31,6 +31,7 @@ Please note that the DOCBOOK, EPUB and MOBI format files currently do not have a **ARCHIVED NEWS:** +- [Aug-2-2021] The latest preview draft of revision 283 (TP 3.5.1) is now available in HTML and PDF versions. See [change history](https://github.com/krlawrence/graph/blob/master/ChangeHistory.md) for details. [Jul-10-2021] The latest preview draft of revision 283 (TP 3.4.10) is now available in HTML and PDF versions. See [change history](https://github.com/krlawrence/graph/blob/master/ChangeHistory.md) for details. [Mar-21-2021] The latest preview draft of revision 283 (TP 3.4.8) is now available in HTML and PDF versions. See [change history](https://github.com/krlawrence/graph/blob/master/ChangeHistory.md) for details. [Mar-14-2021] The latest preview draft of revision 283 (TP 3.4.8) is now available in HTML and PDF versions. See [change history](https://github.com/krlawrence/graph/blob/master/ChangeHistory.md) for details. From a778ab2b261238c3492deee6007968aea7b152a5 Mon Sep 17 00:00:00 2001 From: Kelvin Lawrence Date: Sat, 11 Jun 2022 17:09:49 -0500 Subject: [PATCH 10/10] Add mention of May 4th 2022 updates --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c924f84..0d9ee08 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,8 @@ This repository is the home for the source materials, sample code and examples f To read the latest snapshot of the book right away in a browser (HTML format) click [here](http://kelvinlawrence.net/book/PracticalGremlin.html) or for a PDF version click [here](http://kelvinlawrence.net/book/PracticalGremlin.pdf). These snapshots are updated regularly. You will find other formats including MOBI, EPUB and XML (Docbook) in the [releases](https://github.com/krlawrence/graph/releases) section. Formal releases will be published periodically assuming there is enough new material to make it worthwhile. If you want to see the absolute latest updates you can always browse the Asciidoc source file (Gremlin-Graph-Guide.adoc) in the /book folder. The PDF version is currently the "official" version. It has a better table of contents, some better formatting and a much nicer title page! **LATEST NEWS:** - +- [May-04-2022] The latest preview draft of revision 283 (TP 3.5.1) is now available in HTML and PDF versions. See [change history](https://github.com/krlawrence/graph/blob/master/ChangeHistory.md) for details. - [Aug-31-2021] Updated versions of the sample data and corresponding demo apps have been uploaded. -- [Aug-02-2021] The latest preview draft of revision 283 (TP 3.5.1) is now available in HTML and PDF versions. See [change history](https://github.com/krlawrence/graph/blob/master/ChangeHistory.md) for details. - [Jun-28-2020] I have started creating a series of [issues](https://github.com/krlawrence/graph/issues) to capture changes and updates I hope to make soon. The issues contain some interesting examples of both new Gremlin features and some additional queries, some of which are quite advanced, that I intend to add to the manuscript as time allows. The issues have been sorted into a Kanban board which can be found in the Projects area. - [Oct-26-2019] Revision 282 (TP 3.4.4) was just published in all formats. See [change history](https://github.com/krlawrence/graph/blob/master/ChangeHistory.md) for details. @@ -126,13 +125,13 @@ Chapter 9 - FURTHER READING **NEWS ARCHIVE:** - -[Jul-31-2021] Updated versions of the sample data and corresponding demo apps have been uploaded. +[Aug-02-2021] The latest preview draft of revision 283 (TP 3.5.1) is now available in HTML and PDF versions. See [change history](https://github.com/krlawrence/graph/blob/master/ChangeHistory.md) for details. +[Jul-31-2021] Updated versions of the sample data and corresponding demo apps have been uploaded. [Jul-10-2021] The latest preview draft of revision 283 (TP 3.4.10) is now available in HTML and PDF versions. See [change history](https://github.com/krlawrence/graph/blob/master/ChangeHistory.md) for details. [Mar-21-2021] The latest preview draft of revision 283 (TP 3.4.10) is now available in HTML and PDF versions. See [change history](https://github.com/krlawrence/graph/blob/master/ChangeHistory.md) for details. [Mar-14-2021] The latest preview draft of revision 283 (TP 3.4.10) is now available in HTML and PDF versions. See [change history](https://github.com/krlawrence/graph/blob/master/ChangeHistory.md) for details. [Aug-28-2020] The latest preview draft of revision 283 (TP 3.4.8) is now available in HTML and PDF versions. See [change history](https://github.com/krlawrence/graph/blob/master/ChangeHistory.md) for details. -[Feb-01-2020] Updated versions of the sample data and corresponding demo apps have been uploaded. +[Feb-01-2020] Updated versions of the sample data and corresponding demo apps have been uploaded. [Jan-06-2020] The latest draft of revision 283 (TP 3.4.4 preview) is now available in HTML and PDF versions. See [change history](https://github.com/krlawrence/graph/blob/master/ChangeHistory.md) for details. [Oct-13-2019] Updated versions of the sample data and corresponding demo apps have been uploaded. [Oct-26-2019] Revision 282 (TP 3.4.4) was just published in all formats. See [change history](https://github.com/krlawrence/graph/blob/master/ChangeHistory.md) for details.