All right I think this is correct:
select from (traverse ine("access"), in("access") from #13:8) where @class 
= "access" and out = #12:17


The covers both cases actually.


I guess the strategy is to start as far away from the information you want 
in the graph (the farthest point that requires strict criteria), so a 
traverse ends at and includes the info you want.
         
I still don't quite understand why my first attempt doesnt work, my best 
guess is that you can't use extended relationship paths such as "in.out" in 
a where clause, even though you can use such a thing in the select area.


Also it appears I must traverse both ine() and in(). If I only traverse 
in() then the results dont contain any edges. If I only traverse ine() then 
it will never traverse to $depth > 1.

Also worth noting, is that if you traverse in() it will continue past 
$depth = 1 automatically, but if you traverse ine() it will never go past 
$depth = 1 (perhaps it only continues the traverse if the intermediate 
results contains some vertices)

Thanks for your help Alessandro



On Wednesday, June 10, 2015 at 4:26:02 PM UTC-6, TheBeefiest wrote:
>
> I can not use "or" since a user may be connected to more than 1 target.
>
> So I need to ensure both ends of a chain user.@rid and target.@rid are 
> very specific, yet the real result i am querying should be the "access" 
> edge closest to the user.
>
> I have a feeling I can not combine traversedEdge() with the where clauses 
> pertaining to the target. 
>
>
>
> On Monday, June 8, 2015 at 4:47:52 PM UTC-6, TheBeefiest wrote:
>>
>> Hello, I have a data structure such as:
>> (vertex) [edge]
>>
>> (user) -> [access] -> (target)
>> and
>> (user) -> [access] -> (group) -> [access] -> (target)
>>
>> I want to retreive the [access].@rid closest to the user (farthest left 
>> in the diagram) knowing the (user).@rid and (target).@rid
>>
>>
>> I thought I could create this query by trial and error and looking at the 
>> results, so I start with
>> select from access where in = #13:8 and out = #12:17
>> This finds the first case only
>>
>> So If i query
>> select expand(in.out(access)) from access where out = #12:17
>> I can see that the result is the (target) I am trying to link to at #13:8
>>
>> So my instinct is to try
>> select from access where out = #12:17 and in.out(access).@rid = #13:8
>>
>>
>> What is the fundamental thing I am misunderstanding? Can you not do 
>> in.out in a where clause? I feel like the manual has not really taught me 
>> how to write such a query with traverse or LET or otherwise.
>>
>> Is there any other resources which walks through creating complex queries?
>>
>> Thanks for your time.
>>
>>
>>
>>
>>
>>

-- 

--- 
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.

Reply via email to