digraph steps {
  rankdir="LR";
  step [ URL="[[Gremlin#Steps|steps]]" ] 
  subgraph cluster_terminal {
    label="terminal steps";
    graph[style=dotted];
    hasNext   [ URL="[[Gremlin#hasNext Step|hasNext]]" ] 
    next      [ URL="[[Gremlin#next Step|next]]" ] 
    tryNext   [ URL="[[Gremlin#tryNext Step|tryNext]]" ] 
    toList    [ URL="[[Gremlin#toList Step|toList]]" ] 
    toSet     [ URL="[[Gremlin#toSet Step|toSet]]" ] 
    toBulkSet [ URL="[[Gremlin#toBulkSet Step|toBulkSet]]" ] 
    fill      [ URL="[[Gremlin#fill Step|fill]]" ] 
    promise   [ URL="[[Gremlin#promise Step|promise]]" ] 
    explain   [ URL="[[Gremlin#explain Step|explain]]" ] 
    iterate   [ URL="[[Gremlin#iterate Step|iterate]]" ] 

    hasNext -> terminal
    next -> terminal
    tryNext -> terminal 
    toList -> terminal 
    toSet -> terminal
    toBulkSet -> terminal
    fill -> terminal
    iterate -> terminal
    promise -> terminal
    explain -> terminal
    terminal -> step
  }
  subgraph cluster_general {
    label="general steps";
    graph[style=dotted];
    map [ URL="[[Gremlin#map Step|map]]" ] 
    flatMap [ URL="[[Gremlin#flatMap Step|flatMap]]" ] 
    filter [ URL="[[Gremlin#filter Step|filter]]" ] 
    sideEffect [ URL="[[Gremlin#sideEffect Step|sideEffect]]" ] 
    branch [ URL="[[Gremlin#branch Step|branch]]" ] 
  
    map -> general
    flatMap -> general
    filter -> general
    sideEffect -> general
    branch -> general
    general -> step
  }
  subgraph cluster_map {
    label="map steps";
    graph[style=dotted];
    id [ URL="[[Gremlin#id Step|id]]" ] 
    label [ label="label" URL="[[Gremlin#label Step|label]]" ] 
    match [ URL="[[Gremlin#match Step|match]]" ] 
 
    path [ URL="[[Gremlin#path Step|path]]" ] 
    select [ URL="[[Gremlin#select Step|select]]" ] 
    order [ URL="[[Gremlin#order Step|order]]" ] 

    id->map
    label->map
    match->map
    path->map
    select->map
    order->map
    subgraph cluster_barrier {
      label="barrier steps";
      graph[style=dotted];
      max [ URL="[[Gremlin#max Step|max]]" ] 
      min [ URL="[[Gremlin#min Step|min]]" ] 
      cap [ URL="[[Gremlin#cap Step|cap]]" ] 
      count [ URL="[[Gremlin#count Step|count]]" ] 
      sum [ URL="[[Gremlin#sum Step|sum]]" ] 
      mean [ URL="[[Gremlin#mean Step|mean]]" ] 
      fold [ URL="[[Gremlin#fold Step|fold]]" ] 

      cap -> barrier
      count -> barrier
      max -> barrier
      min -> barrier
      sum -> barrier
      mean -> barrier
      fold -> barrier
      barrier -> map
    }

  }
  
  subgraph cluster_flatMap {
    label="flatMap steps";
    graph[style=dotted];

    in [ URL="[[Gremlin#in Step|in]]" ] 
    out [ URL="[[Gremlin#out Step|out]]" ] 
    both [ URL="[[Gremlin#both Step|both]]" ]

    inE [ URL="[[Gremlin#inE Step|inE]]" ] 
    outE [ URL="[[Gremlin#outE Step|outE]]" ] 
    bothE [ URL="[[Gremlin#bothE Step|bothE]]" ] 

    inV [ URL="[[Gremlin#inV Step|inV]]" ] 
    outV [ URL="[[Gremlin#outV Step|outV]]" ] 
    bothV [ URL="[[Gremlin#bothV Step|bothV]]" ] 

    in -> flatMap
    out -> flatMap
    both -> flatMap

    inE -> flatMap
    outE -> flatMap
    bothE -> flatMap

    inV -> flatMap
    outV -> flatMap
    bothV -> flatMap

    coalesce -> flatMap
  }
 
  subgraph cluster_filter{
    label="filter steps";
    graph[style=dotted];

    and [ URL="[[Gremlin#and Step|and]]" ] 
    coin [ URL="[[Gremlin#coin Step|coin]]" ] 
    has [ URL="[[Gremlin#has Step|has]]" ] 
    is [ URL="[[Gremlin#is Step|is]]" ] 
    limit [ URL="[[Gremlin#limit Step|limit]]" ] 
    or [ URL="[[Gremlin#or Step|or]]" ] 
    range [ URL="[[Gremlin#range Step|range]]" ] 
    tail [ URL="[[Gremlin#tail Step|tail]]" ] 
    where [ URL="[[Gremlin#where Step|where]]" ] 

    and -> filter
    coin -> filter
    has -> filter
    is -> filter
    limit -> filter
    or -> filter
    range -> filter
    tail -> filter
    where -> filter
  }

  subgraph cluster_sideEffect {
    label="sideEffect steps";
    graph[style=dotted];

    addE [ URL="[[Gremlin#addE Step|addE]]" ] 
    addV [ URL="[[Gremlin#addV Step|addV]]" ]
    property [ URL="[[Gremlin#property Step|property]]" ]
    aggregate [ URL="[[Gremlin#aggregate Step|aggregate]]" ]

    addE -> sideEffect
    addV -> sideEffect
    property -> sideEffect
    aggregate -> sideEffect
    inject -> sideEffect
    profile -> sideEffect
    property -> sideEffect
    sg [ label="subgraph" ]
    sg -> sideEffect
  }
  subgraph cluster_branch {
    label="branch steps";
    graph[style=dotted];
    choose [ URL="[[Gremlin#choose Step|choose]]" ]
    repeat [ URL="[[Gremlin#repeat Step|repeat]]" ]
    union  [ URL="[[Gremlin#union Step|union]]" ]

    choose -> branch
    repeat -> branch
    union -> branch
  }
}