Selective traverse

84 views
Skip to first unread message

Shishya

unread,
Feb 27, 2014, 1:31:42 PM2/27/14
to orient-...@googlegroups.com
Hi,

I have this need to traverse selectively, by avoiding a certain paths at same level. 

My vertex-edge structure is like this. And starting from myclass1, I need to traverse e1,e2,e3,e5 but not e4 and e5.
It is very tricky but is very interesting use case.


 myclass1---v----e2--->myclass2-e3--------v
   |  |   |
   |   e1   |
   e5  v   v
   | myclass3----e4------->myclass4
   |
   V
myclass5---e6--->myclass6

Thanks

Luca Garulli

unread,
Feb 27, 2014, 2:03:17 PM2/27/14
to orient-database
Hi,
what's e4 and e5? Edge class/label name? An attribute on edge or vertex?

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 orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

prabhat

unread,
Feb 27, 2014, 2:18:31 PM2/27/14
to orient-...@googlegroups.com
My bad. 
e1 to e6 are edges. 
myclass1 to myclass6 are vertex. To traverse to level 2, I want to avoid e4 and e6.

Regards

Prabhat Kumar Singh



--
 
---
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/IQA8WkwVkAQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.

Luca Garulli

unread,
Feb 27, 2014, 2:28:26 PM2/27/14
to orient-database
Ok,
so how do you refer to e1? by RID, by a property?

Lvc@

prabhat

unread,
Feb 27, 2014, 3:28:03 PM2/27/14
to orient-...@googlegroups.com
I define myclassx as "create class myclassx extends V" and ex as "create class ex extends E"

Regards

prabhat

unread,
Feb 27, 2014, 3:44:27 PM2/27/14
to orient-...@googlegroups.com
I didnt get your question initially, I believe.

To traverse from specific vertex, I use
traverse out() from myclassx<rid> while $depth < 3
But I need to somehow give option like
traverse out('e1','e2','e3,'e5') <But Not> out('e4','e6') from myclassx<rid> while $depth < 3

Regards

Prabhat Kumar Singh

Luca Garulli

unread,
Feb 27, 2014, 5:59:10 PM2/27/14
to orient-database
Hi,
my question is: does e4 is the class name for edge? Or it's a way you use to represent a rid of class ex?

Lvc@

prabhat

unread,
Feb 27, 2014, 10:25:47 PM2/27/14
to orient-...@googlegroups.com
Yes. e4 is class name for the edge.

Prabhat Kumar Singh

prabhat

unread,
Mar 1, 2014, 2:23:29 AM3/1/14
to orient-...@googlegroups.com
Hi,

Any ideas if its possible with select/Traverse?

Regards

Luca Garulli

unread,
Mar 1, 2014, 4:51:31 AM3/1/14
to orient-database
Hi,
clear. So the query is like you wrote:

traverse out('e1','e2','e3,'e5') from <rid> while $depth < 3

If you have default settings, namely:


alter database custom useClassForEdgeLabel=true
Lvc@



--

Shishya

unread,
Mar 2, 2014, 1:30:45 PM3/2/14
to orient-...@googlegroups.com
Hi Luca,

Thanks a lot for the pointers. 
But my need is a little complex. I have to traverse all edges, except e1 via e5. I read somewhere that a xpath like/dot operator is possible. But dont find any documentations.


 myclass1--e1-v----e2--->myclass2-e3---v
   |  |   |
   |  |   |
   e5  v   v
   | myclass3----e4------->myclass4
   |
   V
  myclass1---e1--->myclass5

cp2

unread,
Mar 4, 2014, 9:30:00 PM3/4/14
to orient-...@googlegroups.com
This is not an answer, but just an upvote for the question. I am wondering this, too.
Reply all
Reply to author
Forward
0 new messages