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 2020/12/22 20:26:13 UTC

[tinkerpop] branch master updated (d042584 -> 41e50ff)

This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git.


    from d042584  Merge branch '3.4-dev'
     new caa17d8  Minor updates to translator docs CTR
     new 35ae94f  Merge branch '3.4-dev'
     new 41e50ff  TINKERPOP-2494 Update Translator docs to include parameter extraction functionality CTR

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 docs/src/reference/the-traversal.asciidoc | 34 ++++++++++++++++++++++++-------
 1 file changed, 27 insertions(+), 7 deletions(-)


[tinkerpop] 03/03: TINKERPOP-2494 Update Translator docs to include parameter extraction functionality CTR

Posted by sp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 41e50ff2f1e14ebe22f42d763eac8db056c80766
Author: Stephen Mallette <st...@amazon.com>
AuthorDate: Tue Dec 22 15:25:31 2020 -0500

    TINKERPOP-2494 Update Translator docs to include parameter extraction functionality CTR
---
 docs/src/reference/the-traversal.asciidoc | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc
index d45e34a..190a5f4 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -4285,3 +4285,22 @@ console.log(translator.translate(t));
 // OUTPUT: g.V().has('person','name','marko').where(__.in('knows')).values('age')
 ----
 
+The JVM-based translator has the added option of parameter extraction, where the translation process will attempt to
+identify opportunities to generate an output that would replace constant values with parameters. The parameters would
+then be extracted and returned as part of the `Script` object:
+
+[source,java]
+----
+Traversal<Vertex,Integer> t = g.V().has("person","name","marko").
+                                where(__.in("knows")).
+                                values("age");
+// specify true to attempt parameter extraction
+Translator.ScriptTranslator translator = GroovyTranslator.of("g", true);
+Script s = translator.translate(t);
+System.out.println(s.getScript());
+// OUTPUT: g.V().has(_args_0,_args_1,_args_2).where(__.in(_args_3)).values(_args_4)
+System.out.println(s.parameters);
+// OUTPUT: Optional[{_args_0=person, _args_2=marko, _args_1=name, _args_4=age, _args_3=knows}]
+---
+
+


[tinkerpop] 01/03: Minor updates to translator docs CTR

Posted by sp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit caa17d8585838be2e0c2c628213955a6f8705c4f
Author: Stephen Mallette <st...@amazon.com>
AuthorDate: Tue Dec 22 15:06:59 2020 -0500

    Minor updates to translator docs CTR
---
 docs/src/reference/the-traversal.asciidoc | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc
index d076921..23cf328 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -4192,21 +4192,22 @@ specifically a `ScriptTranslator` which takes Gremlin `Bytecode` of a traversal
 of that `Bytecode` in the programming language syntax that the `ScriptTranslator` instance supports. The translation
 therefore allows Gremlin to be converted from the host programming language of the `Translator` to another.
 
-The following translators are available:
+The following translators are available, where the first column identifies the host programming language and the
+columns represent the language that Gremlin can be generated in:
 
 [width="100%",cols="<,^,^,^,^,^",options="header"]
 |=========================================================
 | |Java |Groovy |Javascript |.NET |Python
-|*Java* |- |X | | |X
-|*Groovy* | |- | | |X
-|*Javascript* | |X |- | |
-|*.NET* | | | |- |
-|*Python*  | | | | |-
+|*Java* | |X | | |X
+|*Groovy* | |X | | |X
+|*Javascript* | |X | | |
+|*.NET* | | | | |
+|*Python*  | | | | |
 |=========================================================
 
 Each programming language has its own API for translation, but the pattern is quite similar from one to the next:
 
-WARN: While `Translator` implementations have been around for some time, they are still in their early stages from
+WARNING: While `Translator` implementations have been around for some time, they are still in their early stages from
 an interface perspective. API changes may occur in the near future.
 
 [source,java,tab]


[tinkerpop] 02/03: Merge branch '3.4-dev'

Posted by sp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 35ae94fe1e29a53f0c9e8ed9d629227f46250392
Merge: d042584 caa17d8
Author: Stephen Mallette <st...@amazon.com>
AuthorDate: Tue Dec 22 15:07:16 2020 -0500

    Merge branch '3.4-dev'

 docs/src/reference/the-traversal.asciidoc | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)