I think I found out how to do that:

select from (
  traverse out_permissions, in from A while ((@class = 'permission' AND r = 
true) OR @class <> 'permission')
) where @class <> 'permission'

The idea is to traverse both verticies and edges. Then check r property 
only on edge. And finally selecting only verticies.


Dne neděle 4. října 2015 12:17:45 UTC+2 Sung Eun Choi napsal(a):
>
> Suppose we have a graph arranged like this:
>
> permissions { permissions { 
> r: true, r: true, 
> +-----+ w: true +-----+ w: false +-----+
> | | } | | } | |
> | A +-----------------> B +---------------> C |
> | | | | | |
> +-----+ +-----+ +-----+
>
> Note: We can consider a graph with multiple vertices that are connected by 
> similar edges.
> Note: The "permissions" is an edge with boolean fields "r" and "w".
>
> What would be the query if I wanted to traverse starting from A to all 
> vertices that are connected by permissions edge with field r=true?
>
> The query to traverse through all permissions edges would be
> TRAVERSE OUT('permissions') FROM A
>
> However, I am looking for something to the effect of
> TRAVERSE OUT('permissions (with r=true)') FROM A
> ->[returns A, B, C]
>
> TRAVERSE OUT('permissions (with w=true)') FROM A
> ->[returns A, B]
>
>
> Thanks in advance
>

-- 

--- 
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 orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to