You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by co...@apache.org on 2023/12/14 23:30:13 UTC

(tinkerpop) branch master updated (6405e102ae -> 307ebbcbcd)

This is an automated email from the ASF dual-hosted git repository.

colegreer pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


    from 6405e102ae CTR fix python test failure
     add 9f97af5a87 TINKERPOP-2995 Create Sample Applications in each GLV 3.6 (#2299)
     add df1d4538ee Merge branch '3.6-dev' into 3.7-dev
     add 6fbafc436c TINKERPOP-2995 Create Sample Applications in each GLV for 3.7 (#2298)
     new 0d43110833 Merge branch '3.7-dev'
     new 307ebbcbcd CTR Update examples to use new with() syntax when creating g

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 bin/run-examples.sh                                | 119 ++++++++
 docs/src/dev/developer/release.asciidoc            |   1 +
 docs/src/reference/gremlin-variants.asciidoc       | 170 +++++++++--
 .../Examples/BasicGremlin/BasicGremlin.cs          |  54 ++++
 .../Examples/BasicGremlin/BasicGremlin.csproj      |  56 ++--
 gremlin-dotnet/Examples/Connections/Connections.cs |  74 +++++
 .../Examples/Connections/Connections.csproj        |  56 ++--
 gremlin-dotnet/Examples/Examples.sln               |  37 +++
 .../Examples/ModernTraversals/ModernTraversals.cs  |  71 +++++
 .../ModernTraversals/ModernTraversals.csproj       |  24 +-
 gremlin-driver/pom.xml                             |   9 +
 .../src/main/java/examples/BasicGremlin.java       |  56 ++++
 .../src/main/java/examples/Connections.java        | 116 ++++++++
 .../src/main/java/examples/ModernTraversals.java   |  71 +++++
 gremlin-driver/src/main/java/examples/pom.xml      |  91 ++++++
 gremlin-go/example/go.sum                          | 315 ---------------------
 gremlin-go/examples/basic_gremlin.go               |  69 +++++
 .../example.go => examples/connections.go}         |  55 ++--
 gremlin-go/{example => examples}/go.mod            |   8 +-
 gremlin-go/examples/go.sum                         |  44 +++
 gremlin-go/examples/modern_traversals.go           |  77 +++++
 gremlin-javascript/examples/.gitignore             |   1 +
 gremlin-javascript/examples/basic-gremlin.js       |  51 ++++
 gremlin-javascript/examples/connections.js         |  65 +++++
 gremlin-javascript/examples/modern-traversals.js   |  69 +++++
 gremlin-javascript/examples/package-lock.json      |  47 +++
 gremlin-javascript/examples/package.json           |  14 +
 gremlin-python/src/main/python/example.py          |  52 ----
 .../src/main/python/examples/basic_gremlin.py      |  54 ++++
 .../src/main/python/examples/connections.py        | 101 +++++++
 .../src/main/python/examples/modern_traversals.py  |  69 +++++
 .../__init__.py => examples/requirements.txt}      |  15 +-
 32 files changed, 1642 insertions(+), 469 deletions(-)
 create mode 100755 bin/run-examples.sh
 create mode 100644 gremlin-dotnet/Examples/BasicGremlin/BasicGremlin.cs
 copy gremlin-console/src/test/resources/logback-silent.xml => gremlin-dotnet/Examples/BasicGremlin/BasicGremlin.csproj (67%)
 create mode 100644 gremlin-dotnet/Examples/Connections/Connections.cs
 copy gremlin-console/src/test/resources/logback-silent.xml => gremlin-dotnet/Examples/Connections/Connections.csproj (67%)
 create mode 100644 gremlin-dotnet/Examples/Examples.sln
 create mode 100644 gremlin-dotnet/Examples/ModernTraversals/ModernTraversals.cs
 copy gremlin-console/src/test/resources/logback-test.xml => gremlin-dotnet/Examples/ModernTraversals/ModernTraversals.csproj (69%)
 create mode 100644 gremlin-driver/src/main/java/examples/BasicGremlin.java
 create mode 100644 gremlin-driver/src/main/java/examples/Connections.java
 create mode 100644 gremlin-driver/src/main/java/examples/ModernTraversals.java
 create mode 100644 gremlin-driver/src/main/java/examples/pom.xml
 delete mode 100644 gremlin-go/example/go.sum
 create mode 100644 gremlin-go/examples/basic_gremlin.go
 rename gremlin-go/{example/example.go => examples/connections.go} (58%)
 rename gremlin-go/{example => examples}/go.mod (81%)
 create mode 100644 gremlin-go/examples/go.sum
 create mode 100644 gremlin-go/examples/modern_traversals.go
 create mode 100644 gremlin-javascript/examples/.gitignore
 create mode 100644 gremlin-javascript/examples/basic-gremlin.js
 create mode 100644 gremlin-javascript/examples/connections.js
 create mode 100644 gremlin-javascript/examples/modern-traversals.js
 create mode 100644 gremlin-javascript/examples/package-lock.json
 create mode 100644 gremlin-javascript/examples/package.json
 delete mode 100644 gremlin-python/src/main/python/example.py
 create mode 100644 gremlin-python/src/main/python/examples/basic_gremlin.py
 create mode 100644 gremlin-python/src/main/python/examples/connections.py
 create mode 100644 gremlin-python/src/main/python/examples/modern_traversals.py
 copy gremlin-python/src/main/python/{gremlin_python/__init__.py => examples/requirements.txt} (80%)


