Accumulate edge attributes to the end of unknown x hops

Is there a way to hop from a starting vertex to the very end of paths when we don’t know how many hops it takes to go to the very end?

For example, I want to know all possible acquittances based on who she is friends with and who her friends are friends with and so on. I want to collect the edge attributes such as date the two vertices became friends for each hop.

Jane Doe ----(friendship 01/23/2009)—> John Doe
John Doe ----(friendship 03/17/2009) —> Mary Jane
Mary Jane —(friendship 01/03/2011) —> Peter Parker
Peter Parker --(friendship 09/15/2016) —> Toby McGuire

Eventually, I want the query result to look like this:
Jane Doe, John Doe, 01/23/2001
Jane Doe, Mary Jane, 03/17/2009
Jane Doe, Peter Parker 01/03/2011
Jane Doe, Toby McGuire 09/15/2016

This has 4 hops but I don’t know that since I don’t have knowledge of the whole graph.

How do I write this without using a ton of accumulators for each hop? And how do I write a query so that it will continue to hop until it reaches the end of the maximum number of hops it can take?

Thank you!

Hi ttnguyen,

You can use star patterns to accomplish this.

For example, you could do:
Person - (friendship>*) - Person
That will repeatedly traverse a friendship edge forwards until it cannot any more. Note that the > implies a directed edge, you should omit that if your friendship is a non-directed edge.

I tried that but I’m not able to get the edge attribute in each hop since Kleene star doesn’t support alias.