TinkerPop 相关
TinkerPop不仅是各种图数据库的抽象,也是图处理器(Spark和Giraph)的抽象
用TraversalSource而不是Graph
推荐:使用Graph类进行图操作
To maintain an abstraction over Graph creation use GraphFactory.open() to construct new instances
Tutorial:Getting Started

Gremlin Server

Tinkerpop Docs
#Introduction
##The Graph Process
TraversalSource Gremlin游走的起点。GraphTraversalSource 是其中最常见的
The return type of V() and E() is a GraphTraversal
对GraphTraversal的操作(即步骤)分为五种:
map: transform the incoming traverser’s object to another object (S → E).

  1. flatMap: transform the incoming traversers object to an iterator of other objects (S E*).
  2. filter: allow or disallow the traverser from proceeding to the next step (S E S).
  3. sideEffect: allow the traverser to proceed unchanged, but yield some computational sideEffect in the process (S S).
  4. branch: split the traverser and send each to an arbitrary location in the traversal (S { S1 E*, …, Sn E* } E*).

The Traveser
保存游走过程中的metadata信息。path step和 repeat step可以读取这个metadata
path计算是昂贵的

The Traversal

Graph Traversal Steps
* General Steps

  1. * Terminal Steps
  2. next() hasNext() toSet() iterate()

避免使用lambda传参进行traversal
match step