I have use case with vertexes and edges like:
A-(B)-C-(D)-E-(F)-A
Just say that I start with A and select form A-(B)-C-(D)-E with a WHERE condition, so getting a subset of E, say “e_sub1”.
What I’d like is to filter e_sub1 if the F relationship exists and if a certain property on the relationship is set to true.
What’s the best way to do this?
When I try something like:
Start{a}
e_sub1 = SELECT e FROM Start-(B)-C-(D)-E:e
WHERE e.search_key like term;
f = SELECT f FROM e_sub1-(F:f)-Start
WHERE f.hide == true;
e_toRemove = SELECT e from f-E:e;
PRINT e_sub1 MINUS e_toRemove;
I get Undefined vertex type “Start”
I also tried:
Start{a}
e_sub1 = SELECT e FROM Start-(B)-C-(D)-E:e
WHERE e.search_key like term;
e_sub2 = SELECT e FROM Start-(F:f)-E:e
WHERE
e IN e_sub1
f.hide == true
PRINT e_sub2;
However, there was a problem with e_sub1 not being recognised as a variable.
The only way I can see at the moment is something like:
Start{a};
e_sub1 = SELECT e FROM Start-(B)-C-(D)-E:e
WHERE e.search_key like term;
e_sub2 = SELECT e FROM Start-(F:f)-E:e
WHERE
f.hide == true;
res = e_sub1 MINUS e_sub2;
RETURN res;
But this seems like it could be more efficient.