A self-writing traversal.

54 views
Skip to first unread message

Marko Rodriguez

unread,
Sep 28, 2016, 1:02:26 PM9/28/16
to gremli...@googlegroups.com, d...@tinkerpop.apache.org
Hello,

Assume the following graph.

g = TinkerGraph.open().traversal()
g.addV().property(id,1).property('op','g.').as('g.').
  addV().property('op','V(1).').as('V(1).').
  addV().property('op','repeat(').as('repeat(').
  addV().property('op','out()).').as('out()).').
  addV().property('op','times(4).').
         property('name',"x",'op',"properties('name')").as('times(4).').
  addE('link').from('g.').to('V(1).').
  addE('link').from('V(1).').to('repeat(').
  addE('link').from('repeat(').to('out()).').
  addE('link').from('out()).').to('times(4).')


Next, assume the following traversal:

g.V(1).repeat(out()).times(4).properties('name')

Look at the path that is traversed when the above traversal is executed against the above graph.

gremlin> g.V(1).repeat(out()).times(4).properties('name').path().by('op')
==>[g.,V(1).,repeat(,out()).,times(4).,properties('name')]

This is a traversal that writes itself out.

Marko.

Marko Rodriguez

unread,
Sep 30, 2016, 9:44:13 PM9/30/16
to gremli...@googlegroups.com, d...@tinkerpop.apache.org
So whats up Kuppitz? You just going to let me throw down a wicked nasty and not come back with something even better?!

Marko.
On Sep 28, 2016, at 11:02 AM, Marko Rodriguez <okram...@gmail.com> wrote:

Hello,

Assume the following graph.

g = TinkerGraph.open().traversal()
g.addV().property(id,1).property('op','g.').as('g.').
  addV().property('op','V(1).').as('V(1).').
  addV().property('op','repeat(').as('repeat(').
  addV().property('op','out()).').as('out()).').
  addV().property('op','times(4).').
         property('name',"x",'op',"properties('name')").as('times(4).').
  addE('link').from('g.').to('V(1).').
  addE('link').from('V(1).').to('repeat(').
  addE('link').from('repeat(').to('out()).').
  addE('link').from('out()).').to('times(4).')

<self-writing-graph.png>

Daniel Kuppitz

unread,
Oct 1, 2016, 8:29:10 AM10/1/16
to gremli...@googlegroups.com
Ha, nope. I've tried to tweak it a bit, but ended up with something that was no longer a self-writing traversal.

Cheers,
Daniel


--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/DBDE5523-3794-4467-BFC3-0BBF9D58B4D5%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages