check MATCH command if can handle your case here http://orientdb.com/docs/3.0.x/sql/SQL-Match.html
On Saturday, July 28, 2018 at 12:30:27 AM UTC+3, Abe Burnett wrote: > > Hi there, > > So I'm new to OrientDB, and actually fairly decent at SQL which I'm > finding makes it potentially harder to master the syntax of OrientDB > queries. I asked the following question on Stack Overflow and received an > answer which got me part of the way to my desired outcome, but not all the > way. I'm hopeful that someone here can help get me all the way there. > > My goal: two columns (essentially). One column is Indication name, and the > other is the number/count of indirectly connected Organizations to that > indication. > > My OrientDB has the following structure: V_organizations --> E_DEVELOPS_IN > (edge) --> Platform --> E_TREATS (edge) --> V_indication. > > The following query gives me a count of linked organizations, but at the > _platform_ level, rather than the indication level. How do I modify this > query to give me a count of indirectly connected organizations for each > indication? > > SELECT OUT(E_DEVELOPS_IN).size() AS connectedOrg,* > FROM ( > TRAVERSE IN(E_TREATS) > FROM V_indication WHILE $depth < 2 > ) > WHERE $depth > 0 > ORDER BY connectedOrg desc > > > > Then, once I've identified the most connected (by count of indirectly > associated organizations) indications, how do I query OrientDB to get the > full graph of those associations (i.e., the graph of just the most > connected indication and the organizations it's connected to)? > > I hope that by hammering on this and seeing how you more expert users of > OrientDB would do it, I can learn how to be proficient myself. Thank you > for your help! > > Warm regards, > > Abe > > > -- --- 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-database+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.