I am new in dse graph, I want to create gremlin query which gives me list of all vertex which is linked from specified vertex but from this list I want to remove those list which are linked cyclic.
e.g.
A --> B
A --> C
A --> D
B --> A
If I have above relation then I want below vertex list as result
[C,D]
B and A should not be in above list as it has cyclic relation
I have below two separate query to find all linked vertexes and to find cyclic vertex
g.V().has('id','id').as('mainV').outE('Prerequisite').inV();
g.V().has('id','id').as('mainV').out().out().cyclicPath().path().unfold().dedup();
Could you please help me to find exact query to achieve my requirement.
So you basically want to filter out vertices, that have an
in
and anout
edge to a particular vertex.This is your sample graph:
And this is the traversal you're looking for: