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:56 UTC

incubator-tinkerpop git commit: Minor tweaks added to getting started tutorial.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/master 68e3cad0a -> 3af6ef12e


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.


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

Branch: refs/heads/master
Commit: 3af6ef12ecf71ec3ed7d3a3deb7936d65aaf9639
Parents: 68e3cad
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Jan 26 15:28:44 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jan 26 15:28:44 2016 -0500

----------------------------------------------------------------------
 .../tutorials/getting-started/index.asciidoc    | 23 +++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/3af6ef12/docs/src/tutorials/getting-started/index.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/tutorials/getting-started/index.asciidoc b/docs/src/tutorials/getting-started/index.asciidoc
index 06eb2db..dcdb8fa 100644
--- a/docs/src/tutorials/getting-started/index.asciidoc
+++ b/docs/src/tutorials/getting-started/index.asciidoc
@@ -47,6 +47,10 @@ he should "traverse" the graph (i.e. what you want your query to do) you need a
 language he understands - and, of course, that language is called "Gremlin". For this task, you need one of
 TinkerPop's most important tools: link:http://tinkerpop.apache.org/docs/x.y.z/reference/#gremlin-console[The Gremlin Console].
 
+NOTE: Are you unsure of what a vertex or edge is? That topic is covered in the <<_the_next_fifteen_minutes, next section>>,
+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.
+
 Download the console, unpackage it and start it:
 
 [source,text]
@@ -196,10 +200,23 @@ v1.addEdge("created", v2, id, 9, "weight", 0.4)
 ----
 
 There are a number of important things to consider in the above code. First, recall that `id` and `label` 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 `T.id` and `T.label`.
+"reserved" for special usage in TinkerPop and are members of the enum, `T`. Those "keys" supplied to the creation
+method are link:https://docs.oracle.com/javase/8/docs/technotes/guides/language/static-import.html[statically imported]
+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 `T.id` and `T.label`. Without
+that static importing you would instead have to write:
+
+[gremlin-groovy]
+----
+graph = TinkerGraph.open()
+v1 = graph.addVertex(T.id, 1, T.label, "person", "name", "marko", "age", 29)
+v2 = graph.addVertex(T.id, 3, T.label, "software", "name", "lop", "lang", "java")
+v1.addEdge("created", v2, id, 9, "weight", 0.4)
+----
 
-NOTE: The fully qualified name for `T` is `org.apache.tinkerpop.gremlin.structure.T`.
+NOTE: The fully qualified name for `T` is `org.apache.tinkerpop.gremlin.structure.T`. Another important static import
+that is often seen in Gremlin comes from `org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__`, which allows
+for the creation of link:http://tinkerpop.apache.org/docs/3.1.1-SNAPSHOT/reference/#graph-traversal-steps[anonymous traversals].
 
 Second, don't forget that you are working with TinkerGraph which allows for identifier assignment. That is _not_ the
 case with most graph databases.