My understanding now is that it works as a Java "while" for the current traversal from a starting point.
The query, however, is the union of all possible traversals from the starting points. Suppose we have a network that is the union of these paths: A -> B -> C A -> B -> D A -> E -> C if I traverse with "while not B", then I get to C2 but not to C1 or D - the "while" fails when the traversal encounters B if I traverse with "while not C" , I get to D. Or better stated, in the depth-first search, the "while" condition prunes branches of the search tree. - Dexter Dexter Pratt Director, NDEx project Ideker Lab UCSD / Cytoscape Consortium [email protected] - [email protected] www.ndexbio.org On Tuesday, February 25, 2014 at 12:23 PM, Andrey Yesyev wrote: > The only thing I want is to understand how it's supposed to work. > For now, I have two answers, that contradicts each other > > First > > > > I think that Andrey's point is that he is expecting "while" to have > > semantics like a "while" construct in Java - discontinue execution if the > > condition is not met. > > This result excludes the case where the "while" is not satisfied but > > continues. > > (I'm just trying to help clarify, I don't have any opinion about that > > expectation) :-) > > - Dexter > > Second > > > Hi guys, > > dunno why it's not clear. WHILE condition is exactly like in Java: while > > the condition is TRUE the traversing continues. As soon as the condition is > > FALSE traverse stops. > > So it DOES or DOES NOT work as in Java? > > -Andrey > On Monday, February 24, 2014 9:26:51 PM UTC-5, Alan Johnson wrote: > > I sounds like the OP wants the predicate based on name to somehow augment > > the depth conditional, such that when either the depth is reach OR the name > > is hit the while is ended. This presumes some sort of ordering exists, in > > that the name element is somehow nested in a manner consistent with or > > superior to the depth element. Sounds like there is a need for some logic > > that says the name condition being met constitutes a "break" condition for > > the while, as in a goto that jumps out of the loop? > > > > On Saturday, February 22, 2014 8:58:09 AM UTC-5, Lvc@ wrote: > > > Hi guys, > > > dunno why it's not clear. WHILE condition is exactly like in Java: while > > > the condition is TRUE the traversing continues. As soon as the condition > > > is FALSE traverse stops. > > > > > > Your result seems correct. The first query: > > > > > > select from ( traverse out_HAS from #12:0 while $depth < 2) > > > > > > Returned > > > @rid > > > @version > > > @class > > > name > > > in_HAS > > > out_HAS > > > > > > > > > #12:0 > > > (http://localhost:2480/studio/index.html#/database/ePersona/browse/edit/12:0) > > > 7 > > > Case > > > demo > > > [1] > > > [5] > > > > > > #13:0 > > > (http://localhost:2480/studio/index.html#/database/ePersona/browse/edit/13:0) > > > 2 > > > Collection > > > gmail_with_attachments.pcap > > > [1] > > > > > > #13:1 > > > (http://localhost:2480/studio/index.html#/database/ePersona/browse/edit/13:1) > > > 2 > > > Collection > > > mysql_import_cc.pcap > > > [1] > > > > > > #13:2 > > > (http://localhost:2480/studio/index.html#/database/ePersona/browse/edit/13:2) > > > 2 > > > Collection > > > mysql_import_emails.pcap > > > [1] > > > > > > #13:3 > > > (http://localhost:2480/studio/index.html#/database/ePersona/browse/edit/13:3) > > > 2 > > > Collection > > > telnet_cat_emial_list.pcap > > > [1] > > > > > > #13:4 > > > (http://localhost:2480/studio/index.html#/database/ePersona/browse/edit/13:4) > > > 2 > > > Collection > > > demo_stream > > > > > > > > > > > > > > > And this query: > > > select from ( traverse out_HAS from #12:0 while $depth < 2 and name > > > (http://current.name/) <> 'gmail_with_attachments.pcap') > > > > > > > > > Returned: > > > @rid > > > @version > > > @class > > > name > > > in_HAS > > > out_HAS > > > > > > > > > #12:0 > > > (http://localhost:2480/studio/index.html#/database/ePersona/browse/edit/12:0) > > > 7 > > > Case > > > demo > > > [1] > > > [5] > > > > > > #13:1 > > > (http://localhost:2480/studio/index.html#/database/ePersona/browse/edit/13:1) > > > 2 > > > Collection > > > mysql_import_cc.pcap > > > [1] > > > > > > #13:2 > > > (http://localhost:2480/studio/index.html#/database/ePersona/browse/edit/13:2) > > > 2 > > > Collection > > > mysql_import_emails.pcap > > > [1] > > > > > > #13:3 > > > (http://localhost:2480/studio/index.html#/database/ePersona/browse/edit/13:3) > > > > > > 2 > > > Collection > > > telnet_cat_emial_list.pcap > > > [1] > > > > > > #13:4 > > > (http://localhost:2480/studio/index.html#/database/ePersona/browse/edit/13:4) > > > 2 > > > Collection > > > demo_stream > > > > > > > > > > > > > > > And this is the expected result: like the first query but you've added > > > the condition name (http://current.name/) <> > > > 'gmail_with_attachments.pcap' so the record #13:0 is not part of result > > > set and the traversing under that record is forbidden. > > > > > > Lvc@ > > > > -- > > --- > 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] > (mailto:[email protected]). > For more options, visit https://groups.google.com/groups/opt_out. -- --- 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/groups/opt_out.