(tinkerpop) 02/02: CTR Update examples to use new with() syntax when creating g

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

colegreer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 307ebbcbcd72de6f3666b73c1288f500fbc2181a
Author: Cole-Greer <Co...@improving.com>
AuthorDate: Thu Dec 14 15:25:09 2023 -0800

    CTR Update examples to use new with() syntax when creating g
---
 gremlin-dotnet/Examples/BasicGremlin/BasicGremlin.cs         | 2 +-
 gremlin-dotnet/Examples/Connections/Connections.cs           | 2 +-
 gremlin-dotnet/Examples/ModernTraversals/ModernTraversals.cs | 2 +-
 gremlin-driver/src/main/java/examples/BasicGremlin.java      | 2 +-
 gremlin-driver/src/main/java/examples/Connections.java       | 8 ++++----
 gremlin-driver/src/main/java/examples/ModernTraversals.java  | 2 +-
 gremlin-go/examples/basic_gremlin.go                         | 4 ++--
 gremlin-javascript/examples/basic-gremlin.js                 | 2 +-
 gremlin-javascript/examples/connections.js                   | 2 +-
 gremlin-javascript/examples/modern-traversals.js             | 2 +-
 gremlin-python/src/main/python/examples/basic_gremlin.py     | 2 +-
 gremlin-python/src/main/python/examples/connections.py       | 2 +-
 gremlin-python/src/main/python/examples/modern_traversals.py | 2 +-
 13 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/gremlin-dotnet/Examples/BasicGremlin/BasicGremlin.cs b/gremlin-dotnet/Examples/BasicGremlin/BasicGremlin.cs
