Difference between revisions of "Gremlin Basics"

From BITPlan Wiki
Jump to navigation Jump to search
 
(9 intermediate revisions by 2 users not shown)
Line 10: Line 10:
 
# a traversal Ψ
 
# a traversal Ψ
 
# and a set of Traversers T
 
# and a set of Traversers T
 +
== Diagram ==
 +
Click any Concept to get to the corresponding JavaDoc page
 
<uml>
 
<uml>
 
left to right direction
 
left to right direction
Line 17: Line 19:
 
}
 
}
 
note top of GraphTraversalSource: A GraphTraversalSource is the primary DSL of the Gremlin traversal machine.\n It provides access to all the configurations and steps for Turing complete graph computing.\n Any DSL can be constructed based on the methods of both GraphTraversalSource and GraphTraversal.
 
note top of GraphTraversalSource: A GraphTraversalSource is the primary DSL of the Gremlin traversal machine.\n It provides access to all the configurations and steps for Turing complete graph computing.\n Any DSL can be constructed based on the methods of both GraphTraversalSource and GraphTraversal.
class GraphTraversalSource [[http://tinkerpop.apache.org/javadocs/current/full/org/apache/tinkerpop/gremlin/process/GraphTraversalSource.html]] {
+
 
 +
class GraphTraversalSource [[http://tinkerpop.apache.org/javadocs/current/full/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.html]] {
 
}
 
}
 
note top of Traversal: traversal Ψ\nA Traversal represents a directed walk over a Graph. \nThis is the base interface for all traversal's, where each extending interface is seen as a domain specific language. \nFor example, GraphTraversal is a domain specific language for traversing a graph using "graph concepts" (e.g. vertices, edges). \nAnother example may represent the graph using "social concepts" (e.g. people, cities, artifacts). \nA Traversal is evaluated in one of two ways: iterator-based OLTP or GraphComputer-based OLAP.\n OLTP traversals leverage an iterator and are executed within a single JVM (with data access allowed to be remote). \nOLAP traversals leverage GraphComputer and are executed between multiple JVMs (and/or cores).
 
note top of Traversal: traversal Ψ\nA Traversal represents a directed walk over a Graph. \nThis is the base interface for all traversal's, where each extending interface is seen as a domain specific language. \nFor example, GraphTraversal is a domain specific language for traversing a graph using "graph concepts" (e.g. vertices, edges). \nAnother example may represent the graph using "social concepts" (e.g. people, cities, artifacts). \nA Traversal is evaluated in one of two ways: iterator-based OLTP or GraphComputer-based OLAP.\n OLTP traversals leverage an iterator and are executed within a single JVM (with data access allowed to be remote). \nOLAP traversals leverage GraphComputer and are executed between multiple JVMs (and/or cores).
Line 61: Line 64:
 
Element - "n properties" Property
 
Element - "n properties" Property
 
</uml>
 
</uml>
 +
== Steps ==
 +
<uml>
 +
hide Circle
 +
Note top of Step: The Gremlin graph traversal language defines approximately 30 steps which can be understood as the instruction set of the Gremlin traversal machine\n These steps are useful in practice, with typically only 10 or so of them being applied in the majority of cases. \nEach of the provided steps can be understood as being a specification of one of the 5 general types shown below
 +
class Step [[http://tinkerpop.apache.org/javadocs/current/full/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/__.html]] {
 +
}
 +
class map [[http://tinkerpop.apache.org/javadocs/current/full/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/__.html#map-java.util.function.Function-]] {
 +
}
 +
Step <|-- map
 +
Step <|-- flatMap
 +
Step <|-- filter
 +
Step <|-- sideEffect
 +
Step <|-- branch
 +
</uml>
 +
[[Category:frontend]]
 +
[[Category:Gremlin]]
 +
[[Category:Tinkerpop]]

Latest revision as of 14:56, 24 December 2018

Gremlin Paper by Marko Rodriguez

load PDF

DSL

Concepts

Three interacting components

  1. a Graph G
  2. a traversal Ψ
  3. and a set of Traversers T

Diagram

Click any Concept to get to the corresponding JavaDoc page

Steps