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

incubator-tinkerpop git commit: Update sample code in docs for remoting to gremlin server.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/master 1e18a92ef -> a52474ab7


Update sample code in docs for remoting to gremlin server.


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

Branch: refs/heads/master
Commit: a52474ab71685946ebddbc7e8b34052add137620
Parents: 1e18a92
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Apr 6 15:03:38 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Apr 6 15:03:38 2015 -0400

----------------------------------------------------------------------
 docs/src/gremlin-applications.asciidoc | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/a52474ab/docs/src/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/gremlin-applications.asciidoc b/docs/src/gremlin-applications.asciidoc
index 27f6664..2221232 100644
--- a/docs/src/gremlin-applications.asciidoc
+++ b/docs/src/gremlin-applications.asciidoc
@@ -279,16 +279,16 @@ The `:remote` command shown above displays the current status of the remote conn
 
 [source,groovy]
 ----
-gremlin> :> g.V().values('name')
+gremlin> :> g.traversal().V().values('name')
 ==>marko
 ==>vadas
 ==>lop
 ==>josh
 ==>ripple
 ==>peter
-gremlin> :> g.V().has('name','marko').out('created').values('name')
+gremlin> :> g.traversal().V().has('name','marko').out('created').values('name')
 ==>lop
-gremlin> :> g.E().label().groupCount()
+gremlin> :> g.traversal().E().label().groupCount()
 ==>{created=4, knows=2}
 gremlin> result
 ==>result{object={created=4, knows=2} class=java.lang.String}
@@ -305,7 +305,7 @@ gremlin> :remote connect tinkerpop.server conf/remote-objects.yaml <1>
 gremlin> :remote list <2>
 ==>0 - Gremlin Server - [localhost/127.0.0.1:8182]
 ==>*1 - Gremlin Server - [localhost/127.0.0.1:8182]
-gremlin> :> g.E().label().groupCount() <3>
+gremlin> :> g.traversal().E().label().groupCount() <3>
 ==>[created:4, knows:2]
 gremlin> m = result[0].object <4>
 ==>created=4
@@ -319,7 +319,7 @@ gremlin> script = """
                   """
 gremlin> :> @script   <5>
 ==>e[14][12-co-creator->1]
-gremlin> :> g.V().has('name','matthias').out('co-creator').values('name')
+gremlin> :> g.traversal().V().has('name','matthias').out('co-creator').values('name')
 ==>marko
 gremlin> :remote close
 ==>Removed - gremlin server - [localhost/127.0.0.1:8182]
@@ -561,7 +561,7 @@ This message can be serialized in any fashion that is supported by Gremlin Serve
 { "requestId":"1d6d02bd-8e56-421d-9438-3bd6d0079ff1",
   "op":"eval",
   "processor":"",
-  "args":{"gremlin":"g.V(x).out()",
+  "args":{"gremlin":"g.traversal().V(x).out()",
           "bindings":{"x":1},
           "language":"gremlin-groovy"}}
 ----
@@ -576,7 +576,7 @@ The first byte represents the length of the "mime type" string value that follow
 
 NOTE: Gremlin Server will only accept masked packets as it pertains to websocket packet header construction.
 
-When Gremlin Server receives that request, it will decode it given the "mime type", pass it to the requested `OpProcessor` which will execute the `op` defined in the message.  In this case, it will evaluate the script `g.V(x).out()` using the `bindings` supplied in the `args` and stream back the results in a series of `ResponseMessages`.  A `ResponseMessage` looks like this:
+When Gremlin Server receives that request, it will decode it given the "mime type", pass it to the requested `OpProcessor` which will execute the `op` defined in the message.  In this case, it will evaluate the script `g.traversal().V(x).out()` using the `bindings` supplied in the `args` and stream back the results in a series of `ResponseMessages`.  A `ResponseMessage` looks like this:
 
 [width="100%",cols="3,10",options="header"]
 |=========================================================
@@ -748,11 +748,11 @@ Start the xref:gremlin-console[Gremlin Console] and activate the Gephi plugin:
 [source,groovy]
 gremlin> :plugin use tinkerpop.gephi
 ==>tinkerpop.gephi activated
-gremlin> g = TinkerFactory.createModern()
+gremlin> graph = TinkerFactory.createModern()
 ==>tinkergraph[vertices:6 edges:6]
 gremlin> :remote connect tinkerpop.gephi
 ==>Connection to Gephi - http://localhost:8080/workspace0 with stepDelay:1000, startRGBColor:[0.0, 1.0, 0.5], colorToFade:g, colorFadeRate:0.7
-gremlin> :> g
+gremlin> :> graph
 ==>tinkergraph[vertices:6 edges:6]
 
 The above Gremlin session activates the Gephi plugin, creates the "modern" `TinkerGraph`, uses the `:remote` command to setup a connection to the Graph Streaming server in Gephi (with default parameters that will be explained below), and then uses `:submit` which sends the vertices and edges of the graph to the Gephi Streaming Server. The resulting graph appears in Gephi as displayed in the left image below.