Discussion:
[orientdb] How to find most connected leaf nodes?
Abe Burnett
2018-07-27 21:29:13 UTC
Permalink
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 AND name = 'Serine Hydrolases'
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...