6

Is there an easy way to query a cluster for all vertices that have no incoming edges?

Thilo
  • 257,207
  • 101
  • 511
  • 656

4 Answers4

14

This is more complete because also covers the case the collection exists but it's empty:

select from the_cluster where in().size() = 0
Lvca
  • 8,938
  • 2
  • 24
  • 25
0

Should it be this?

select from the_cluster where in_edgename is null

I know it's an old question but figured for anyone else who was wondering the same thing.

Masa
  • 1
  • 2
    Please make your answer more assertive. While this looks to answer the question (and really looks like the accepted answer, actually) the **Should it be this?** make your answer more like a question to the OP and then irrelevant for an answer but belonging to a comment. If you do know the answer, state the answer, do not question it. – β.εηοιτ.βε Apr 19 '15 at 19:48
0

You can do something like this: for a vertex of a class say Vtex and the Edge of class say Edg

select from Vtex where in('Edg').size() =0

This will return all the vertices of Vtex class which have no incoming edge of type Edg.

0

The following SQL seems to work (as edges are stored as fields in and out on the vertices):

select from the_cluster where in is null
Thilo
  • 257,207
  • 101
  • 511
  • 656