I have a graph database where every node is having a relationship intersects with the nodes that it intersects. Additionally, the intersects has a property degrees (angle at which the intersection of these two nodes happen).
I want to order the nodes which intersect a given node at a specified angle.
Since the intersection between two nodes is supplementary, I am saving only one relationship between the two nodes (example, (a)-[:intersects]->(b) and (b)-[:intersects]->(a) are similar things, but the angle will be different for the two, and this angle is supplementary). For example, if I need all cities intersecting City A at 45 degrees angle, the two queries are:
GRAPH.QUERY Nearby "MATCH (a:City { name: 'A' })-[t:intersects]->(b:City) return b.name, b.degrees ORDER BY abs(t.degrees - 45)"
GRAPH.QUERY Nearby "MATCH (a:City { name: 'A' })<-[t:intersects]-(b:City) return b.name, b.degrees ORDER BY abs(abs(t.degrees - 180) - 45)"
I want to combine these two queries in one (avoid the sorting in the client library). Is it possible to do it in redis graph? I was going to try (a)-[:intersects]-(b) and use the case...when but seems like the support to get the src node is not available yet.
Any help would be really appreciated.