Skip to content

Instantly share code, notes, and snippets.

@okram
Created April 30, 2013 17:35
Show Gist options
  • Save okram/5490380 to your computer and use it in GitHub Desktop.
Save okram/5490380 to your computer and use it in GitHub Desktop.
@Condition("it.out('authored').hasNext()")
@GremlinGroovy(frame = false, value =
"""
other = g.V('uri',authorUri).next()
c = 0;
it.as('x').out('authored').in('authored').loop('x'){
c++ < 100 &
new HashSet(it.path).size() == it.path.size() &
it.object != other
}.simplePath.path{it}{null}.transform{it.minus(null)}.toList()
""")
public Iterable<List> getCoauthorPaths(@GremlinParam("authorUri") String authorUri);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment