You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2016/04/21 15:20:06 UTC

[08/13] incubator-tinkerpop git commit: integrated the GremlinServer string text better with the example.

integrated the GremlinServer string text better with the example.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/62fa995d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/62fa995d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/62fa995d

Branch: refs/heads/TINKERPOP-1232
Commit: 62fa995d8e38b80638e62081e98e7070675bede0
Parents: 4eb6113
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Apr 20 19:41:26 2016 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Apr 20 19:41:26 2016 -0600

----------------------------------------------------------------------
 .../gremlin-language-variants/index.asciidoc    | 31 +++++++++++++++-----
 1 file changed, 23 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/62fa995d/docs/src/tutorials/gremlin-language-variants/index.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/tutorials/gremlin-language-variants/index.asciidoc b/docs/src/tutorials/gremlin-language-variants/index.asciidoc
index 05b6633..76cf1e1 100644
--- a/docs/src/tutorials/gremlin-language-variants/index.asciidoc
+++ b/docs/src/tutorials/gremlin-language-variants/index.asciidoc
@@ -436,10 +436,21 @@ Using Python and JNI
 Using Python and GremlinServer
 ------------------------------
 
-The last model does not leverage the JVM. Instead, it constructs a String representation of a `Traversal` that will
-ultimately be evaluated by a registered `ScriptEngine` in GremlinServer or a `RemoteConnection`. Note that all that this
-generated Python file does is generate a String. It has no concept of WebSockets, or REST, or the JVM. It is up to the
-language variant designer to choose a language driver to use for submitted the generated String.
+The last model does not leverage the JVM directly. Instead, it constructs a `String` representation of a `Traversal`
+that will ultimately be evaluated by a registered `ScriptEngine` at a GremlinServer or `RemoteConnection`. It is up to the
+language variant designer to choose a _language driver_ to use for submitting the generated String and processing its
+returned results. For this example, the link:https://github.com/davebshow/gremlinclient[gremlinclient] Python language
+driver is used and its installation via link:https://en.wikipedia.org/wiki/Pip_(package_manager)[pip] is provided below.
+
+[source,bash]
+----
+$ # sudo easy_install pip
+$ sudo pip install gremlinclient
+----
+
+IMPORTANT: When language drivers are seperated from language variants, language variants can more easily choose a language
+driver to use. In fact, it is possible for multiple language drivers to be supported by a language variant as GremlinServer,
+for example, supports WebSockets, REST, etc.
 
 [source,groovy]
 ----
@@ -573,15 +584,19 @@ string is created behind the scenes.
 
 [source,python]
 ----
+Python 2.7.2 (default, Oct 11 2012, 20:14:37)
+[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
+Type "help", "copyright", "credits" or "license" for more information.
 >>> execfile("/usr/local/apache-gremlin-console-x.y.z-standalone/lib/gremlin-python.py")
 >>> g = PythonGraphTraversalSource("g")
 # nested traversal with Python slicing and attribute interception extensions
 >>> g.V().hasLabel("person").repeat(__.out()).times(2).name[0:2]
 g.V().hasLabel("person").repeat(__.out()).times(2).values("name").range(0, 2)
->>>
+>>> g.V().hasLabel("person").repeat(__.out()).times(2).name[0:2].toList()
+[u'ripple', u'lop']
 ----
 
-IMPORTANT: The string that is generated for submission to a GremlinServer or `RemoteConnection` does not have to be a
+NOTE: The string that is generated for submission to a GremlinServer or `RemoteConnection` does not have to be a
 Gremlin-Groovy string. However, it must be a string that has a respective `ScriptEngine` that is enabled on the remote
-GremlinServer. It is recommended that a `Gremlin-Groovy` string be constructed as Gremlin-Groovy is maintained by
-Apache TinkerPop and is guaranteed to be perfectly aligned with Gremlin-Java.
\ No newline at end of file
+location. It is recommended that a Gremlin-Groovy string be constructed as Gremlin-Groovy is maintained by
+Apache TinkerPop and is guaranteed to always be aligned with Gremlin-Java.
\ No newline at end of file