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 <cole.gr...@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)