Skip to content

Instantly share code, notes, and snippets.

@spmallette
Created August 8, 2023 14:36
Show Gist options
  • Save spmallette/7ecee4b3bfa6457128485dc2be775d90 to your computer and use it in GitHub Desktop.
Save spmallette/7ecee4b3bfa6457128485dc2be775d90 to your computer and use it in GitHub Desktop.
gremlin> g = TinkerFactory.createModern().traversal()
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
gremlin> g.V().
......1> emit(__.loops().is(gte(1))).
......2> repeat(__.bothE().otherV()).times(2).as('x').
......3> emit(__.loops().is(gte(1))).
......4> repeat(__.inE().outV()).times(2).
......5> bothE().
......6> dedup().by(__.path()).
......7> otherV().
......8> count()
==>166
gremlin> g.V().
......1> emit(__.loops().is(gte(1))).
......2> repeat(__.bothE().otherV()).times(2).
......3> emit(__.loops().is(gte(1))).
......4> repeat(__.inE().outV()).times(2).
......5> bothE().
......6> dedup().by(__.path()).
......7> otherV().
......8> count()
==>154
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment