Hi, I a new to OrientDB then not very comfortable with SQL for graph. How can i get all ancestor from a vertex ? Considering following definitions :
Class Vertex "Folder" extends V,ORestricted Class Vertex "Document" extends V,ORestricted Class Edge "HasFolder" extends E Class E "HasDocument" extends E I have following graph : Folder 01 --- [HasFolder]--> Folder 01.01 -- [HasDocument] --> My Doc 01 Folder 01 --- [HasFolder]--> Folder 01.02 -- [HasDocument] --> My Doc 02 Folder 01 --- [HasFolder]--> Folder 02.01 -- [HasDocument] --> My Doc 03 etc... Starting from "My Doc 01", how can i get all ancestors (Folder 01.01, Folder 01.02) using SQL "traverse" function ? SQL : "select from (traverse out() from #<ID Folder>) where @class='Document'" Works fine if i want to have all documents referenced into descending tree but do not work if i use "in()" it do not work : "select from (traverse in() from (select from Document where name='My Doc 01')) I tried with "V.out , E.in" and it do not work also. What is the correct syntax ? I think i miss something :) -- --- You received this message because you are subscribed to the Google Groups "OrientDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
