Skip to content

Instantly share code, notes, and snippets.

@spmallette
Last active August 29, 2015 13:59
Show Gist options
  • Save spmallette/10884197 to your computer and use it in GitHub Desktop.
Save spmallette/10884197 to your computer and use it in GitHub Desktop.
def map(v, args) {
def u = g.v(v.id)
def l = []
u.inE.filter({!it.outV.outE.retain([it]).hasNext()}).id.fill(l)
u.outE.filter({!it.inV.inE.retain([it]).hasNext()}).id.fill(l)
def x = l.inject(" "){acc,val->acc = acc + "\t" + val}
return x.substring(1).trim()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment