Re: Graph Traversal

35 views
Skip to first unread message
Message has been deleted

alessand...@gmail.com

unread,
Jul 19, 2016, 5:43:50 AM7/19/16
to orient-...@googlegroups.com
Hi,
do you want all paths from A - D or the shortest path or other ?

Best regards,
Alessandro 

Message has been deleted
Message has been deleted

alessand...@gmail.com

unread,
Jul 19, 2016, 6:16:34 AM7/19/16
to OrientDB
I have replicated your structure.
You could use this query

g.V.has('@class','V').has('name',T.in,['A','B','C','D'])



Kind regards,

Alessandro




Amrutha Valli

unread,
Jul 19, 2016, 6:33:34 AM7/19/16
to OrientDB
Can you explain the query

alessand...@gmail.com

unread,
Jul 19, 2016, 6:46:16 AM7/19/16
to OrientDB
Hi, with 
g.V.has('@class','V')

it get all vertices of class "V" while with
 
has('name',T.in,['A','B','C','D'])

it get all the previous vertices where the field "name" is one of A,B,C,D.

The equivalent OSQL query is :
select from v where name contains ["A","B","C","D"]

Amrutha Valli

unread,
Jul 19, 2016, 6:57:51 AM7/19/16
to OrientDB
i have the below classes

A,B,C,D,E,F  with the properties name and id and all are related with has relation the query didnt work for me

Amrutha Valli

unread,
Jul 19, 2016, 7:21:17 AM7/19/16
to OrientDB
can i have a orient query for the same

alessand...@gmail.com

unread,
Jul 19, 2016, 8:25:19 AM7/19/16
to OrientDB
You could use
g.V.has('@class',T.in,['A','B','C','D','E','F'])

Hope it helps.
Reply all
Reply to author
Forward
0 new messages