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 2016/01/26 21:28:36 UTC

svn commit: r1726885 - /incubator/tinkerpop/site/docs/3.1.1-SNAPSHOT/tutorials/getting-started/index.html

Author: spmallette
Date: Tue Jan 26 20:28:36 2016
New Revision: 1726885

URL: http://svn.apache.org/viewvc?rev=1726885&view=rev
Log:
Minor tweaks added to getting started tutorial.

Added a NOTE about vertex/edge definitions coming up in second section. Added more information about static imports to help non java devs.

Modified:
    incubator/tinkerpop/site/docs/3.1.1-SNAPSHOT/tutorials/getting-started/index.html

Modified: incubator/tinkerpop/site/docs/3.1.1-SNAPSHOT/tutorials/getting-started/index.html
URL: http://svn.apache.org/viewvc/incubator/tinkerpop/site/docs/3.1.1-SNAPSHOT/tutorials/getting-started/index.html?rev=1726885&r1=1726884&r2=1726885&view=diff
==============================================================================
--- incubator/tinkerpop/site/docs/3.1.1-SNAPSHOT/tutorials/getting-started/index.html (original)
+++ incubator/tinkerpop/site/docs/3.1.1-SNAPSHOT/tutorials/getting-started/index.html Tue Jan 26 20:28:36 2016
@@ -836,6 +836,20 @@ he should "traverse" the graph (i.e. wha
 language he understands - and, of course, that language is called "Gremlin". For this task, you need one of
 TinkerPop&#8217;s most important tools: <a href="http://tinkerpop.apache.org/docs/3.1.1-SNAPSHOT/reference/#gremlin-console">The Gremlin Console</a>.</p>
 </div>
+<div class="admonitionblock note">
+<table>
+<tr>
+<td class="icon">
+<div class="title">Note</div>
+</td>
+<td class="content">
+Are you unsure of what a vertex or edge is? That topic is covered in the <a href="#_the_next_fifteen_minutes">next section</a>,
+but please allow the tutorial to get you oriented with the Gremlin Console first, so that you have an understanding of
+the tool that will help you with your learning experience.
+</td>
+</tr>
+</table>
+</div>
 <div class="paragraph">
 <p>Download the console, unpackage it and start it:</p>
 </div>
@@ -1094,8 +1108,23 @@ gremlin&gt; v1.addEdge(<span class="stri
 </div>
 <div class="paragraph">
 <p>There are a number of important things to consider in the above code. First, recall that <code>id</code> and <code>label</code> are
-"reserved" for special usage in TinkerPop. Those "keys" supplied to the creation method are statically imported to
-the console. You would normally refer to them as <code>T.id</code> and <code>T.label</code>.</p>
+"reserved" for special usage in TinkerPop and are members of the enum, <code>T</code>. Those "keys" supplied to the creation
+method are <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/language/static-import.html">statically imported</a>
+to the console, which allows you to access them without having to specify their owning enum. Think of it as a
+shorthand form that enables a more fluid code style. You would normally refer to them as <code>T.id</code> and <code>T.label</code>. Without
+that static importing you would instead have to write:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<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; v1 = graph.addVertex(T.id, <span class="integer">1</span>, T.label, <span class="string"><span class="delimiter">&quot;</span><span class="content">person</span><span class="delimiter">&quot;</span></span>, <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">marko</span><span class="delimiter">&quot;</span></span>, <span class="string"><span class="delimiter">&quot;</span><span class="content">age</span><span class="delimiter">&quot;</span></span>, <span class="integer">29</span>)
+==&gt;v[<span class="integer">1</span>]
+gremlin&gt; v2 = graph.addVertex(T.id, <span class="integer">3</span>, T.label, <span class="string"><span class="delimiter">&quot;</span><span class="content">software</span><span class="delimiter">&quot;</span></span>, <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">lop</span><span class="delimiter">&quot;</span></span>, <span class="string"><span class="delimiter">&quot;</span><span class="content">lang</span><span class="delimiter">&quot;</span></span>, <span class="string"><span class="delimiter">&quot;</span><span class="content">java</span><span class="delimiter">&quot;</span></span>)
+==&gt;v[<span class="integer">3</span>]
+gremlin&gt; v1.addEdge(<span class="string"><span class="delimiter">&quot;</span><span class="content">created</span><span class="delimiter">&quot;</span></span>, v2, id, <span class="integer">9</span>, <span class="string"><span class="delimiter">&quot;</span><span class="content">weight</span><span class="delimiter">&quot;</span></span>, <span class="float">0.4</span>)
+==&gt;e[<span class="integer">9</span>][<span class="integer">1</span>-created-&gt;<span class="integer">3</span>]</code></pre>
+</div>
 </div>
 <div class="admonitionblock note">
 <table>
@@ -1104,7 +1133,9 @@ the console. You would normally refer to
 <div class="title">Note</div>
 </td>
 <td class="content">
-The fully qualified name for <code>T</code> is <code>org.apache.tinkerpop.gremlin.structure.T</code>.
+The fully qualified name for <code>T</code> is <code>org.apache.tinkerpop.gremlin.structure.T</code>. Another important static import
+that is often seen in Gremlin comes from <code>org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__</code>, which allows
+for the creation of <a href="http://tinkerpop.apache.org/docs/3.1.1-SNAPSHOT/reference/#graph-traversal-steps">anonymous traversals</a>.
 </td>
 </tr>
 </table>
@@ -1647,7 +1678,7 @@ research within the reference documentat
 </div>
 <div id="footer">
 <div id="footer-text">
-Last updated 2016-01-25 15:00:37 -05:00
+Last updated 2016-01-26 15:11:37 -05:00
 </div>
 </div>
 </body>