tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject svn commit: r1763321 [3/28] - in /tinkerpop/site: docs/3.2.3-SNAPSHOT/dev/provider/ docs/3.2.3-SNAPSHOT/recipes/ docs/3.2.3-SNAPSHOT/reference/ docs/3.2.3-SNAPSHOT/tutorials/getting-started/ docs/3.2.3-SNAPSHOT/tutorials/the-gremlin-console/ docs/3.2.3...
Date Tue, 04 Oct 2016 19:42:20 GMT
Modified: tinkerpop/site/docs/3.2.3-SNAPSHOT/reference/index.html
URL: http://svn.apache.org/viewvc/tinkerpop/site/docs/3.2.3-SNAPSHOT/reference/index.html?rev=1763321&r1=1763320&r2=1763321&view=diff
==============================================================================
--- tinkerpop/site/docs/3.2.3-SNAPSHOT/reference/index.html (original)
+++ tinkerpop/site/docs/3.2.3-SNAPSHOT/reference/index.html Tue Oct  4 19:42:19 2016
@@ -1789,9 +1789,14 @@ be spawned off that vertex.</p>
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>marko = g.V().has('name','marko').next() <b>(1)</b>
-g.V(marko).out('knows') <b>(2)</b>
-g.V(marko).out('knows').values('name') <b>(3)</b></pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; marko = g.V().has(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">marko</span><span class="delimiter">'</span></span>).next() <span class="comment">//</span><b>(1)</b>
+==&gt;v[<span class="integer">1</span>]
+gremlin&gt; g.V(marko).out(<span class="string"><span class="delimiter">'</span><span class="content">knows</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(2)</b>
+==&gt;v[<span class="integer">2</span>]
+==&gt;v[<span class="integer">4</span>]
+gremlin&gt; g.V(marko).out(<span class="string"><span class="delimiter">'</span><span class="content">knows</span><span class="delimiter">'</span></span>).values(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(3)</b>
+==&gt;vadas
+==&gt;josh</code></pre>
 </div>
 </div>
 <div class="colist arabic">
@@ -1828,7 +1833,9 @@ the current object being traversed, etc.
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V(marko).out('knows').values('name').path()</pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V(marko).out(<span class="string"><span class="delimiter">'</span><span class="content">knows</span><span class="delimiter">'</span></span>).values(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>).path()
+==&gt;[v[<span class="integer">1</span>],v[<span class="integer">2</span>],vadas]
+==&gt;[v[<span class="integer">1</span>],v[<span class="integer">4</span>],josh]</code></pre>
 </div>
 </div>
 <div class="admonitionblock warning">
@@ -1851,7 +1858,9 @@ has gone through a particular section of
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V(marko).repeat(out()).times(2).values('name')</pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V(marko).repeat(out()).times(<span class="integer">2</span>).values(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>)
+==&gt;ripple
+==&gt;lop</code></pre>
 </div>
 </div>
 <div class="admonitionblock warning">
@@ -1983,8 +1992,109 @@ system providers for two purposes:</p>
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>graph = TinkerGraph.open()
-graph.features()</pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; graph = TinkerGraph.open()
+==&gt;tinkergraph[<span class="key">vertices</span>:<span class="integer">0</span> <span class="key">edges</span>:<span class="integer">0</span>]
+gremlin&gt; graph.features()
+==&gt;FEATURES
+&gt; GraphFeatures
+&gt;-- <span class="key">Transactions</span>: <span class="predefined-constant">false</span>
+&gt;-- <span class="key">ConcurrentAccess</span>: <span class="predefined-constant">false</span>
+&gt;-- <span class="key">ThreadedTransactions</span>: <span class="predefined-constant">false</span>
+&gt;-- <span class="key">Computer</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">Persistence</span>: <span class="predefined-constant">true</span>
+&gt; VariableFeatures
+&gt;-- <span class="key">Variables</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">LongArrayValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">StringArrayValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">BooleanValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">ByteValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">DoubleValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">FloatValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">IntegerValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">LongValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">MapValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">MixedListValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">SerializableValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">StringValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">UniformListValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">BooleanArrayValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">ByteArrayValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">DoubleArrayValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">FloatArrayValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">IntegerArrayValues</span>: <span class="predefined-constant">true</span>
+&gt; VertexFeatures
+&gt;-- <span class="key">AddVertices</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">RemoveVertices</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">MetaProperties</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">MultiProperties</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">AddProperty</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">RemoveProperty</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">NumericIds</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">StringIds</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">UuidIds</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">CustomIds</span>: <span class="predefined-constant">false</span>
+&gt;-- <span class="key">UserSuppliedIds</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">AnyIds</span>: <span class="predefined-constant">true</span>
+&gt; VertexPropertyFeatures
+&gt;-- <span class="key">AddProperty</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">RemoveProperty</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">NumericIds</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">StringIds</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">UuidIds</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">CustomIds</span>: <span class="predefined-constant">false</span>
+&gt;-- <span class="key">UserSuppliedIds</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">AnyIds</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="predefined-type">Properties</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">LongArrayValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">StringArrayValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">BooleanValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">ByteValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">DoubleValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">FloatValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">IntegerValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">LongValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">MapValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">MixedListValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">SerializableValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">StringValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">UniformListValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">BooleanArrayValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">ByteArrayValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">DoubleArrayValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">FloatArrayValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">IntegerArrayValues</span>: <span class="predefined-constant">true</span>
+&gt; EdgeFeatures
+&gt;-- <span class="key">AddEdges</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">RemoveEdges</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">AddProperty</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">RemoveProperty</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">NumericIds</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">StringIds</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">UuidIds</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">CustomIds</span>: <span class="predefined-constant">false</span>
+&gt;-- <span class="key">UserSuppliedIds</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">AnyIds</span>: <span class="predefined-constant">true</span>
+&gt; EdgePropertyFeatures
+&gt;-- <span class="predefined-type">Properties</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">LongArrayValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">StringArrayValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">BooleanValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">ByteValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">DoubleValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">FloatValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">IntegerValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">LongValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">MapValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">MixedListValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">SerializableValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">StringValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">UniformListValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">BooleanArrayValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">ByteArrayValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">DoubleArrayValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">FloatArrayValues</span>: <span class="predefined-constant">true</span>
+&gt;-- <span class="key">IntegerArrayValues</span>: <span class="predefined-constant">true</span>
+</code></pre>
 </div>
 </div>
 <div class="paragraph">
@@ -1992,8 +2102,10 @@ graph.features()</pre>
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>graph.features().graph().supportsTransactions()
-graph.features().graph().supportsTransactions() ? g.tx().commit() : "no tx"</pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; graph.features().graph().supportsTransactions()
+==&gt;<span class="predefined-constant">false</span>
+gremlin&gt; graph.features().graph().supportsTransactions() ? g.tx().commit() : <span class="string"><span class="delimiter">&quot;</span><span class="content">no tx</span><span class="delimiter">&quot;</span></span>
+==&gt;no tx</code></pre>
 </div>
 </div>
 <div class="admonitionblock tip">
@@ -2071,31 +2183,66 @@ of a name from different sources.</p>
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>graph = TinkerGraph.open()
-g = graph.traversal()
-v = g.addV('name','marko','name','marko a. rodriguez').next()
-g.V(v).properties('name').count() <b>(1)</b>
-v.property(list, 'name', 'm. a. rodriguez') <b>(2)</b>
-g.V(v).properties('name').count()
-g.V(v).properties()
-g.V(v).properties('name')
-g.V(v).properties('name').hasValue('marko')
-g.V(v).properties('name').hasValue('marko').property('acl','private') <b>(3)</b>
-g.V(v).properties('name').hasValue('marko a. rodriguez')
-g.V(v).properties('name').hasValue('marko a. rodriguez').property('acl','public')
-g.V(v).properties('name').has('acl','public').value()
-g.V(v).properties('name').has('acl','public').drop() <b>(4)</b>
-g.V(v).properties('name').has('acl','public').value()
-g.V(v).properties('name').has('acl','private').value()
-g.V(v).properties()
-g.V(v).properties().properties() <b>(5)</b>
-g.V(v).properties().property('date',2014) <b>(6)</b>
-g.V(v).properties().property('creator','stephen')
-g.V(v).properties().properties()
-g.V(v).properties('name').valueMap()
-g.V(v).property('name','okram') <b>(7)</b>
-g.V(v).properties('name')
-g.V(v).values('name') <b>(8)</b></pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; graph = TinkerGraph.open()
+==&gt;tinkergraph[<span class="key">vertices</span>:<span class="integer">0</span> <span class="key">edges</span>:<span class="integer">0</span>]
+gremlin&gt; g = graph.traversal()
+==&gt;graphtraversalsource[tinkergraph[<span class="key">vertices</span>:<span class="integer">0</span> <span class="key">edges</span>:<span class="integer">0</span>], standard]
+gremlin&gt; v = g.addV(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">marko</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">marko a. rodriguez</span><span class="delimiter">'</span></span>).next()
+==&gt;v[<span class="integer">0</span>]
+gremlin&gt; g.V(v).properties(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>).count() <span class="comment">//</span><b>(1)</b>
+==&gt;<span class="integer">2</span>
+gremlin&gt; v.property(list, <span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>, <span class="string"><span class="delimiter">'</span><span class="content">m. a. rodriguez</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(2)</b>
+==&gt;vp[name-&gt;m. a. rodriguez]
+gremlin&gt; g.V(v).properties(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>).count()
+==&gt;<span class="integer">3</span>
+gremlin&gt; g.V(v).properties()
+==&gt;vp[name-&gt;marko]
+==&gt;vp[name-&gt;marko a. rodriguez]
+==&gt;vp[name-&gt;m. a. rodriguez]
+gremlin&gt; g.V(v).properties(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>)
+==&gt;vp[name-&gt;marko]
+==&gt;vp[name-&gt;marko a. rodriguez]
+==&gt;vp[name-&gt;m. a. rodriguez]
+gremlin&gt; g.V(v).properties(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>).hasValue(<span class="string"><span class="delimiter">'</span><span class="content">marko</span><span class="delimiter">'</span></span>)
+==&gt;vp[name-&gt;marko]
+gremlin&gt; g.V(v).properties(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>).hasValue(<span class="string"><span class="delimiter">'</span><span class="content">marko</span><span class="delimiter">'</span></span>).property(<span class="string"><span class="delimiter">'</span><span class="content">acl</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">private</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(3)</b>
+==&gt;vp[name-&gt;marko]
+gremlin&gt; g.V(v).properties(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>).hasValue(<span class="string"><span class="delimiter">'</span><span class="content">marko a. rodriguez</span><span class="delimiter">'</span></span>)
+==&gt;vp[name-&gt;marko a. rodriguez]
+gremlin&gt; g.V(v).properties(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>).hasValue(<span class="string"><span class="delimiter">'</span><span class="content">marko a. rodriguez</span><span class="delimiter">'</span></span>).property(<span class="string"><span class="delimiter">'</span><span class="content">acl</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">public</span><span class="delimiter">'</span></span>)
+==&gt;vp[name-&gt;marko a. rodriguez]
+gremlin&gt; g.V(v).properties(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>).has(<span class="string"><span class="delimiter">'</span><span class="content">acl</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">public</span><span class="delimiter">'</span></span>).value()
+==&gt;marko a. rodriguez
+gremlin&gt; g.V(v).properties(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>).has(<span class="string"><span class="delimiter">'</span><span class="content">acl</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">public</span><span class="delimiter">'</span></span>).drop() <span class="comment">//</span><b>(4)</b>
+gremlin&gt; g.V(v).properties(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>).has(<span class="string"><span class="delimiter">'</span><span class="content">acl</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">public</span><span class="delimiter">'</span></span>).value()
+gremlin&gt; g.V(v).properties(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>).has(<span class="string"><span class="delimiter">'</span><span class="content">acl</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">private</span><span class="delimiter">'</span></span>).value()
+==&gt;marko
+gremlin&gt; g.V(v).properties()
+==&gt;vp[name-&gt;marko]
+==&gt;vp[name-&gt;m. a. rodriguez]
+gremlin&gt; g.V(v).properties().properties() <span class="comment">//</span><b>(5)</b>
+==&gt;p[acl-&gt;<span class="directive">private</span>]
+gremlin&gt; g.V(v).properties().property(<span class="string"><span class="delimiter">'</span><span class="content">date</span><span class="delimiter">'</span></span>,<span class="integer">2014</span>) <span class="comment">//</span><b>(6)</b>
+==&gt;vp[name-&gt;marko]
+==&gt;vp[name-&gt;m. a. rodriguez]
+gremlin&gt; g.V(v).properties().property(<span class="string"><span class="delimiter">'</span><span class="content">creator</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">stephen</span><span class="delimiter">'</span></span>)
+==&gt;vp[name-&gt;marko]
+==&gt;vp[name-&gt;m. a. rodriguez]
+gremlin&gt; g.V(v).properties().properties()
+==&gt;p[date-&gt;<span class="integer">2014</span>]
+==&gt;p[creator-&gt;stephen]
+==&gt;p[acl-&gt;<span class="directive">private</span>]
+==&gt;p[date-&gt;<span class="integer">2014</span>]
+==&gt;p[creator-&gt;stephen]
+gremlin&gt; g.V(v).properties(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>).valueMap()
+==&gt;[<span class="key">date</span>:<span class="integer">2014</span>,<span class="key">creator</span>:stephen,<span class="key">acl</span>:<span class="directive">private</span>]
+==&gt;[<span class="key">date</span>:<span class="integer">2014</span>,<span class="key">creator</span>:stephen]
+gremlin&gt; g.V(v).property(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">okram</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(7)</b>
+==&gt;v[<span class="integer">0</span>]
+gremlin&gt; g.V(v).properties(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>)
+==&gt;vp[name-&gt;okram]
+gremlin&gt; g.V(v).values(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(8)</b>
+==&gt;okram</code></pre>
 </div>
 </div>
 <div class="colist arabic">
@@ -2154,14 +2301,22 @@ A toy graph demonstrating all of the new
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V().as('a').
-      properties('location').as('b').
-      hasNot('endTime').as('c').
-      select('a','b','c').by('name').by(value).by('startTime') // determine the current location of each person
-g.V().has('name','gremlin').inE('uses').
-      order().by('skill',incr).as('a').
-      outV().as('b').
-      select('a','b').by('skill').by('name') // rank the users of gremlin by their skill level</pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V().as(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>).
+               properties(<span class="string"><span class="delimiter">'</span><span class="content">location</span><span class="delimiter">'</span></span>).as(<span class="string"><span class="delimiter">'</span><span class="content">b</span><span class="delimiter">'</span></span>).
+               hasNot(<span class="string"><span class="delimiter">'</span><span class="content">endTime</span><span class="delimiter">'</span></span>).as(<span class="string"><span class="delimiter">'</span><span class="content">c</span><span class="delimiter">'</span></span>).
+               select(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">b</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">c</span><span class="delimiter">'</span></span>).by(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>).by(value).by(<span class="string"><span class="delimiter">'</span><span class="content">startTime</span><span class="delimiter">'</span></span>) <span class="comment">// determine the current location of each person</span>
+==&gt;[<span class="key">a</span>:marko,<span class="key">b</span>:santa fe,<span class="key">c</span>:<span class="integer">2005</span>]
+==&gt;[<span class="key">a</span>:stephen,<span class="key">b</span>:purcellville,<span class="key">c</span>:<span class="integer">2006</span>]
+==&gt;[<span class="key">a</span>:matthias,<span class="key">b</span>:seattle,<span class="key">c</span>:<span class="integer">2014</span>]
+==&gt;[<span class="key">a</span>:daniel,<span class="key">b</span>:aachen,<span class="key">c</span>:<span class="integer">2009</span>]
+gremlin&gt; g.V().has(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">gremlin</span><span class="delimiter">'</span></span>).inE(<span class="string"><span class="delimiter">'</span><span class="content">uses</span><span class="delimiter">'</span></span>).
+               order().by(<span class="string"><span class="delimiter">'</span><span class="content">skill</span><span class="delimiter">'</span></span>,incr).as(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>).
+               outV().as(<span class="string"><span class="delimiter">'</span><span class="content">b</span><span class="delimiter">'</span></span>).
+               select(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">b</span><span class="delimiter">'</span></span>).by(<span class="string"><span class="delimiter">'</span><span class="content">skill</span><span class="delimiter">'</span></span>).by(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>) <span class="comment">// rank the users of gremlin by their skill level</span>
+==&gt;[<span class="key">a</span>:<span class="integer">3</span>,<span class="key">b</span>:matthias]
+==&gt;[<span class="key">a</span>:<span class="integer">4</span>,<span class="key">b</span>:marko]
+==&gt;[<span class="key">a</span>:<span class="integer">5</span>,<span class="key">b</span>:stephen]
+==&gt;[<span class="key">a</span>:<span class="integer">5</span>,<span class="key">b</span>:daniel]</code></pre>
 </div>
 </div>
 </div>
@@ -2192,15 +2347,24 @@ use cases include:</p>
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>graph = TinkerGraph.open()
-graph.variables()
-graph.variables().set('systemAdmins',['stephen','peter','pavel'])
-graph.variables().set('systemUsers',['matthias','marko','josh'])
-graph.variables().keys()
-graph.variables().get('systemUsers')
-graph.variables().get('systemUsers').get()
-graph.variables().remove('systemAdmins')
-graph.variables().keys()</pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; graph = TinkerGraph.open()
+==&gt;tinkergraph[<span class="key">vertices</span>:<span class="integer">0</span> <span class="key">edges</span>:<span class="integer">0</span>]
+gremlin&gt; graph.variables()
+==&gt;variables[<span class="key">size</span>:<span class="integer">0</span>]
+gremlin&gt; graph.variables().set(<span class="string"><span class="delimiter">'</span><span class="content">systemAdmins</span><span class="delimiter">'</span></span>,[<span class="string"><span class="delimiter">'</span><span class="content">stephen</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">peter</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">pavel</span><span class="delimiter">'</span></span>])
+gremlin&gt; graph.variables().set(<span class="string"><span class="delimiter">'</span><span class="content">systemUsers</span><span class="delimiter">'</span></span>,[<span class="string"><span class="delimiter">'</span><span class="content">matthias</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">marko</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">josh</span><span class="delimiter">'</span></span>])
+gremlin&gt; graph.variables().keys()
+==&gt;systemAdmins
+==&gt;systemUsers
+gremlin&gt; graph.variables().get(<span class="string"><span class="delimiter">'</span><span class="content">systemUsers</span><span class="delimiter">'</span></span>)
+==&gt;Optional[[matthias, marko, josh]]
+gremlin&gt; graph.variables().get(<span class="string"><span class="delimiter">'</span><span class="content">systemUsers</span><span class="delimiter">'</span></span>).get()
+==&gt;matthias
+==&gt;marko
+==&gt;josh
+gremlin&gt; graph.variables().remove(<span class="string"><span class="delimiter">'</span><span class="content">systemAdmins</span><span class="delimiter">'</span></span>)
+gremlin&gt; graph.variables().keys()
+==&gt;systemUsers</code></pre>
 </div>
 </div>
 <div class="admonitionblock important">
@@ -2408,10 +2572,13 @@ a method for executing automatic transac
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>graph = Neo4jGraph.open('/tmp/neo4j')
-graph.tx().submit {it.addVertex("name","josh")}.retry(10)
-graph.tx().submit {it.addVertex("name","daniel")}.exponentialBackoff(10)
-graph.close()</pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; graph = Neo4jGraph.open(<span class="string"><span class="delimiter">'</span><span class="content">/tmp/neo4j</span><span class="delimiter">'</span></span>)
+==&gt;neo4jgraph[Community [<span class="regexp"><span class="delimiter">/</span><span class="content">tmp</span><span class="delimiter">/</span></span>neo4j]]
+gremlin&gt; graph.tx().submit {<span class="local-variable">it</span>.addVertex(<span class="string"><span class="delimiter">&quot;</span><span class="content">name</span><span class="delimiter">&quot;</span></span>,<span class="string"><span class="delimiter">&quot;</span><span class="content">josh</span><span class="delimiter">&quot;</span></span>)}.retry(<span class="integer">10</span>)
+==&gt;v[<span class="integer">0</span>]
+gremlin&gt; graph.tx().submit {<span class="local-variable">it</span>.addVertex(<span class="string"><span class="delimiter">&quot;</span><span class="content">name</span><span class="delimiter">&quot;</span></span>,<span class="string"><span class="delimiter">&quot;</span><span class="content">daniel</span><span class="delimiter">&quot;</span></span>)}.exponentialBackoff(<span class="integer">10</span>)
+==&gt;v[<span class="integer">1</span>]
+gremlin&gt; graph.close()</code></pre>
 </div>
 </div>
 <div class="paragraph">
@@ -2681,11 +2848,14 @@ demonstrated in the following example wh
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>graph = TinkerFactory.createModern()
-g = graph.traversal()
-f = new ByteArrayOutputStream()
-graph.io(graphson()).writer().create().writeVertex(f, g.V(1).next(), BOTH)
-f.close()</pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; graph = TinkerFactory.createModern()
+==&gt;tinkergraph[<span class="key">vertices</span>:<span class="integer">6</span> <span class="key">edges</span>:<span class="integer">6</span>]
+gremlin&gt; g = graph.traversal()
+==&gt;graphtraversalsource[tinkergraph[<span class="key">vertices</span>:<span class="integer">6</span> <span class="key">edges</span>:<span class="integer">6</span>], standard]
+gremlin&gt; f = <span class="keyword">new</span> <span class="predefined-type">ByteArrayOutputStream</span>()
+==&gt;
+gremlin&gt; graph.io(graphson()).writer().create().writeVertex(f, g.V(<span class="integer">1</span>).next(), BOTH)
+gremlin&gt; f.close()</code></pre>
 </div>
 </div>
 <div class="paragraph">
@@ -2757,12 +2927,16 @@ GraphSON 1.0:</p>
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>graph = TinkerFactory.createModern()
-g = graph.traversal()
-f = new ByteArrayOutputStream()
-mapper = graph.io(graphson()).mapper().embedTypes(true).create()
-graph.io(graphson()).writer().mapper(mapper).create().writeVertex(f, g.V(1).next(), BOTH)
-f.close()</pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; graph = TinkerFactory.createModern()
+==&gt;tinkergraph[<span class="key">vertices</span>:<span class="integer">6</span> <span class="key">edges</span>:<span class="integer">6</span>]
+gremlin&gt; g = graph.traversal()
+==&gt;graphtraversalsource[tinkergraph[<span class="key">vertices</span>:<span class="integer">6</span> <span class="key">edges</span>:<span class="integer">6</span>], standard]
+gremlin&gt; f = <span class="keyword">new</span> <span class="predefined-type">ByteArrayOutputStream</span>()
+==&gt;
+gremlin&gt; mapper = graph.io(graphson()).mapper().embedTypes(<span class="predefined-constant">true</span>).create()
+==&gt;org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONMapper<span class="error">@</span><span class="float">39f</span><span class="float">5e98d</span>
+gremlin&gt; graph.io(graphson()).writer().mapper(mapper).create().writeVertex(f, g.V(<span class="integer">1</span>).next(), BOTH)
+gremlin&gt; f.close()</code></pre>
 </div>
 </div>
 <div class="paragraph">
@@ -2943,12 +3117,16 @@ implementations are only required to sup
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>graph = TinkerFactory.createModern()
-g = graph.traversal()
-f = new ByteArrayOutputStream()
-mapper = graph.io(graphson()).mapper().version(GraphSONVersion.V2_0).create()
-graph.io(graphson()).writer().mapper(mapper).create().writeVertex(f, g.V(1).next(), BOTH)
-f.close()</pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; graph = TinkerFactory.createModern()
+==&gt;tinkergraph[<span class="key">vertices</span>:<span class="integer">6</span> <span class="key">edges</span>:<span class="integer">6</span>]
+gremlin&gt; g = graph.traversal()
+==&gt;graphtraversalsource[tinkergraph[<span class="key">vertices</span>:<span class="integer">6</span> <span class="key">edges</span>:<span class="integer">6</span>], standard]
+gremlin&gt; f = <span class="keyword">new</span> <span class="predefined-type">ByteArrayOutputStream</span>()
+==&gt;
+gremlin&gt; mapper = graph.io(graphson()).mapper().version(GraphSONVersion.V2_0).create()
+==&gt;org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONMapper<span class="error">@</span><span class="integer">280744</span>a1
+gremlin&gt; graph.io(graphson()).writer().mapper(mapper).create().writeVertex(f, g.V(<span class="integer">1</span>).next(), BOTH)
+gremlin&gt; f.close()</code></pre>
 </div>
 </div>
 <div class="paragraph">
@@ -3387,9 +3565,18 @@ with lambdas, please read <a href="#a-no
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V(1).out().values('name') <b>(1)</b>
-g.V(1).out().map {it.get().value('name')} <b>(2)</b>
-g.V(1).out().map(values('name')) <b>(3)</b></pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V(<span class="integer">1</span>).out().values(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(1)</b>
+==&gt;lop
+==&gt;vadas
+==&gt;josh
+gremlin&gt; g.V(<span class="integer">1</span>).out().map {<span class="local-variable">it</span>.get().value(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>)} <span class="comment">//</span><b>(2)</b>
+==&gt;lop
+==&gt;vadas
+==&gt;josh
+gremlin&gt; g.V(<span class="integer">1</span>).out().map(values(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>)) <span class="comment">//</span><b>(3)</b>
+==&gt;lop
+==&gt;vadas
+==&gt;josh</code></pre>
 </div>
 </div>
 <div class="colist arabic">
@@ -3410,9 +3597,21 @@ g.V(1).out().map(values('name')) <b>(3)<
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V().filter {it.get().label() == 'person'} <b>(1)</b>
-g.V().filter(label().is('person')) <b>(2)</b>
-g.V().hasLabel('person') <b>(3)</b></pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V().filter {<span class="local-variable">it</span>.get().label() == <span class="string"><span class="delimiter">'</span><span class="content">person</span><span class="delimiter">'</span></span>} <span class="comment">//</span><b>(1)</b>
+==&gt;v[<span class="integer">1</span>]
+==&gt;v[<span class="integer">2</span>]
+==&gt;v[<span class="integer">4</span>]
+==&gt;v[<span class="integer">6</span>]
+gremlin&gt; g.V().filter(label().is(<span class="string"><span class="delimiter">'</span><span class="content">person</span><span class="delimiter">'</span></span>)) <span class="comment">//</span><b>(2)</b>
+==&gt;v[<span class="integer">1</span>]
+==&gt;v[<span class="integer">2</span>]
+==&gt;v[<span class="integer">4</span>]
+==&gt;v[<span class="integer">6</span>]
+gremlin&gt; g.V().hasLabel(<span class="string"><span class="delimiter">'</span><span class="content">person</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(3)</b>
+==&gt;v[<span class="integer">1</span>]
+==&gt;v[<span class="integer">2</span>]
+==&gt;v[<span class="integer">4</span>]
+==&gt;v[<span class="integer">6</span>]</code></pre>
 </div>
 </div>
 <div class="colist arabic">
@@ -3433,9 +3632,18 @@ g.V().hasLabel('person') <b>(3)</b></pre
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V().hasLabel('person').sideEffect(System.out.&amp;println) <b>(1)</b>
-g.V().sideEffect(outE().count().store("o")).
-      sideEffect(inE().count().store("i")).cap("o","i") <b>(2)</b></pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V().hasLabel(<span class="string"><span class="delimiter">'</span><span class="content">person</span><span class="delimiter">'</span></span>).sideEffect(<span class="predefined-type">System</span>.out.&amp;println) <span class="comment">//</span><b>(1)</b>
+v[<span class="integer">1</span>]
+==&gt;v[<span class="integer">1</span>]
+v[<span class="integer">2</span>]
+==&gt;v[<span class="integer">2</span>]
+v[<span class="integer">4</span>]
+==&gt;v[<span class="integer">4</span>]
+v[<span class="integer">6</span>]
+==&gt;v[<span class="integer">6</span>]
+gremlin&gt; g.V().sideEffect(outE().count().store(<span class="string"><span class="delimiter">&quot;</span><span class="content">o</span><span class="delimiter">&quot;</span></span>)).
+               sideEffect(inE().count().store(<span class="string"><span class="delimiter">&quot;</span><span class="content">i</span><span class="delimiter">&quot;</span></span>)).cap(<span class="string"><span class="delimiter">&quot;</span><span class="content">o</span><span class="delimiter">&quot;</span></span>,<span class="string"><span class="delimiter">&quot;</span><span class="content">i</span><span class="delimiter">&quot;</span></span>) <span class="comment">//</span><b>(2)</b>
+==&gt;[<span class="key">i</span>:[<span class="integer">0</span>,<span class="integer">0</span>,<span class="integer">1</span>,<span class="integer">1</span>,<span class="integer">1</span>,<span class="integer">3</span>],<span class="key">o</span>:[<span class="integer">3</span>,<span class="integer">0</span>,<span class="integer">0</span>,<span class="integer">0</span>,<span class="integer">2</span>,<span class="integer">1</span>]]</code></pre>
 </div>
 </div>
 <div class="colist arabic">
@@ -3453,15 +3661,33 @@ g.V().sideEffect(outE().count().store("o
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V().branch {it.get().value('name')}.
-      option('marko', values('age')).
-      option(none, values('name')) <b>(1)</b>
-g.V().branch(values('name')).
-      option('marko', values('age')).
-      option(none, values('name')) <b>(2)</b>
-g.V().choose(has('name','marko'),
-             values('age'),
-             values('name')) <b>(3)</b></pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V().branch {<span class="local-variable">it</span>.get().value(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>)}.
+               option(<span class="string"><span class="delimiter">'</span><span class="content">marko</span><span class="delimiter">'</span></span>, values(<span class="string"><span class="delimiter">'</span><span class="content">age</span><span class="delimiter">'</span></span>)).
+               option(none, values(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>)) <span class="comment">//</span><b>(1)</b>
+==&gt;<span class="integer">29</span>
+==&gt;vadas
+==&gt;lop
+==&gt;josh
+==&gt;ripple
+==&gt;peter
+gremlin&gt; g.V().branch(values(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>)).
+               option(<span class="string"><span class="delimiter">'</span><span class="content">marko</span><span class="delimiter">'</span></span>, values(<span class="string"><span class="delimiter">'</span><span class="content">age</span><span class="delimiter">'</span></span>)).
+               option(none, values(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>)) <span class="comment">//</span><b>(2)</b>
+==&gt;<span class="integer">29</span>
+==&gt;vadas
+==&gt;lop
+==&gt;josh
+==&gt;ripple
+==&gt;peter
+gremlin&gt; g.V().choose(has(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">marko</span><span class="delimiter">'</span></span>),
+                      values(<span class="string"><span class="delimiter">'</span><span class="content">age</span><span class="delimiter">'</span></span>),
+                      values(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>)) <span class="comment">//</span><b>(3)</b>
+==&gt;<span class="integer">29</span>
+==&gt;vadas
+==&gt;lop
+==&gt;josh
+==&gt;ripple
+==&gt;peter</code></pre>
 </div>
 </div>
 <div class="colist arabic">
@@ -3496,21 +3722,33 @@ worked on the same project together. Thi
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V(1).as('a').out('created').in('created').where(neq('a')).
-  addE('co-developer').from('a').property('year',2009) <b>(1)</b>
-g.V(3,4,5).aggregate('x').has('name','josh').as('a').
-  select('x').unfold().hasLabel('software').addE('createdBy').to('a') <b>(2)</b>
-g.V().as('a').out('created').addE('createdBy').to('a').property('acl','public') <b>(3)</b>
-g.V(1).as('a').out('knows').
-  addE('livesNear').from('a').property('year',2009).
-  inV().inE('livesNear').values('year') <b>(4)</b>
-g.V().match(
-        __.as('a').out('knows').as('b'),
-        __.as('a').out('created').as('c'),
-        __.as('b').out('created').as('c')).
-      addE('friendlyCollaborator').from('a').to('b').
-        property(id,13).property('project',select('c').values('name')) <b>(5)</b>
-g.E(13).valueMap()</pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V(<span class="integer">1</span>).as(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>).out(<span class="string"><span class="delimiter">'</span><span class="content">created</span><span class="delimiter">'</span></span>).in(<span class="string"><span class="delimiter">'</span><span class="content">created</span><span class="delimiter">'</span></span>).where(neq(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>)).
+           addE(<span class="string"><span class="delimiter">'</span><span class="content">co-developer</span><span class="delimiter">'</span></span>).from(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>).property(<span class="string"><span class="delimiter">'</span><span class="content">year</span><span class="delimiter">'</span></span>,<span class="integer">2009</span>) <span class="comment">//</span><b>(1)</b>
+==&gt;e[<span class="integer">12</span>][<span class="integer">1</span>-co-developer-&gt;<span class="integer">4</span>]
+==&gt;e[<span class="integer">13</span>][<span class="integer">1</span>-co-developer-&gt;<span class="integer">6</span>]
+gremlin&gt; g.V(<span class="integer">3</span>,<span class="integer">4</span>,<span class="integer">5</span>).aggregate(<span class="string"><span class="delimiter">'</span><span class="content">x</span><span class="delimiter">'</span></span>).has(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">josh</span><span class="delimiter">'</span></span>).as(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>).
+           select(<span class="string"><span class="delimiter">'</span><span class="content">x</span><span class="delimiter">'</span></span>).unfold().hasLabel(<span class="string"><span class="delimiter">'</span><span class="content">software</span><span class="delimiter">'</span></span>).addE(<span class="string"><span class="delimiter">'</span><span class="content">createdBy</span><span class="delimiter">'</span></span>).to(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(2)</b>
+==&gt;e[<span class="integer">14</span>][<span class="integer">3</span>-createdBy-&gt;<span class="integer">4</span>]
+==&gt;e[<span class="integer">15</span>][<span class="integer">5</span>-createdBy-&gt;<span class="integer">4</span>]
+gremlin&gt; g.V().as(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>).out(<span class="string"><span class="delimiter">'</span><span class="content">created</span><span class="delimiter">'</span></span>).addE(<span class="string"><span class="delimiter">'</span><span class="content">createdBy</span><span class="delimiter">'</span></span>).to(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>).property(<span class="string"><span class="delimiter">'</span><span class="content">acl</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">public</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(3)</b>
+==&gt;e[<span class="integer">16</span>][<span class="integer">3</span>-createdBy-&gt;<span class="integer">1</span>]
+==&gt;e[<span class="integer">17</span>][<span class="integer">5</span>-createdBy-&gt;<span class="integer">4</span>]
+==&gt;e[<span class="integer">18</span>][<span class="integer">3</span>-createdBy-&gt;<span class="integer">4</span>]
+==&gt;e[<span class="integer">19</span>][<span class="integer">3</span>-createdBy-&gt;<span class="integer">6</span>]
+gremlin&gt; g.V(<span class="integer">1</span>).as(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>).out(<span class="string"><span class="delimiter">'</span><span class="content">knows</span><span class="delimiter">'</span></span>).
+           addE(<span class="string"><span class="delimiter">'</span><span class="content">livesNear</span><span class="delimiter">'</span></span>).from(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>).property(<span class="string"><span class="delimiter">'</span><span class="content">year</span><span class="delimiter">'</span></span>,<span class="integer">2009</span>).
+           inV().inE(<span class="string"><span class="delimiter">'</span><span class="content">livesNear</span><span class="delimiter">'</span></span>).values(<span class="string"><span class="delimiter">'</span><span class="content">year</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(4)</b>
+==&gt;<span class="integer">2009</span>
+==&gt;<span class="integer">2009</span>
+gremlin&gt; g.V().match(
+                 __.as(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>).out(<span class="string"><span class="delimiter">'</span><span class="content">knows</span><span class="delimiter">'</span></span>).as(<span class="string"><span class="delimiter">'</span><span class="content">b</span><span class="delimiter">'</span></span>),
+                 __.as(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>).out(<span class="string"><span class="delimiter">'</span><span class="content">created</span><span class="delimiter">'</span></span>).as(<span class="string"><span class="delimiter">'</span><span class="content">c</span><span class="delimiter">'</span></span>),
+                 __.as(<span class="string"><span class="delimiter">'</span><span class="content">b</span><span class="delimiter">'</span></span>).out(<span class="string"><span class="delimiter">'</span><span class="content">created</span><span class="delimiter">'</span></span>).as(<span class="string"><span class="delimiter">'</span><span class="content">c</span><span class="delimiter">'</span></span>)).
+               addE(<span class="string"><span class="delimiter">'</span><span class="content">friendlyCollaborator</span><span class="delimiter">'</span></span>).from(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>).to(<span class="string"><span class="delimiter">'</span><span class="content">b</span><span class="delimiter">'</span></span>).
+                 property(id,<span class="integer">13</span>).property(<span class="string"><span class="delimiter">'</span><span class="content">project</span><span class="delimiter">'</span></span>,select(<span class="string"><span class="delimiter">'</span><span class="content">c</span><span class="delimiter">'</span></span>).values(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>)) <span class="comment">//</span><b>(5)</b>
+==&gt;e[<span class="integer">13</span>][<span class="integer">1</span>-friendlyCollaborator-&gt;<span class="integer">4</span>]
+gremlin&gt; g.E(<span class="integer">13</span>).valueMap()
+==&gt;[<span class="key">project</span>:lop]</code></pre>
 </div>
 </div>
 <div class="colist arabic">
@@ -3542,11 +3780,23 @@ created. Moreover, <code>GraphTraversalS
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.addV('person').property('name','stephen')
-g.V().values('name')
-g.V().outE('knows').addV().property('name','nothing')
-g.V().has('name','nothing')
-g.V().has('name','nothing').bothE()</pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.addV(<span class="string"><span class="delimiter">'</span><span class="content">person</span><span class="delimiter">'</span></span>).property(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">stephen</span><span class="delimiter">'</span></span>)
+==&gt;v[<span class="integer">12</span>]
+gremlin&gt; g.V().values(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>)
+==&gt;marko
+==&gt;vadas
+==&gt;lop
+==&gt;josh
+==&gt;ripple
+==&gt;peter
+==&gt;stephen
+gremlin&gt; g.V().outE(<span class="string"><span class="delimiter">'</span><span class="content">knows</span><span class="delimiter">'</span></span>).addV().property(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">nothing</span><span class="delimiter">'</span></span>)
+==&gt;v[<span class="integer">14</span>]
+==&gt;v[<span class="integer">16</span>]
+gremlin&gt; g.V().has(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">nothing</span><span class="delimiter">'</span></span>)
+==&gt;v[<span class="integer">16</span>]
+==&gt;v[<span class="integer">14</span>]
+gremlin&gt; g.V().has(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">nothing</span><span class="delimiter">'</span></span>).bothE()</code></pre>
 </div>
 </div>
 </div>
@@ -3560,12 +3810,18 @@ previous step to enable vertex and edge
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V(1).property('country','usa')
-g.V(1).property('city','santa fe').property('state','new mexico').valueMap()
-g.V(1).property(list,'age',35)  <b>(1)</b>
-g.V(1).valueMap()
-g.V(1).property('friendWeight',outE('knows').values('weight').sum(),'acl','private') <b>(2)</b>
-g.V(1).properties('friendWeight').valueMap() <b>(3)</b></pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V(<span class="integer">1</span>).property(<span class="string"><span class="delimiter">'</span><span class="content">country</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">usa</span><span class="delimiter">'</span></span>)
+==&gt;v[<span class="integer">1</span>]
+gremlin&gt; g.V(<span class="integer">1</span>).property(<span class="string"><span class="delimiter">'</span><span class="content">city</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">santa fe</span><span class="delimiter">'</span></span>).property(<span class="string"><span class="delimiter">'</span><span class="content">state</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">new mexico</span><span class="delimiter">'</span></span>).valueMap()
+==&gt;[<span class="key">country</span>:[usa],<span class="key">city</span>:[santa fe],<span class="key">name</span>:[marko],<span class="key">state</span>:[<span class="keyword">new</span> mexico],<span class="key">age</span>:[<span class="integer">29</span>]]
+gremlin&gt; g.V(<span class="integer">1</span>).property(list,<span class="string"><span class="delimiter">'</span><span class="content">age</span><span class="delimiter">'</span></span>,<span class="integer">35</span>) <span class="comment">//</span><b>(1)</b>
+==&gt;v[<span class="integer">1</span>]
+gremlin&gt; g.V(<span class="integer">1</span>).valueMap()
+==&gt;[<span class="key">country</span>:[usa],<span class="key">city</span>:[santa fe],<span class="key">name</span>:[marko],<span class="key">state</span>:[<span class="keyword">new</span> mexico],<span class="key">age</span>:[<span class="integer">29</span>,<span class="integer">35</span>]]
+gremlin&gt; g.V(<span class="integer">1</span>).property(<span class="string"><span class="delimiter">'</span><span class="content">friendWeight</span><span class="delimiter">'</span></span>,outE(<span class="string"><span class="delimiter">'</span><span class="content">knows</span><span class="delimiter">'</span></span>).values(<span class="string"><span class="delimiter">'</span><span class="content">weight</span><span class="delimiter">'</span></span>).sum(),<span class="string"><span class="delimiter">'</span><span class="content">acl</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">private</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(2)</b>
+==&gt;v[<span class="integer">1</span>]
+gremlin&gt; g.V(<span class="integer">1</span>).properties(<span class="string"><span class="delimiter">'</span><span class="content">friendWeight</span><span class="delimiter">'</span></span>).valueMap() <span class="comment">//</span><b>(3)</b>
+==&gt;[<span class="key">acl</span>:<span class="directive">private</span>]</code></pre>
 </div>
 </div>
 <div class="colist arabic">
@@ -3598,12 +3854,22 @@ in situations where everything at a part
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V(1).out('created') <b>(1)</b>
-g.V(1).out('created').aggregate('x') <b>(2)</b>
-g.V(1).out('created').aggregate('x').in('created') <b>(3)</b>
-g.V(1).out('created').aggregate('x').in('created').out('created') <b>(4)</b>
-g.V(1).out('created').aggregate('x').in('created').out('created').
-       where(without('x')).values('name') <b>(5)</b></pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V(<span class="integer">1</span>).out(<span class="string"><span class="delimiter">'</span><span class="content">created</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(1)</b>
+==&gt;v[<span class="integer">3</span>]
+gremlin&gt; g.V(<span class="integer">1</span>).out(<span class="string"><span class="delimiter">'</span><span class="content">created</span><span class="delimiter">'</span></span>).aggregate(<span class="string"><span class="delimiter">'</span><span class="content">x</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(2)</b>
+==&gt;v[<span class="integer">3</span>]
+gremlin&gt; g.V(<span class="integer">1</span>).out(<span class="string"><span class="delimiter">'</span><span class="content">created</span><span class="delimiter">'</span></span>).aggregate(<span class="string"><span class="delimiter">'</span><span class="content">x</span><span class="delimiter">'</span></span>).in(<span class="string"><span class="delimiter">'</span><span class="content">created</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(3)</b>
+==&gt;v[<span class="integer">1</span>]
+==&gt;v[<span class="integer">4</span>]
+==&gt;v[<span class="integer">6</span>]
+gremlin&gt; g.V(<span class="integer">1</span>).out(<span class="string"><span class="delimiter">'</span><span class="content">created</span><span class="delimiter">'</span></span>).aggregate(<span class="string"><span class="delimiter">'</span><span class="content">x</span><span class="delimiter">'</span></span>).in(<span class="string"><span class="delimiter">'</span><span class="content">created</span><span class="delimiter">'</span></span>).out(<span class="string"><span class="delimiter">'</span><span class="content">created</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(4)</b>
+==&gt;v[<span class="integer">3</span>]
+==&gt;v[<span class="integer">5</span>]
+==&gt;v[<span class="integer">3</span>]
+==&gt;v[<span class="integer">3</span>]
+gremlin&gt; g.V(<span class="integer">1</span>).out(<span class="string"><span class="delimiter">'</span><span class="content">created</span><span class="delimiter">'</span></span>).aggregate(<span class="string"><span class="delimiter">'</span><span class="content">x</span><span class="delimiter">'</span></span>).in(<span class="string"><span class="delimiter">'</span><span class="content">created</span><span class="delimiter">'</span></span>).out(<span class="string"><span class="delimiter">'</span><span class="content">created</span><span class="delimiter">'</span></span>).
+                where(without(<span class="string"><span class="delimiter">'</span><span class="content">x</span><span class="delimiter">'</span></span>)).values(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(5)</b>
+==&gt;ripple</code></pre>
 </div>
 </div>
 <div class="colist arabic">
@@ -3638,8 +3904,10 @@ g.V(1).out('created').aggregate('x').in(
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V().out('knows').aggregate('x').cap('x')
-g.V().out('knows').aggregate('x').by('name').cap('x')</pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V().out(<span class="string"><span class="delimiter">'</span><span class="content">knows</span><span class="delimiter">'</span></span>).aggregate(<span class="string"><span class="delimiter">'</span><span class="content">x</span><span class="delimiter">'</span></span>).cap(<span class="string"><span class="delimiter">'</span><span class="content">x</span><span class="delimiter">'</span></span>)
+==&gt;[v[<span class="integer">2</span>],v[<span class="integer">4</span>]]
+gremlin&gt; g.V().out(<span class="string"><span class="delimiter">'</span><span class="content">knows</span><span class="delimiter">'</span></span>).aggregate(<span class="string"><span class="delimiter">'</span><span class="content">x</span><span class="delimiter">'</span></span>).by(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>).cap(<span class="string"><span class="delimiter">'</span><span class="content">x</span><span class="delimiter">'</span></span>)
+==&gt;[vadas,josh]</code></pre>
 </div>
 </div>
 </div>
@@ -3650,10 +3918,11 @@ g.V().out('knows').aggregate('x').by('na
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V().and(
-   outE('knows'),
-   values('age').is(lt(30))).
-     values('name')</pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V().and(
+            outE(<span class="string"><span class="delimiter">'</span><span class="content">knows</span><span class="delimiter">'</span></span>),
+            values(<span class="string"><span class="delimiter">'</span><span class="content">age</span><span class="delimiter">'</span></span>).is(lt(<span class="integer">30</span>))).
+              values(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>)
+==&gt;marko</code></pre>
 </div>
 </div>
 <div class="paragraph">
@@ -3666,7 +3935,8 @@ only two traversals can be and&#8217;d t
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V().where(outE('created').and().outE('knows')).values('name')</pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V().where(outE(<span class="string"><span class="delimiter">'</span><span class="content">created</span><span class="delimiter">'</span></span>).and().outE(<span class="string"><span class="delimiter">'</span><span class="content">knows</span><span class="delimiter">'</span></span>)).values(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>)
+==&gt;marko</code></pre>
 </div>
 </div>
 </div>
@@ -3679,8 +3949,16 @@ that make use of such labels&#8201;&#821
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V().as('a').out('created').as('b').select('a','b')            <b>(1)</b>
-g.V().as('a').out('created').as('b').select('a','b').by('name') <b>(2)</b></pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V().as(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>).out(<span class="string"><span class="delimiter">'</span><span class="content">created</span><span class="delimiter">'</span></span>).as(<span class="string"><span class="delimiter">'</span><span class="content">b</span><span class="delimiter">'</span></span>).select(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">b</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(1)</b>
+==&gt;[<span class="key">a</span>:v[<span class="integer">1</span>],<span class="key">b</span>:v[<span class="integer">3</span>]]
+==&gt;[<span class="key">a</span>:v[<span class="integer">4</span>],<span class="key">b</span>:v[<span class="integer">5</span>]]
+==&gt;[<span class="key">a</span>:v[<span class="integer">4</span>],<span class="key">b</span>:v[<span class="integer">3</span>]]
+==&gt;[<span class="key">a</span>:v[<span class="integer">6</span>],<span class="key">b</span>:v[<span class="integer">3</span>]]
+gremlin&gt; g.V().as(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>).out(<span class="string"><span class="delimiter">'</span><span class="content">created</span><span class="delimiter">'</span></span>).as(<span class="string"><span class="delimiter">'</span><span class="content">b</span><span class="delimiter">'</span></span>).select(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">b</span><span class="delimiter">'</span></span>).by(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(2)</b>
+==&gt;[<span class="key">a</span>:marko,<span class="key">b</span>:lop]
+==&gt;[<span class="key">a</span>:josh,<span class="key">b</span>:ripple]
+==&gt;[<span class="key">a</span>:josh,<span class="key">b</span>:lop]
+==&gt;[<span class="key">a</span>:peter,<span class="key">b</span>:lop]</code></pre>
 </div>
 </div>
 <div class="colist arabic">
@@ -3698,11 +3976,13 @@ g.V().as('a').out('created').as('b').sel
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V().hasLabel('software').as('a','b','c').
-   select('a','b','c').
-     by('name').
-     by('lang').
-     by(__.in('created').values('name').fold())</pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V().hasLabel(<span class="string"><span class="delimiter">'</span><span class="content">software</span><span class="delimiter">'</span></span>).as(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">b</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">c</span><span class="delimiter">'</span></span>).
+            select(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">b</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">c</span><span class="delimiter">'</span></span>).
+              by(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>).
+              by(<span class="string"><span class="delimiter">'</span><span class="content">lang</span><span class="delimiter">'</span></span>).
+              by(__.in(<span class="string"><span class="delimiter">'</span><span class="content">created</span><span class="delimiter">'</span></span>).values(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>).fold())
+==&gt;[<span class="key">a</span>:lop,<span class="key">b</span>:java,<span class="key">c</span>:[marko,josh,peter]]
+==&gt;[<span class="key">a</span>:ripple,<span class="key">b</span>:java,<span class="key">c</span>:[josh]]</code></pre>
 </div>
 </div>
 </div>
@@ -3724,8 +4004,32 @@ useful in the following situations:</p>
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V().sideEffect{println "first: ${it}"}.sideEffect{println "second: ${it}"}.iterate()
-g.V().sideEffect{println "first: ${it}"}.barrier().sideEffect{println "second: ${it}"}.iterate()</pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V().sideEffect{println <span class="string"><span class="delimiter">&quot;</span><span class="content">first: </span><span class="inline"><span class="inline-delimiter">${</span><span class="local-variable">it</span><span class="inline-delimiter">}</span></span><span class="delimiter">&quot;</span></span>}.sideEffect{println <span class="string"><span class="delimiter">&quot;</span><span class="content">second: </span><span class="inline"><span class="inline-delimiter">${</span><span class="local-variable">it</span><span class="inline-delimiter">}</span></span><span class="delimiter">&quot;</span></span>}.iterate()
+<span class="key">first</span>: v[<span class="integer">1</span>]
+<span class="key">second</span>: v[<span class="integer">1</span>]
+<span class="key">first</span>: v[<span class="integer">2</span>]
+<span class="key">second</span>: v[<span class="integer">2</span>]
+<span class="key">first</span>: v[<span class="integer">3</span>]
+<span class="key">second</span>: v[<span class="integer">3</span>]
+<span class="key">first</span>: v[<span class="integer">4</span>]
+<span class="key">second</span>: v[<span class="integer">4</span>]
+<span class="key">first</span>: v[<span class="integer">5</span>]
+<span class="key">second</span>: v[<span class="integer">5</span>]
+<span class="key">first</span>: v[<span class="integer">6</span>]
+<span class="key">second</span>: v[<span class="integer">6</span>]
+gremlin&gt; g.V().sideEffect{println <span class="string"><span class="delimiter">&quot;</span><span class="content">first: </span><span class="inline"><span class="inline-delimiter">${</span><span class="local-variable">it</span><span class="inline-delimiter">}</span></span><span class="delimiter">&quot;</span></span>}.barrier().sideEffect{println <span class="string"><span class="delimiter">&quot;</span><span class="content">second: </span><span class="inline"><span class="inline-delimiter">${</span><span class="local-variable">it</span><span class="inline-delimiter">}</span></span><span class="delimiter">&quot;</span></span>}.iterate()
+<span class="key">first</span>: v[<span class="integer">1</span>]
+<span class="key">first</span>: v[<span class="integer">2</span>]
+<span class="key">first</span>: v[<span class="integer">3</span>]
+<span class="key">first</span>: v[<span class="integer">4</span>]
+<span class="key">first</span>: v[<span class="integer">5</span>]
+<span class="key">first</span>: v[<span class="integer">6</span>]
+<span class="key">second</span>: v[<span class="integer">1</span>]
+<span class="key">second</span>: v[<span class="integer">2</span>]
+<span class="key">second</span>: v[<span class="integer">3</span>]
+<span class="key">second</span>: v[<span class="integer">4</span>]
+<span class="key">second</span>: v[<span class="integer">5</span>]
+<span class="key">second</span>: v[<span class="integer">6</span>]</code></pre>
 </div>
 </div>
 <div class="paragraph">
@@ -3736,12 +4040,20 @@ made more salient on a larger graph. The
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>graph = TinkerGraph.open()
-graph.io(graphml()).readGraph('data/grateful-dead.xml')
-g = graph.traversal()
-clockWithResult(1){g.V().both().both().both().count().next()} <b>(1)</b>
-clockWithResult(1){g.V().repeat(both()).times(3).count().next()} <b>(2)</b>
-clockWithResult(1){g.V().both().barrier().both().barrier().both().barrier().count().next()} <b>(3)</b></pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; graph = TinkerGraph.open()
+==&gt;tinkergraph[<span class="key">vertices</span>:<span class="integer">0</span> <span class="key">edges</span>:<span class="integer">0</span>]
+gremlin&gt; graph.io(graphml()).readGraph(<span class="string"><span class="delimiter">'</span><span class="content">data/grateful-dead.xml</span><span class="delimiter">'</span></span>)
+gremlin&gt; g = graph.traversal()
+==&gt;graphtraversalsource[tinkergraph[<span class="key">vertices</span>:<span class="integer">808</span> <span class="key">edges</span>:<span class="integer">8049</span>], standard]
+gremlin&gt; clockWithResult(<span class="integer">1</span>){g.V().both().both().both().count().next()} <span class="comment">//</span><b>(1)</b>
+==&gt;<span class="float">9123.918201</span>
+==&gt;<span class="integer">126653966</span>
+gremlin&gt; clockWithResult(<span class="integer">1</span>){g.V().repeat(both()).times(<span class="integer">3</span>).count().next()} <span class="comment">//</span><b>(2)</b>
+==&gt;<span class="float">26.883083</span>
+==&gt;<span class="integer">126653966</span>
+gremlin&gt; clockWithResult(<span class="integer">1</span>){g.V().both().barrier().both().barrier().both().barrier().count().next()} <span class="comment">//</span><b>(3)</b>
+==&gt;<span class="float">15.527578</span>
+==&gt;<span class="integer">126653966</span></code></pre>
 </div>
 </div>
 <div class="colist arabic">
@@ -3768,11 +4080,16 @@ optimization scenario, but reduces the r
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>graph = TinkerGraph.open()
-graph.io(graphml()).readGraph('data/grateful-dead.xml')
-g = graph.traversal().withStrategies(LazyBarrierStrategy.instance())
-clockWithResult(1){g.V().both().both().both().count().next()}
-g.V().both().both().both().count().iterate().toString()  <b>(1)</b></pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; graph = TinkerGraph.open()
+==&gt;tinkergraph[<span class="key">vertices</span>:<span class="integer">0</span> <span class="key">edges</span>:<span class="integer">0</span>]
+gremlin&gt; graph.io(graphml()).readGraph(<span class="string"><span class="delimiter">'</span><span class="content">data/grateful-dead.xml</span><span class="delimiter">'</span></span>)
+gremlin&gt; g = graph.traversal().withStrategies(LazyBarrierStrategy.instance())
+==&gt;graphtraversalsource[tinkergraph[<span class="key">vertices</span>:<span class="integer">808</span> <span class="key">edges</span>:<span class="integer">8049</span>], standard]
+gremlin&gt; clockWithResult(<span class="integer">1</span>){g.V().both().both().both().count().next()}
+==&gt;<span class="float">34.724472999999996</span>
+==&gt;<span class="integer">126653966</span>
+gremlin&gt; g.V().both().both().both().count().iterate().toString() <span class="comment">//</span><b>(1)</b>
+==&gt;[TinkerGraphStep(vertex,<span class="type">[]</span>), VertexStep(BOTH,vertex), NoOpBarrierStep(<span class="integer">10000</span>), VertexStep(BOTH,vertex), NoOpBarrierStep(<span class="integer">10000</span>), VertexStep(BOTH,edge), CountGlobalStep]</code></pre>
 </div>
 </div>
 <div class="colist arabic">
@@ -3793,9 +4110,12 @@ while others can take an arbitrary amoun
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V().group().by(bothE().count()) <b>(1)</b>
-g.V().group().by(bothE().count()).by('name') <b>(2)</b>
-g.V().group().by(bothE().count()).by(count())  <b>(3)</b></pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V().group().by(bothE().count()) <span class="comment">//</span><b>(1)</b>
+==&gt;[<span class="integer">1</span>:[v[<span class="integer">2</span>],v[<span class="integer">5</span>],v[<span class="integer">6</span>]],<span class="integer">3</span>:[v[<span class="integer">1</span>],v[<span class="integer">3</span>],v[<span class="integer">4</span>]]]
+gremlin&gt; g.V().group().by(bothE().count()).by(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(2)</b>
+==&gt;[<span class="integer">1</span>:[vadas,ripple,peter],<span class="integer">3</span>:[marko,lop,josh]]
+gremlin&gt; g.V().group().by(bothE().count()).by(count()) <span class="comment">//</span><b>(3)</b>
+==&gt;[<span class="integer">1</span>:<span class="integer">3</span>,<span class="integer">3</span>:<span class="integer">3</span>]</code></pre>
 </div>
 </div>
 <div class="colist arabic">
@@ -3820,8 +4140,10 @@ key. If multiple keys are provided, then
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V().groupCount('a').by(label).cap('a')      <b>(1)</b>
-g.V().groupCount('a').by(label).groupCount('b').by(outE().count()).cap('a','b')   <b>(2)</b></pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V().groupCount(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>).by(label).cap(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(1)</b>
+==&gt;[<span class="key">software</span>:<span class="integer">2</span>,<span class="key">person</span>:<span class="integer">4</span>]
+gremlin&gt; g.V().groupCount(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>).by(label).groupCount(<span class="string"><span class="delimiter">'</span><span class="content">b</span><span class="delimiter">'</span></span>).by(outE().count()).cap(<span class="string"><span class="delimiter">'</span><span class="content">a</span><span class="delimiter">'</span></span>,<span class="string"><span class="delimiter">'</span><span class="content">b</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(2)</b>
+==&gt;[<span class="key">a</span>:[<span class="key">software</span>:<span class="integer">2</span>,<span class="key">person</span>:<span class="integer">4</span>],<span class="key">b</span>:[<span class="integer">0</span>:<span class="integer">3</span>,<span class="integer">1</span>:<span class="integer">1</span>,<span class="integer">2</span>:<span class="integer">1</span>,<span class="integer">3</span>:<span class="integer">1</span>]]</code></pre>
 </div>
 </div>
 <div class="colist arabic">
@@ -3843,10 +4165,18 @@ least one element.</p>
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V(1).coalesce(outE('knows'), outE('created')).inV().path().by('name').by(label)
-g.V(1).coalesce(outE('created'), outE('knows')).inV().path().by('name').by(label)
-g.V(1).property('nickname', 'okram')
-g.V().hasLabel('person').coalesce(values('nickname'), values('name'))</pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V(<span class="integer">1</span>).coalesce(outE(<span class="string"><span class="delimiter">'</span><span class="content">knows</span><span class="delimiter">'</span></span>), outE(<span class="string"><span class="delimiter">'</span><span class="content">created</span><span class="delimiter">'</span></span>)).inV().path().by(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>).by(label)
+==&gt;[marko,knows,vadas]
+==&gt;[marko,knows,josh]
+gremlin&gt; g.V(<span class="integer">1</span>).coalesce(outE(<span class="string"><span class="delimiter">'</span><span class="content">created</span><span class="delimiter">'</span></span>), outE(<span class="string"><span class="delimiter">'</span><span class="content">knows</span><span class="delimiter">'</span></span>)).inV().path().by(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>).by(label)
+==&gt;[marko,created,lop]
+gremlin&gt; g.V(<span class="integer">1</span>).property(<span class="string"><span class="delimiter">'</span><span class="content">nickname</span><span class="delimiter">'</span></span>, <span class="string"><span class="delimiter">'</span><span class="content">okram</span><span class="delimiter">'</span></span>)
+==&gt;v[<span class="integer">1</span>]
+gremlin&gt; g.V().hasLabel(<span class="string"><span class="delimiter">'</span><span class="content">person</span><span class="delimiter">'</span></span>).coalesce(values(<span class="string"><span class="delimiter">'</span><span class="content">nickname</span><span class="delimiter">'</span></span>), values(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>))
+==&gt;okram
+==&gt;vadas
+==&gt;josh
+==&gt;peter</code></pre>
 </div>
 </div>
 </div>
@@ -3862,10 +4192,14 @@ g.V().hasLabel('person').coalesce(values
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V().count()
-g.V().hasLabel('person').count()
-g.V().hasLabel('person').outE('created').count().path()  <b>(1)</b>
-g.V().hasLabel('person').outE('created').count().map {it.get() * 10}.path() <b>(2)</b></pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V().count()
+==&gt;<span class="integer">6</span>
+gremlin&gt; g.V().hasLabel(<span class="string"><span class="delimiter">'</span><span class="content">person</span><span class="delimiter">'</span></span>).count()
+==&gt;<span class="integer">4</span>
+gremlin&gt; g.V().hasLabel(<span class="string"><span class="delimiter">'</span><span class="content">person</span><span class="delimiter">'</span></span>).outE(<span class="string"><span class="delimiter">'</span><span class="content">created</span><span class="delimiter">'</span></span>).count().path() <span class="comment">//</span><b>(1)</b>
+==&gt;[<span class="integer">4</span>]
+gremlin&gt; g.V().hasLabel(<span class="string"><span class="delimiter">'</span><span class="content">person</span><span class="delimiter">'</span></span>).outE(<span class="string"><span class="delimiter">'</span><span class="content">created</span><span class="delimiter">'</span></span>).count().map {<span class="local-variable">it</span>.get() * <span class="integer">10</span>}.path() <span class="comment">//</span><b>(2)</b>
+==&gt;[<span class="integer">4</span>,<span class="integer">40</span>]</code></pre>
 </div>
 </div>
 <div class="colist arabic">
@@ -3905,14 +4239,21 @@ it is possible to implement if/else-base
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V().hasLabel('person').
-      choose(values('age').is(lte(30)),
-        __.in(),
-        __.out()).values('name') <b>(1)</b>
-g.V().hasLabel('person').
-      choose(values('age')).
-        option(27, __.in()).
-        option(32, __.out()).values('name') <b>(2)</b></pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V().hasLabel(<span class="string"><span class="delimiter">'</span><span class="content">person</span><span class="delimiter">'</span></span>).
+               choose(values(<span class="string"><span class="delimiter">'</span><span class="content">age</span><span class="delimiter">'</span></span>).is(lte(<span class="integer">30</span>)),
+                 __.in(),
+                 __.out()).values(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(1)</b>
+==&gt;marko
+==&gt;ripple
+==&gt;lop
+==&gt;lop
+gremlin&gt; g.V().hasLabel(<span class="string"><span class="delimiter">'</span><span class="content">person</span><span class="delimiter">'</span></span>).
+               choose(values(<span class="string"><span class="delimiter">'</span><span class="content">age</span><span class="delimiter">'</span></span>)).
+                 option(<span class="integer">27</span>, __.in()).
+                 option(<span class="integer">32</span>, __.out()).values(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>) <span class="comment">//</span><b>(2)</b>
+==&gt;marko
+==&gt;ripple
+==&gt;lop</code></pre>
 </div>
 </div>
 <div class="colist arabic">
@@ -3930,12 +4271,16 @@ g.V().hasLabel('person').
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V().hasLabel('person').
-      choose(values('name')).
-        option('marko', values('age')).
-        option('josh', values('name')).
-        option('vadas', valueMap()).
-        option('peter', label())</pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V().hasLabel(<span class="string"><span class="delimiter">'</span><span class="content">person</span><span class="delimiter">'</span></span>).
+               choose(values(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>)).
+                 option(<span class="string"><span class="delimiter">'</span><span class="content">marko</span><span class="delimiter">'</span></span>, values(<span class="string"><span class="delimiter">'</span><span class="content">age</span><span class="delimiter">'</span></span>)).
+                 option(<span class="string"><span class="delimiter">'</span><span class="content">josh</span><span class="delimiter">'</span></span>, values(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>)).
+                 option(<span class="string"><span class="delimiter">'</span><span class="content">vadas</span><span class="delimiter">'</span></span>, valueMap()).
+                 option(<span class="string"><span class="delimiter">'</span><span class="content">peter</span><span class="delimiter">'</span></span>, label())
+==&gt;<span class="integer">29</span>
+==&gt;[<span class="key">name</span>:[vadas],<span class="key">age</span>:[<span class="integer">27</span>]]
+==&gt;josh
+==&gt;person</code></pre>
 </div>
 </div>
 <div class="paragraph">
@@ -3943,10 +4288,14 @@ g.V().hasLabel('person').
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V().hasLabel('person').
-      choose(values('name')).
-        option('marko', values('age')).
-        option(none, values('name'))</pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V().hasLabel(<span class="string"><span class="delimiter">'</span><span class="content">person</span><span class="delimiter">'</span></span>).
+               choose(values(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>)).
+                 option(<span class="string"><span class="delimiter">'</span><span class="content">marko</span><span class="delimiter">'</span></span>, values(<span class="string"><span class="delimiter">'</span><span class="content">age</span><span class="delimiter">'</span></span>)).
+                 option(none, values(<span class="string"><span class="delimiter">'</span><span class="content">name</span><span class="delimiter">'</span></span>))
+==&gt;<span class="integer">29</span>
+==&gt;vadas
+==&gt;josh
+==&gt;peter</code></pre>
 </div>
 </div>
 </div>
@@ -3957,9 +4306,20 @@ g.V().hasLabel('person').
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V().coin(0.5)
-g.V().coin(0.0)
-g.V().coin(1.0)</pre>
+<pre class="CodeRay"><code class="groovy language-groovy">gremlin&gt; g.V().coin(<span class="float">0.5</span>)
+==&gt;v[<span class="integer">1</span>]
+==&gt;v[<span class="integer">2</span>]
+==&gt;v[<span class="integer">4</span>]
+==&gt;v[<span class="integer">5</span>]
+==&gt;v[<span class="integer">6</span>]
+gremlin&gt; g.V().coin(<span class="float">0.0</span>)
+gremlin&gt; g.V().coin(<span class="float">1.0</span>)
+==&gt;v[<span class="integer">1</span>]
+==&gt;v[<span class="integer">2</span>]
+==&gt;v[<span class="integer">3</span>]
+==&gt;v[<span class="integer">4</span>]
+==&gt;v[<span class="integer">5</span>]
+==&gt;v[<span class="integer">6</span>]</code></pre>
 </div>
 </div>
 </div>
@@ -3971,12 +4331,24 @@ steps like <a href="#choose-step"><code>
 </div>
 <div class="listingblock">
 <div class="content">
-<pre>g.V().choose(hasLabel('person'),
-    values('name'),
-    constant('inhuman')) <b>(1)</b>
-g.V().coalesce(

[... 4505 lines stripped ...]



Mime
View raw message