Hi Denis, if you want to traverse in the outgoing direction, use this: SELECT genre, @rid, $stack, $path, $depth FROM ( TRAVERSE *out()* FROM #11:1023 strategy breadth_first ) where genre = 'Man' order by $depth
but remember that out() skip edges. If you want the edges, use this: SELECT genre, @rid, $stack, $path, $depth FROM ( TRAVERSE *outE(), inV()* FROM #11:1023 strategy breadth_first ) where genre = 'Man' order by $depth *outE()* takes the outgoing edges, and* inV()* get the incoming vertex when you're on the edge. About FOLLOW[*0*]<http://localhost:2480/studio/index.html#/database/orientlocal/browse/edit/11:1023.out_FOLLOW[0].%2312:979.in.%2311:1024.out_FOLLOW[0].%2312:984.in.%2311:1028.in_FOLLOW[0].%2312:992.out.%2311:1026.out_FOLLOW[2].%2312:989.in.%2311:1025> , FOLLOW[*2*]<http://localhost:2480/studio/index.html#/database/orientlocal/browse/edit/11:1023.out_FOLLOW[0].%2312:979.in.%2311:1024.out_FOLLOW[0].%2312:984.in.%2311:1028.in_FOLLOW[0].%2312:992.out.%2311:1026.out_FOLLOW[2].%2312:989.in.%2311:1025> Means the first in FOLLOW[0] and 3rd edge in FOLLOE[2] Lvc@ On 1 April 2014 22:52, Denis Wilson Souza Rosa <[email protected]>wrote: > Hi All! > > I have two classes, USER( vertex) and FOLLOW (edge) . So I made the > following query: > > SELECT genre, @rid, $stack, $path, $depth FROM ( TRAVERSE * FROM #11:1023 > strategy breadth_first ) where genre = 'Man' order by $depth > > > As a result I get this path: > > > #11:1023.out_FOLLOW[0].#12:979.in.#11:1024.out_FOLLOW[0].#12:984.in.#11:1028.in_FOLLOW[0].#12:992.out.#11:1026.out_FOLLOW[2].#12:989.in.#11:1025<http://localhost:2480/studio/index.html#/database/orientlocal/browse/edit/11:1023.out_FOLLOW[0].%2312:979.in.%2311:1024.out_FOLLOW[0].%2312:984.in.%2311:1028.in_FOLLOW[0].%2312:992.out.%2311:1026.out_FOLLOW[2].%2312:989.in.%2311:1025> > > > But I need to traverse only OUT --> IN relationships, and as you can see > there is an IN --> IN, any ideas of how to do that? > > > PS: What is the meaning of this numbers between brackets? (aka: FOLLOW[*0* > ]<http://localhost:2480/studio/index.html#/database/orientlocal/browse/edit/11:1023.out_FOLLOW[0].%2312:979.in.%2311:1024.out_FOLLOW[0].%2312:984.in.%2311:1028.in_FOLLOW[0].%2312:992.out.%2311:1026.out_FOLLOW[2].%2312:989.in.%2311:1025> > , > FOLLOW[*2*]<http://localhost:2480/studio/index.html#/database/orientlocal/browse/edit/11:1023.out_FOLLOW[0].%2312:979.in.%2311:1024.out_FOLLOW[0].%2312:984.in.%2311:1028.in_FOLLOW[0].%2312:992.out.%2311:1026.out_FOLLOW[2].%2312:989.in.%2311:1025> > ) > > > Thanks a Lot! > > > > > -- > > --- > 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. > -- --- 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.
