Luca - no, it's not ok, from my point of view. Dexter - thanks, that's exactly what I'm expecting. My expectation is based on this piece of documentation *while <https://github.com/orientechnologies/orientdb/wiki/SQL-Where> condition to continue the traversing while it's true.*
Am I missing something? -Andrey On 19 February 2014 17:58, Dexter Pratt <[email protected]> wrote: > 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 > > Dexter Pratt > Director, NDEx project > Ideker Lab UCSD / Cytoscape Consortium > [email protected] - [email protected] > www.ndexbio.org > > On Wednesday, February 19, 2014 at 2:44 PM, Luca Garulli wrote: > > So is it ok, right? > > Lvc@ > > > On 19 February 2014 23:30, Andrey Yesyev <[email protected]> wrote: > > Oh, yes I did. Forgot to mention, > In this case the result is very unexpected > > @rid @version @class name in_HAS out_HAS > #12:0<http://localhost:2480/studio/index.html#/database/ePersona/browse/edit/12:0>7Casedemo[1][5] > #13:1<http://localhost:2480/studio/index.html#/database/ePersona/browse/edit/13:1>2Collectionmysql_import_cc.pcap[1] > #13:2<http://localhost:2480/studio/index.html#/database/ePersona/browse/edit/13:2>2Collectionmysql_import_emails.pcap[1] > #13:3<http://localhost:2480/studio/index.html#/database/ePersona/browse/edit/13:3>2Collectiontelnet_cat_emial_list.pcap[1] > #13:4<http://localhost:2480/studio/index.html#/database/ePersona/browse/edit/13:4>2Collectiondemo_stream[1] > So, I see everything BUT gmail_with_attachments.pcap vertex. > > > > > On 19 February 2014 16:47, Luca Garulli <[email protected]> wrote: > > Have you tried: > > select from ( traverse out_HAS from #12:0 while $depth < 2 and > name<http://current.name/> <> > 'gmail_with_attachments.pcap') > > Lvc@ > > > > On 19 February 2014 19:12, Andrey Yesyev <[email protected]> wrote: > > Hi there, > > I was playing with traverse and couldn't figure out the logic of WHILE. > This is what I found in docs: > > *while <https://github.com/orientechnologies/orientdb/wiki/SQL-Where>* > condition > to continue the traversing while it's true. Usually it's used to limit the > traversing depth by using $depth < <x> where x is the maximum level of > depth you want to reach. *$depth* is the first context variable that > reports the depth level during traversal. > Pretty straight forward, but then I tried to query DB > > select from ( traverse out_HAS from #12:0 while $depth < 2) > > Got the result > > > @rid @version @class name in_HAS out_HAS > #12:0<http://localhost:2480/studio/index.html#/database/ePersona/browse/edit/12:0>7Casedemo[1][5] > #13:0<http://localhost:2480/studio/index.html#/database/ePersona/browse/edit/13:0>2Collectiongmail_with_attachments.pcap[1] > #13:1<http://localhost:2480/studio/index.html#/database/ePersona/browse/edit/13:1>2Collectionmysql_import_cc.pcap[1] > #13:2<http://localhost:2480/studio/index.html#/database/ePersona/browse/edit/13:2>2Collectionmysql_import_emails.pcap[1] > #13:3<http://localhost:2480/studio/index.html#/database/ePersona/browse/edit/13:3>2Collectiontelnet_cat_emial_list.pcap[1] > #13:4<http://localhost:2480/studio/index.html#/database/ePersona/browse/edit/13:4>2Collectiondemo_stream[1] > Which is perfectly correct. > Now I want to stop traversing, as soon as I reach vertex with the > name=gmail_with_attachments.pcap. > I assume it should look like this > > select from ( traverse out_HAS from #12:0 while $depth < 2 and $ > current.name <> 'gmail_with_attachments.pcap') > > But no, it doesn't work. I'm getting > > No records found. > > What's the problem? > > -Andrey > > > > -- > > --- > 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. > > > -- > > --- > You received this message because you are subscribed to a topic in the > Google Groups "OrientDB" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/orient-database/Fvf-4LibdMs/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [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. > > > -- > > --- > 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. > > > -- > > --- > You received this message because you are subscribed to a topic in the > Google Groups "OrientDB" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/orient-database/Fvf-4LibdMs/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [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.
