-
Notifications
You must be signed in to change notification settings - Fork 50
Description
I have a graph where 4 nodes (T1 through T4) are connected like this:
[T1] <-(E2)- [T2] <-(E3)- [T3] -(E4)-> [T4]
The goal of my query is:
Given a T1, find the T4 items.
The kind for T1, T2 and T3 are known but the type for T4 is not. For some reason the follwing query does not work (traversing from the left to right: T1 to T2 to T3 to T4).
get T1 where key = "%s"
traverse in:E2:out:T2
traverse in:E3:out:T3
traverse out:E4:in:
end
end
end
Traversing the nodes and edges in reverse works fine (Right to left).
get T4 where key = "%s"
traverse in:E4:out:T3
traverse out:E3:in:T2
traverse out:E2:in:
end
end
end
show 4:n:key
If I instead start on a node for T2, traverse to T1 and check the contstraint, followed by traversing T2 to T3 to T4 works fine.
get T2
traverse out:E2:in:T1 where key = "%s"
end
traverse in:E3:out:T3
traverse out:E4:in:
end
end
Alternative, if a use full wildcards for the second and the third traversal, T4 is returned (plus some extra data...)
get T1 where key = "%s"
traverse in:E2:out:T2
traverse :::
traverse :::
end
end
end
show 4:n:key
I can't see why the first query doesn't work. Given that traversing in the reverse works, suggests that the graph is correct. Any idea what the issue is?