Here’s what I’m trying to say:
Create graph PowerFlow(..., BRANCH, BRANCH_RESERVE, ...)
, Whether the reverse edge BRANCH_reserve
needs to be added.
Because I noticed that if I didn’t add it, it would give me an error when I typed the reverse edge name in the query, Like this
The situation is understandable.
However, I found that if I did not specify an edge name, it could find the corresponding node, Like this
It can return all my Bus nodes, although some Bus nodes are only destination nodes (it has no out degree).
There are only BRANCH and BRANCH_RESERVE edges between my Bus nodes.
Although I like this phenomenon, yes, I need this feature, but I am a little confused why it is?
Thank you!
You have to explicitly specify the reverse edge and give it a name, like this:
CREATE DIRECTED EDGE sequel_of (FROM Book, TO Book) WITH REVERSE_EDGE=“preceded_by”
CREATE DIRECTED EDGE BRANCH (FROM Bus, TO Bus) WITH REVERSE EDGE = “BRANCH_REVERSE”
So in your first example, you are correct that if you do not explicitly add the reverse edge, you will get an error when you try to use one.
In your second example, notice that you don’t have any direction, for the edge, so its just a wild card and will pick up any edge, in either direction. So it makes sense that it will find all business nodes that have either an incoming or outgoing edge.
You also may have a typo, REVERSE vs RESERVE
2 Likes
@markmegerian Thank you, thank you very much for pointing out my problem, which was really caused by a typing error and was a bit embarrassing
But I still noticed that I didn’t explicitly include this reverse edge when I created the graph, and it can be used directly for queries.It seems that this feature is quite good!