Is there a way to transverse two edges from the same vertex?
For example,
I’d want to know who have more than 3 family members and that person also works for Company ABC. How do I write GSQL when there are two different edges from the same vertex?
Is there a way to transverse two edges from the same vertex?
For example,
I’d want to know who have more than 3 family members and that person also works for Company ABC. How do I write GSQL when there are two different edges from the same vertex?
Hi @ttnguyen223,
You can try using this QUERY
// V1 Syntax
seed = {person.*}
people = select s from seed:s -( works:w ) -> company :c where c.name = "Company ABC";
res = select s from people:s -( has:h ) -> family:f where f.number_of_members >= 3;
PRINT res;
Or ,
// V2 Syntax
seed = {person.*}
people = select s from seed:s -( works>:w ) - company :c where c.name = "Company ABC";
res = select s from people:s -( has>:h ) - family:f where f.number_of_members >= 3;
PRINT res;
Thanks. This answered the example above. However, I realize my actual need is more complicated than what is diagram and so far, I can’t find a generic example without giving away too much of what we’re trying to do. I will come back when I can think of a better example.