Created
August 5, 2014 22:19
-
-
Save okram/8accde41407730429e37 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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