In my graph I have vertices joined by edges with a timestamp property and over time there may be replications of those edges with different timestamp property values. Like for example ("t" being the timestamp property on the edges) :
g.addV('a').property(T.id, 'a1') \ .addV('a').property(T.id, 'a2') \ .addV('a').property(T.id, 'a3') \ .addV('b').property(T.id, 'b2') \ .addV('b').property(T.id, 'b3') \ .addV('c').property(T.id, 'c3') \ .addV('d').property(T.id, 'd1') \ .addE('ad').from_(__.V('a1')).to(__.V('d1')).property('t', 1).property('a', 'y') \ .addE('ad').from_(__.V('a1')).to(__.V('d1')).property('t', 2).property('a', 'y') \ .addE('ab').from_(__.V('a2')).to(__.V('b2')).property('t', 1).property('a', 'y') \ .addE('bd').from_(__.V('b2')).to(__.V('d1')).property('t', 1).property('a', 'y') \ .addE('ab').from_(__.V('a3')).to(__.V('b3')).property('t', 1).property('a', 'y') \ .addE('bc').from_(__.V('b3')).to(__.V('c3')).property('t', 1).property('a', 'y') \ .addE('cd').from_(__.V('c3')).to(__.V('d1')).property('t', 1).property('a', 'y') \ .iterate()
In this example we end up with this a1 -> d1 (at "t" 1), a1 -> d1 (at "t" 2), a2 -> b2 -> d1, a3 -> b3 -> c3 -> d1. For the a1 -> d1 relationship there are two edges: one with a "t" property of 1 and the other with a "t" property of 2.
If I was starting at node d1 what would the query to get all of the "a" nodes where the edges have a max "t" value between the edges for two vertices at or before a certain time? So for example I want to traverse from d1 to get all of the associated "a" nodes where the "t" value on the edges is less than or equal to 3 and I only want to traverse those edges between those vertices where the edge has the maximum "t" value that is less than or equal to 3.
I have tried a few things with a repeat().until() but I am not sure how in the repeat() to limit the list of traversed edges to be just one edge per associated vertex. Limiting the in bound edges in this example to be just one and sorted by the edge "t" property would just results in only one edge being traversed (a1 -> d1 at "t" 2). Instead I would like to continuously traverse to all of the vertexes on the latest "t" edge for the associated vertex until all of the "a" vertexes are found. So something like on the first loop a1 -> d1 (at "t" 2), b2 -> d1, c3 -> d1, second loop a2 -> b2, b3 -> c3, and final loop a3 -> b3.
Please let me know if that doesn't make sense and I can provide more clarity. Thanks for any help and information!