Given this ultra-simple graph, with unknown number of vertices between A and Z, and where each edge has a distance (dist) property, I have to answer the following questions:
If I disregard the distance constraints, I can find what I need by doing the following:
g.V().match(From here, I can simply call hasNext() to check if all the conditions are satisfied, and next() to get the actual matching vertices. So far so good. But how do I add distance constraints now?
Note: One reason I'm using match() is to have a stateless query, decoupled from any specific graph, as I have thousands of graphs and run the same query on each. Another is that parts of the query are generated dynamically, and the declarative syntax lends itself much better to this use-case. Yet another is that I absolutely do not understand how to select the matched vertices using the imperative traversal 🤷♂️
Disclaimer: I also posted this same question on StackOverflow. I will make sure to link/cross post the answer not to waste anyone's effort.