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

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


The following commit(s) were added to refs/heads/master by this push:
     new c3124ef7e6 Fix Gremlin Server connection examples in reference intro
c3124ef7e6 is described below

commit c3124ef7e66b422f9c8f8b1144715d8d5fd3deca
Author: Stephen Mallette <[email protected]>
AuthorDate: Fri Sep 11 22:49:07 2026 +0000

    Fix Gremlin Server connection examples in reference intro
    
    Correct the Python remote connection snippet to import traversal from
    gremlin_python.process.anonymous_traversal, import DriverRemoteConnection,
    and call with_() since with is a reserved word in Python. Add the missing
    GraphTraversalSource import to the Java example, and add a note pointing to
    Starting Gremlin Server so the server the section connects to can be 
started.
    
    Assisted-by: Kiro:claude-opus-4.8
---
 docs/src/reference/intro.asciidoc | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/docs/src/reference/intro.asciidoc 
b/docs/src/reference/intro.asciidoc
index 6924e9a3b2..061139d023 100644
--- a/docs/src/reference/intro.asciidoc
+++ b/docs/src/reference/intro.asciidoc
@@ -374,6 +374,11 @@ connect, essentially providing a remote GTM. Gremlin 
Server supports multiple me
 * link:https://tinkerpop.apache.org/docs/x.y.z/dev/provider/#_http_api[HTTP] 
for string-based scripts (both
 gremlin-lang and gremlin-groovy)
 
+NOTE: The examples below connect to a Gremlin Server listening on `localhost` 
at port 8182, so a server must be
+running at that address before a connection can succeed. The 
<<starting-gremlin-server,Starting Gremlin Server>>
+section describes how to launch one with `bin/gremlin-server.sh 
conf/gremlin-server-modern.yaml`, which hosts the
+"modern" toy graph on that port.
+
 Connecting looks somewhat similar to the <<connecting-embedded, embedded>> 
approach in that there is a need to create a
 `GraphTraversalSource`. In the embedded approach, the means for that object's 
creation is derived from a `Graph` object
 which spawns it. In this case, however, the `Graph` instance exists only on 
the server which means that there is no
@@ -387,6 +392,7 @@ connect to:
 import org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteConnection;
 
 // gremlin-core module
+import 
org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import static 
org.apache.tinkerpop.gremlin.process.traversal.AnonymousTraversalSource.traversal;
 
 GraphTraversalSource g = traversal().with(
@@ -405,9 +411,10 @@ def g = traversal().with(
 ----
 [source,python]
 ----
-from gremlin_python.process.anonymous_traversal_source import traversal
+from gremlin_python.process.anonymous_traversal import traversal
+from gremlin_python.driver.driver_remote_connection import 
DriverRemoteConnection
 
-g = traversal().with(
+g = traversal().with_(
           DriverRemoteConnection('http://localhost:8182/gremlin'))
 ----
 

Reply via email to