This is an automated email from the ASF dual-hosted git repository. rdale pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit ed4ce735062a2328ef70d91c39e5af971c6574e7 Author: Robert Dale <robd...@gmail.com> AuthorDate: Fri Jul 12 09:26:57 2019 -0400 asciidoc fixes - CTR --- docs/src/reference/gremlin-variants.asciidoc | 10 ++++---- docs/src/reference/the-traversal.asciidoc | 28 +++++++++++----------- .../gremlin-language-variants/index.asciidoc | 2 +- docs/src/tutorials/gremlins-anatomy/index.asciidoc | 2 +- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/src/reference/gremlin-variants.asciidoc b/docs/src/reference/gremlin-variants.asciidoc index e4a6cef..ff75287 100644 --- a/docs/src/reference/gremlin-variants.asciidoc +++ b/docs/src/reference/gremlin-variants.asciidoc @@ -75,7 +75,7 @@ Gremlin-Java constructs. Moreover, given its scripting nature, Gremlin-Groovy se <<gremlin-console,Gremlin Console>>. WARNING: In Groovy, `as`, `in`, and `not` are reserved words. Gremlin-Groovy does not allow these steps to be called -statically from the anonymous traversal `__` and therefore, must always be prefixed with `__.` For instance: +statically from the anonymous traversal `+__+` and therefore, must always be prefixed with `+__+`. For instance: `+g.V().as('a').in().as('b').where(__.not(__.as('a').out().as('b')))+` [[gremlin-python]] @@ -89,7 +89,7 @@ namespaces (`a(b())` vs `a(__.b())`). As such, anyone familiar with Gremlin-Java with Gremlin-Python. Moreover, there are a few added constructs to Gremlin-Python that make traversals a bit more succinct. WARNING: In Python, `and`, `as`, `from`, `global`, `in`, `is`, `not`, and `or` are reserved words. Gremlin-Python simply -postfixes `_` to the end of these terms for their use with graph traversal. For instance: `g.V().as_('a').in_().as_('b').select('a','b')`. +postfixes `+_+` to the end of these terms for their use with graph traversal. For instance: `g.V().as_('a').in_().as_('b').select('a','b')`. To install Gremlin-Python, use Python's link:https://en.wikipedia.org/wiki/Pip_(package_manager)[pip] package manager. @@ -229,8 +229,8 @@ With statics loaded its possible to represent the above traversal as below. g.V().hasLabel('person').has('age',gt(30)).order().by('age',desc).toList() ---- -Finally, statics includes all the ``+__+``-methods and thus, anonymous traversals like `+__.out()+` can be expressed as below. -That is, without the ``__.``-prefix. +Finally, statics includes all the `+__+`-methods and thus, anonymous traversals like `+__.out()+` can be expressed as below. +That is, without the `+__+`-prefix. [gremlin-python,modern] ---- @@ -541,7 +541,7 @@ traversal source. Since Gremlin-JavaScript currently doesn't support lambda expressions, all traversals can be translated to Gremlin-Java on the remote location (e.g. Gremlin Server). -WARNING: In Javascript, `from` and `in` are reserved words. Gremlin-Javascript simply postfixes `_` to the end of +WARNING: In Javascript, `from` and `in` are reserved words. Gremlin-Javascript simply postfixes `+_+` to the end of these terms for their use with graph traversal. For instance: `g.V().in_().out()` IMPORTANT: Gremlin-JavaScript’s `Traversal` base class supports the standard Gremlin methods such as `next()` and diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc index 8377d20..60e7218 100644 --- a/docs/src/reference/the-traversal.asciidoc +++ b/docs/src/reference/the-traversal.asciidoc @@ -42,7 +42,7 @@ traversal strategies may not function properly. image::step-types.png[width=650] A `GraphTraversal<S,E>` is spawned from a `GraphTraversalSource`. It can also be spawned anonymously (i.e. empty) -via `__`. A graph traversal is composed of an ordered list of steps. All the steps provided by `GraphTraversal` +via `+__+`. A graph traversal is composed of an ordered list of steps. All the steps provided by `GraphTraversal` inherit from the more general forms diagrammed above. A list of all the steps (and their descriptions) are provided in the TinkerPop3 link:http://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.html[GraphTraversal JavaDoc]. The following subsections will demonstrate the GraphTraversal steps using the <<gremlin-console,Gremlin Console>>. @@ -361,7 +361,7 @@ that make use of such labels -- e.g., <<select-step,`select()`>>, <<match-step,` [NOTE, caption=Groovy] ==== The term `as` is a reserved word in Groovy, and when therefore used as part of an anonymous traversal must be referred -to in Gremlin with the double underscore `__.as()`. +to in Gremlin with the double underscore `+__.as()+`. ==== [NOTE, caption=Python] @@ -1587,7 +1587,7 @@ returns an object. [NOTE, caption=Groovy] ==== The term `not` is a reserved word in Groovy, and when therefore used as part of an anonymous traversal must be referred -to in Gremlin with the double underscore `__.not()`. +to in Gremlin with the double underscore `+__.not()+`. ==== [NOTE, caption=Python] @@ -2045,7 +2045,7 @@ g.V().hasLabel('person'). valueMap('name', 'rank') ---- -[properties-step]] +[[properties-step]] === Properties Step The `properties()`-step (*map*) extracts properties from an `Element` in the traversal stream. @@ -2944,7 +2944,7 @@ g.V().hasLabel('person').properties('location').valueMap(true) link:++http://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.html#valueMap-boolean-java.lang.String...-++[`valueMap(boolean,String...)`], link:++http://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.html#valueMap-java.lang.String...-++[`valueMap(String...)`] -[values-step]] +[[values-step]] === Values Step The `values()`-step (*map*) extracts the values of properties from an `Element` in the traversal stream. @@ -2982,7 +2982,7 @@ graph -- i.e. traverse. [NOTE, caption=Groovy] ==== The term `in` is a reserved word in Groovy, and when therefore used as part of an anonymous traversal must be referred -to in Gremlin with the double underscore `__.in()`. +to in Gremlin with the double underscore `+__.in()+`. ==== [NOTE, caption=Javascript] @@ -3723,7 +3723,7 @@ The annotation processor will generate several classes for the DSL: interfaces (such as `GraphTraversal`) to instead return a `SocialTraversal` * `DefaultSocialTraversal` - A default implementation of `SocialTraversal` (typically not used directly by the user) * `SocialTraversalSource` - Spawns `DefaultSocialTraversal` instances. -* `__` - Spawns anonymous `DefaultSocialTraversal` instances. +* `+__+` - Spawns anonymous `DefaultSocialTraversal` instances. Using the DSL then just involves telling the `Graph` to use it: @@ -3794,7 +3794,7 @@ straightforward in that it sets up appropriate paths to the generated code autom Writing a Gremlin DSL in Python simply requires direct extension of several classes: * `GraphTraversal` - which exposes the various steps used in traversal writing -* `__` - which spawns anonymous traversals from steps +* `+__+` - which spawns anonymous traversals from steps * `GraphTraversalSource` - which spawns `GraphTraversal` instances The Social DSL based on the link:http://tinkerpop.apache.org/docs/current/images/tinkerpop-modern.png["modern" toy graph] @@ -3847,8 +3847,8 @@ class SocialTraversalSource(GraphTraversalSource): return traversal ---- -NOTE: The `AnonymousTraversal` class above is just an alias for `__` as in -`from gremlin_python.process.graph_traversal import __ as AnonymousTraversal` +NOTE: The `AnonymousTraversal` class above is just an alias for `+__+` as in +`+from gremlin_python.process.graph_traversal import __ as AnonymousTraversal+` Using the DSL is straightforward and just requires that the graph instance know the `SocialTraversalSource` should be used: @@ -3867,11 +3867,11 @@ social.persons().filter(__.createdAtLeast(2)).count() Developing DSLs for .Net is most easily implemented using link:https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/extension-methods[Extension Methods] as they don't require direct extension of classes in the TinkerPop hierarchy. Extension Method classes simply need to be constructed for the `GraphTraversal` and the `GraphTraversalSource`. Unfortunately, anonymous traversals (spawned -from `__`) can't use the Extension Method approach as they do not work for static classes and static classes can't be -extended. The only option is to re-implement the methods of `__` as a wrapper in the anonymous traversal for the DSL +from `+__+`) can't use the Extension Method approach as they do not work for static classes and static classes can't be +extended. The only option is to re-implement the methods of `+__+` as a wrapper in the anonymous traversal for the DSL or to simply create a static class for the DSL and use the two anonymous traversals creators independently. The following example uses the latter approach as it saves a lot of boilerplate code with the minor annoyance of having a -second static class to deal with when writing traversals rather than just calling `__` for everything. +second static class to deal with when writing traversals rather than just calling `+__+` for everything. [source,csharp] ---- @@ -3931,7 +3931,7 @@ namespace Dsl } ---- -Note the creation of `__Social` as the Social DSL's "extension" to the available ways in which to spawn anonymous +Note the creation of `+__Social+` as the Social DSL's "extension" to the available ways in which to spawn anonymous traversals. The use of the double underscore prefix in the name is just a convention to consider using and is not a requirement. To use the DSL, bring it into scope with the `using` directive: diff --git a/docs/src/tutorials/gremlin-language-variants/index.asciidoc b/docs/src/tutorials/gremlin-language-variants/index.asciidoc index c853645..c3aed10 100644 --- a/docs/src/tutorials/gremlin-language-variants/index.asciidoc +++ b/docs/src/tutorials/gremlin-language-variants/index.asciidoc @@ -173,7 +173,7 @@ Anonymous traversals enable the "top-to-bottom" representation of a traversal. 5. `Bytecode` (**language agnostic encoding**): The source and traversal steps and their arguments are encoded in a language agnostic representation called Gremlin bytecode. This representation is a nested list of the form `[step,[args*]]*`. -Both `GraphTraversal` and `__` define the structure of the Gremlin language. Gremlin is a _two-dimensional language_ supporting +Both `GraphTraversal` and `+__+` define the structure of the Gremlin language. Gremlin is a _two-dimensional language_ supporting linear, nested step sequences. Historically, many Gremlin language variants have failed to make the distinctions above clear and in doing so, either complicate their implementations or yield variants that are not in 1-to-1 correspondence with Gremlin-Java. By keeping these concepts clear when designing a language variant, the construction of the Gremlin bytecode representation is diff --git a/docs/src/tutorials/gremlins-anatomy/index.asciidoc b/docs/src/tutorials/gremlins-anatomy/index.asciidoc index c9737e9..6c728c0 100644 --- a/docs/src/tutorials/gremlins-anatomy/index.asciidoc +++ b/docs/src/tutorials/gremlins-anatomy/index.asciidoc @@ -140,7 +140,7 @@ and "josh" edges to be grouped by? In this case, the answer to that question is provided by the anonymous traversal `label()` as the argument to the step modulator `by()`. An anonymous traversal is a traversal that is not bound to a `GraphTraversalSource`. It is -constructed from the double underscore class (i.e. `__`), which exposes static functions to spawn the anonymous +constructed from the double underscore class (i.e. `+__+`), which exposes static functions to spawn the anonymous traversals. Typically, the double underscore is not visible in examples and code as by convention, TinkerPop typically recommends that the functions of that class be exposed in a standalone fashion. In Java, that would mean link:https://docs.oracle.com/javase/7/docs/technotes/guides/language/static-import.html[statically importing] the