Starting with node 1, I want to return all the paths (edges and vertices, with id/label/properties) within n hops following any outbound edges, or following inbound edges with a property predicate (p > 50).
Ideally the paths shouldn't contain any cycles, so a path shouldn't contain the same node twice.
The property p is not present on every edge.
g.addV().property(id, 1).as('1').
addV().property(id, 2).as('2').
addV().property(id, 3).as('3').
addV().property(id, 4).as('4').
addV().property(id, 5).as('5').
addV().property(id, 6).as('6').
addV().property(id, 7).as('7').
addV().property(id, 8).as('8').
addE('pointsAt').from('1').to('2').
addE('pointsAt').from('3').to('1').
addE('pointsAt').from('4').to('1').property('p', 10).
addE('pointsAt').from('5').to('1').property('p', 100).
addE('pointsAt').from('2').to('6').
addE('pointsAt').from('7').to('2').
addE('pointsAt').from('8').to('2').property('p', 100).
iterate()
Assuming we start at Vertex 1 the paths would look like:
1>2
1>2>6
1>2>8
1>5
- 1-2 is included because it's outbound
- 1-3 is excluded because it is inbound to 1 and doesn't have p
- 1-4 is excluded because it is inbound and (p > 50) is false
- 1-5 is included because it is inbound and (p > 50) is true
- 2-6 is included because it's outbound
- 2-7 is excluded because it is inbound to 2 and doesn't have p
- 2-8 is included because it is inbound to 2 and p > 50
I've experimented with many different approaches and I can't seem to get anything close to what I am looking for.