Skip to content

Instantly share code, notes, and snippets.

@okram
Created August 5, 2014 22:19
Show Gist options
  • Select an option

  • Save okram/8accde41407730429e37 to your computer and use it in GitHub Desktop.

Select an option

Save okram/8accde41407730429e37 to your computer and use it in GitHub Desktop.
gremlin> g = TinkerGraphFactory.createTinkerGraph()
==>tinkergraph[vertices:6 edges:6]
gremlin> myVertices = g.v(1,2,3).toList() // here are my vertices as a collection
==>v[1]
==>v[2]
==>v[3]
gremlin> myVertices._().out // what are the adjacent vertices to this collection?
==>v[2]
==>v[4]
==>v[3]
gremlin> myVertices._().outE // what are the incident edges to this collection?
==>e[7][1-knows->2]
==>e[8][1-knows->4] // this is the only edge I want cause it connects to a vertex not in the collection
==>e[9][1-created->3]
gremlin> myVertices._().outE.as('x').inV.except(myVertices).back('x')
==>e[8][1-knows->4]
gremlin>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment