Hi Erik,
I'm afraid I don't completely understand your model:
- how are the edges directed? From parent to child or from child to parent?
- are File and Folder two different classes that extend V?
- what does the "file" property represent? Is it a string or what?
If I got it right, you have many alternatives to do this, one is as follows:
TRAVERSE in('scopedEdge') FROM (
SELECT expand(in('scopeEdge')
) FROM V WHERE file IS NOT NULL
or
SELECT FROM V
WHERE out("scopedEdge").size() > 0
or
MATCH
{class:File, where:(file is not null)} <-scopedEdge- {} <-scopedEdge- {as:folder, while:(true)}
RETURN $elements
I hope it helps
Thanks
Luigi