index 91820bfe09..9971ef1809 100644
--- a/gremlin-dotnet/Examples/BasicGremlin/BasicGremlin.cs
+++ b/gremlin-dotnet/Examples/BasicGremlin/BasicGremlin.cs
@@ -27,7 +27,7 @@ public class BasicGremlinExample
     {
         var server = new GremlinServer("localhost", 8182);
         using var remoteConnection = new DriverRemoteConnection(new GremlinClient(server), "g");
-        var g = Traversal().WithRemote(remoteConnection);
+        var g = Traversal().With(remoteConnection);
 
         // Basic Gremlin: adding and retrieving data
         var v1 = g.AddV("person").Property("name", "marko").Next();
diff --git a/gremlin-dotnet/Examples/Connections/Connections.cs b/gremlin-dotnet/Examples/Connections/Connections.cs
index 26490f750b..d5a4e648f8 100644
--- a/gremlin-dotnet/Examples/Connections/Connections.cs
+++ b/gremlin-dotnet/Examples/Connections/Connections.cs
@@ -36,7 +36,7 @@ public class ConnectionExample
     {
         var server = new GremlinServer("localhost", 8182);
         using var remoteConnection = new DriverRemoteConnection(new GremlinClient(server), "g");
-        var g = Traversal().WithRemote(remoteConnection);
+        var g = Traversal().With(remoteConnection);
 
         // Drop existing vertices
         g.V().Drop().Iterate();
diff --git a/gremlin-dotnet/Examples/ModernTraversals/ModernTraversals.cs b/gremlin-dotnet/Examples/ModernTraversals/ModernTraversals.cs
index fab7073530..b112254556 100644
--- a/gremlin-dotnet/Examples/ModernTraversals/ModernTraversals.cs
+++ b/gremlin-dotnet/Examples/ModernTraversals/ModernTraversals.cs
@@ -30,7 +30,7 @@ public class ModernTraversalExample
     {
         var server = new GremlinServer("localhost", 8182);
         using var remoteConnection = new DriverRemoteConnection(new GremlinClient(server), "g");
-        var g = Traversal().WithRemote(remoteConnection);
+        var g = Traversal().With(remoteConnection);
 
         /*
         This example requires the Modern toy graph to be preloaded upon launching the Gremlin server.
diff --git a/gremlin-driver/src/main/java/examples/BasicGremlin.java b/gremlin-driver/src/main/java/examples/BasicGremlin.java
index a5075d4606..46542a6e25 100644
--- a/gremlin-driver/src/main/java/examples/BasicGremlin.java
+++ b/gremlin-driver/src/main/java/examples/BasicGremlin.java
@@ -31,7 +31,7 @@ import static org.apache.tinkerpop.gremlin.process.traversal.AnonymousTraversalS
 public class BasicGremlin {
     public static void main(String[] args) {
         Graph graph = TinkerGraph.open();
-        GraphTraversalSource g = traversal().withEmbedded(graph);
+        GraphTraversalSource g = traversal().with(graph);
 
         // Basic Gremlin: adding and retrieving data
         Vertex v1 = g.addV("person").property("name","marko").next();
diff --git a/gremlin-driver/src/main/java/examples/Connections.java b/gremlin-driver/src/main/java/examples/Connections.java
index 458d5c8fd5..d388cad824 100644
--- a/gremlin-driver/src/main/java/examples/Connections.java
+++ b/gremlin-driver/src/main/java/examples/Connections.java
@@ -45,7 +45,7 @@ public class Connections {
     // Creating an embedded graph
     private static void withEmbedded() throws Exception {
         Graph graph = TinkerGraph.open();
-        GraphTraversalSource g = traversal().withEmbedded(graph);
+        GraphTraversalSource g = traversal().with(graph);
 
         g.addV().iterate();
         long count = g.V().count().next();
@@ -57,7 +57,7 @@ public class Connections {
     // Connecting to the server
     private static void withRemote() throws Exception {
         Cluster cluster = Cluster.build("localhost").port(8182).create();
-        GraphTraversalSource g = traversal().withRemote(DriverRemoteConnection.using(cluster, "g"));
+        GraphTraversalSource g = traversal().with(DriverRemoteConnection.using(cluster, "g"));
 
         // Drop existing vertices
         g.V().drop().iterate();
@@ -83,7 +83,7 @@ public class Connections {
             port(8182).
             serializer(new GraphBinaryMessageSerializerV1()).
             create();
-        GraphTraversalSource g = traversal().withRemote(DriverRemoteConnection.using(cluster, "g"));
+        GraphTraversalSource g = traversal().with(DriverRemoteConnection.using(cluster, "g"));
 
         g.addV().iterate();
         long count = g.V().count().next();
@@ -102,7 +102,7 @@ public class Connections {
             serializer(serializer).
             create();
         Client client = cluster.connect();
-        GraphTraversalSource g = traversal().withRemote(DriverRemoteConnection.using(client, "g"));
+        GraphTraversalSource g = traversal().with(DriverRemoteConnection.using(client, "g"));
 
         g.addV().iterate();
         long count = g.V().count().next();
diff --git a/gremlin-driver/src/main/java/examples/ModernTraversals.java b/gremlin-driver/src/main/java/examples/ModernTraversals.java
index c67b6daeb2..cbaef5e5a8 100644
--- a/gremlin-driver/src/main/java/examples/ModernTraversals.java
+++ b/gremlin-driver/src/main/java/examples/ModernTraversals.java
@@ -36,7 +36,7 @@ public class ModernTraversals {
     public static void main(String[] args) {
         // Performs basic traversals on the Modern toy graph which can be created using TinkerFactory
         Graph modern = TinkerFactory.createModern();
-        GraphTraversalSource g = traversal().withEmbedded(modern);
+        GraphTraversalSource g = traversal().with(modern);
 
         List<Edge> e1 = g.V(1).bothE().toList(); // (1)
         List<Edge> e2 = g.V(1).bothE().where(otherV().hasId(2)).toList(); // (2)
diff --git a/gremlin-go/examples/basic_gremlin.go b/gremlin-go/examples/basic_gremlin.go
index 0ab2b1117f..c4bb8e6c23 100644
--- a/gremlin-go/examples/basic_gremlin.go
+++ b/gremlin-go/examples/basic_gremlin.go
@@ -32,7 +32,7 @@ func main() {
 		return
 	}
 	defer driverRemoteConnection.Close()
-	g := gremlingo.Traversal_().WithRemote(driverRemoteConnection)
+	g := gremlingo.Traversal_().With(driverRemoteConnection)
 
 	// Basic Gremlin: adding and retrieving data
 	v1, err := g.AddV("person").Property("name", "marko").Next()
@@ -66,4 +66,4 @@ func main() {
 	for _, person := range peopleMarkoKnows {
 		fmt.Println("marko knows", person.GetString())
 	}
-}
\ No newline at end of file
+}
diff --git a/gremlin-javascript/examples/basic-gremlin.js b/gremlin-javascript/examples/basic-gremlin.js
index 77e7f3b7d9..bc412b356b 100644
--- a/gremlin-javascript/examples/basic-gremlin.js
+++ b/gremlin-javascript/examples/basic-gremlin.js
@@ -23,7 +23,7 @@ const DriverRemoteConnection = gremlin.driver.DriverRemoteConnection;
 
 async function main() {
     const dc = new DriverRemoteConnection('ws://localhost:8182/gremlin');
-    const g = traversal().withRemote(dc);
+    const g = traversal().with(dc);
 
     // Basic Gremlin: adding and retrieving data
     const v1 = await g.addV('person').property('name','marko').next();
diff --git a/gremlin-javascript/examples/connections.js b/gremlin-javascript/examples/connections.js
index 183f6404f6..4264ec5471 100644
--- a/gremlin-javascript/examples/connections.js
+++ b/gremlin-javascript/examples/connections.js
@@ -30,7 +30,7 @@ async function main() {
 async function withRemote() {
     // Connecting to the server
     const dc = new DriverRemoteConnection('ws://localhost:8182/gremlin');
-    const g = traversal().withRemote(dc);
+    const g = traversal().with(dc);
 
     // Drop existing vertices
     await g.V().drop().iterate();
diff --git a/gremlin-javascript/examples/modern-traversals.js b/gremlin-javascript/examples/modern-traversals.js
index 66b039fca3..dfac46a080 100644
--- a/gremlin-javascript/examples/modern-traversals.js
+++ b/gremlin-javascript/examples/modern-traversals.js
@@ -31,7 +31,7 @@ async function main() {
     conf/gremlin-server-modern.yaml.
     */
     const dc = new DriverRemoteConnection('ws://localhost:8182/gremlin');
-    const g = traversal().withRemote(dc);
+    const g = traversal().with(dc);
 
     const e1 = await g.V(1).bothE().toList(); // (1)
     const e2 = await g.V(1).bothE().where(__.otherV().hasId(2)).toList(); // (2)
diff --git a/gremlin-python/src/main/python/examples/basic_gremlin.py b/gremlin-python/src/main/python/examples/basic_gremlin.py
index 256ed98441..1dfe75be4d 100644
--- a/gremlin-python/src/main/python/examples/basic_gremlin.py
+++ b/gremlin-python/src/main/python/examples/basic_gremlin.py
@@ -26,7 +26,7 @@ from gremlin_python.driver.driver_remote_connection import DriverRemoteConnectio
 
 def main():
     rc = DriverRemoteConnection('ws://localhost:8182/gremlin', 'g')
-    g = traversal().with_remote(rc)
+    g = traversal().with_(rc)
 
     # basic Gremlin: adding and retrieving data
     v1 = g.add_v('person').property('name', 'marko').next()
diff --git a/gremlin-python/src/main/python/examples/connections.py b/gremlin-python/src/main/python/examples/connections.py
index f268e6c27d..dd9fd6a163 100644
--- a/gremlin-python/src/main/python/examples/connections.py
+++ b/gremlin-python/src/main/python/examples/connections.py
@@ -41,7 +41,7 @@ def with_remote():
     # which starts it in "console" mode with an empty in-memory TinkerGraph ready to go bound to a
     # variable named "g" as referenced in the following line.
     rc = DriverRemoteConnection('ws://localhost:8182/gremlin', 'g')
-    g = traversal().with_remote(rc)
+    g = traversal().with_(rc)
 
     # drop existing vertices
     g.V().drop().iterate()
diff --git a/gremlin-python/src/main/python/examples/modern_traversals.py b/gremlin-python/src/main/python/examples/modern_traversals.py
index ae757b10b4..32b4e1fb20 100644
--- a/gremlin-python/src/main/python/examples/modern_traversals.py
+++ b/gremlin-python/src/main/python/examples/modern_traversals.py
@@ -32,7 +32,7 @@ def main():
     # For details, see https://tinkerpop.apache.org/docs/current/reference/#gremlin-server-docker-image and use
     # conf/gremlin-server-modern.yaml.
     rc = DriverRemoteConnection('ws://localhost:8182/gremlin', 'g')
-    g = traversal().with_remote(rc)
+    g = traversal().with_(rc)
 
     e1 = g.V(1).both_e().to_list()  # (1)
     e2 = g.V(1).both_e().where(__.other_v().has_id(2)).to_list()  # (2)


(tinkerpop) 01/02: Merge branch '3.7-dev'

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

colegreer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 0d43110833230100394aa0593f925967cac170c0
Merge: 6405e102ae 6fbafc436c
Author: Cole-Greer <Co...@improving.com>
AuthorDate: Thu Dec 14 14:55:51 2023 -0800

    Merge branch '3.7-dev'

 bin/run-examples.sh                                | 119 ++++++++
 docs/src/dev/developer/release.asciidoc            |   1 +
 docs/src/reference/gremlin-variants.asciidoc       | 170 +++++++++--
 .../Examples/BasicGremlin/BasicGremlin.cs          |  54 ++++
 .../Examples/BasicGremlin/BasicGremlin.csproj      |  30 ++
 gremlin-dotnet/Examples/Connections/Connections.cs |  74 +++++
 .../Examples/Connections/Connections.csproj        |  30 ++
 gremlin-dotnet/Examples/Examples.sln               |  37 +++
 .../Examples/ModernTraversals/ModernTraversals.cs  |  71 +++++
 .../ModernTraversals/ModernTraversals.csproj       |  30 ++
 gremlin-driver/pom.xml                             |   9 +
 .../src/main/java/examples/BasicGremlin.java       |  56 ++++
 .../src/main/java/examples/Connections.java        | 116 ++++++++
 .../src/main/java/examples/ModernTraversals.java   |  71 +++++
 gremlin-driver/src/main/java/examples/pom.xml      |  91 ++++++
 gremlin-go/example/go.sum                          | 315 ---------------------
 gremlin-go/examples/basic_gremlin.go               |  69 +++++
 .../example.go => examples/connections.go}         |  55 ++--
 gremlin-go/{example => examples}/go.mod            |   8 +-
 gremlin-go/examples/go.sum                         |  44 +++
 gremlin-go/examples/modern_traversals.go           |  77 +++++
 gremlin-javascript/examples/.gitignore             |   1 +
 gremlin-javascript/examples/basic-gremlin.js       |  51 ++++
 gremlin-javascript/examples/connections.js         |  65 +++++
 gremlin-javascript/examples/modern-traversals.js   |  69 +++++
 gremlin-javascript/examples/package-lock.json      |  47 +++
 gremlin-javascript/examples/package.json           |  14 +
 gremlin-python/src/main/python/example.py          |  52 ----
 .../src/main/python/examples/basic_gremlin.py      |  54 ++++
 .../src/main/python/examples/connections.py        | 101 +++++++
 .../src/main/python/examples/modern_traversals.py  |  69 +++++
 .../src/main/python/examples/requirements.txt      |  29 ++
 32 files changed, 1675 insertions(+), 404 deletions(-)

diff --cc gremlin-go/examples/connections.go
index ec2652191c,3e1f1de174..284720ab44
--- a/gremlin-go/examples/connections.go
+++ b/gremlin-go/examples/connections.go
@@@ -21,21 -21,20 +21,18 @@@ package mai
  
  import (
  	"fmt"
- 	gremlingo "github.com/apache/tinkerpop/gremlin-go/driver"
 -
--	"github.com/apache/tinkerpop/gremlin-go/v3/driver"
  )
  
- // syntactic sugar
- var __ = gremlingo.T__
- var gt = gremlingo.P.Gt
- var order = gremlingo.Order
- 
  func main() {
- 	// Creating the connection to the server.
- 	driverRemoteConnection, err := gremlingo.NewDriverRemoteConnection("ws://localhost:8182/gremlin",
- 		func(settings *gremlingo.DriverRemoteConnectionSettings) {
- 			settings.TraversalSource = "gmodern"
- 		})
+ 	withRemote()
+ 	withConfigs()
+ }
+ 
+ func withRemote() {
 -    // Creating the connection to the server
 -    driverRemoteConnection, err := gremlingo.NewDriverRemoteConnection("ws://localhost:8182/gremlin")
++	// Creating the connection to the server
++	driverRemoteConnection, err := gremlingo.NewDriverRemoteConnection("ws://localhost:8182/gremlin")
+ 
+ 	// Error handling
  	if err != nil {
  		fmt.Println(err)
  		return
@@@ -43,16 -43,39 +41,39 @@@
  	// Cleanup
  	defer driverRemoteConnection.Close()
  
 -    // Creating the graph traversal
 -	g := gremlingo.Traversal_().WithRemote(driverRemoteConnection)
 +	// Creating graph traversal
 +	g := gremlingo.Traversal_().With(driverRemoteConnection)
  
- 	// Perform traversal
- 	result, err := g.V().HasLabel("person").Has("age", __.Is(gt(28))).Order().By("age", order.Desc).Values("name").ToList()
 -    // Drop existing vertices
 -    prom := g.V().Drop().Iterate()
 -    <-prom
++	// Drop existing vertices
++	prom := g.V().Drop().Iterate()
++	<-prom
+ 
 -    // Simple query to verify connection
 -    g.AddV().Iterate()
 -    count, _ := g.V().Count().Next()
 -    fmt.Println("Vertex count:", *count)
++	// Simple query to verify connection
++	g.AddV().Iterate()
++	count, _ := g.V().Count().Next()
++	fmt.Println("Vertex count:", *count)
+ }
+ 
+ func withConfigs() {
+ 	// Connecting to the server with customized configurations
+ 	driverRemoteConnection, err := gremlingo.NewDriverRemoteConnection("ws://localhost:8182/gremlin",
+ 		func(settings *gremlingo.DriverRemoteConnectionSettings) {
+ 			settings.TraversalSource = "g"
+ 			settings.NewConnectionThreshold = 4
+ 			settings.EnableCompression = false
+ 			settings.ReadBufferSize = 0
+ 			settings.WriteBufferSize = 0
+ 		})
+ 
  	if err != nil {
  		fmt.Println(err)
  		return
  	}
- 	for _, r := range result {
- 		fmt.Println(r.GetString())
- 	}
+ 
+ 	defer driverRemoteConnection.Close()
+ 	g := gremlingo.Traversal_().WithRemote(driverRemoteConnection)
+ 
 -    g.AddV().Iterate()
 -    count, _ := g.V().Count().Next()
 -    fmt.Println("Vertex count:", *count)
 -}
++	g.AddV().Iterate()
++	count, _ := g.V().Count().Next()
++	fmt.Println("Vertex count:", *count)
 +}