tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dkupp...@apache.org
Subject [3/3] incubator-tinkerpop git commit: updated ScriptInputFormat section in reference docs
Date Wed, 10 Feb 2016 15:29:31 GMT
updated ScriptInputFormat section in reference docs

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

Branch: refs/heads/TINKERPOP-1137
Commit: 19c419731e6b5bdafff072ed371b6e89e9e1779f
Parents: af62e3c
Author: Daniel Kuppitz <daniel_kuppitz@hotmail.com>
Authored: Wed Feb 10 16:29:14 2016 +0100
Committer: Daniel Kuppitz <daniel_kuppitz@hotmail.com>
Committed: Wed Feb 10 16:29:14 2016 +0100

 docs/src/reference/implementations.asciidoc | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/docs/src/reference/implementations.asciidoc b/docs/src/reference/implementations.asciidoc
index 5eadef3..5b7e3e4 100644
--- a/docs/src/reference/implementations.asciidoc
+++ b/docs/src/reference/implementations.asciidoc
@@ -1544,20 +1544,14 @@ mapper in the Hadoop job. The script must have the following method
 def parse(String line, ScriptElementFactory factory) { ... }
-`ScriptElementFactory` provides the following 4 methods:
-Graph graph(); // get a reference to the local star graph
-Vertex vertex(Object id); // get or create the vertex with the given id
-Vertex vertex(Object id, String label); // get or create the vertex with the given id and
-Edge edge(Vertex out, Vertex in); // create an edge between the two given vertices
-Edge edge(Vertex out, Vertex in, String label); // create an edge between the two given vertices
using the given label
+`ScriptElementFactory` is a legacy from previous version and, although it's still functional,
it should no longer be used.
+In order to create vertices and edges, the `parse()` method gets access to a global variable
named `graph`, which holds
+the local `StarGraph` for the current line/vertex.
 An appropriate `parse()` for the above adjacency list file is:
 def parse(line, factory) {
-    def graph = factory.graph()
     def parts = line.split(/ /)
     def (id, label, name, x) = parts[0].split(/:/).toList()
     def v1 = graph.addVertex(T.id, id, T.label, label)

View raw message