Hi!
We're starting to use Orient and it's been a little bit of a road, but exciting stuff. I'm starting to put a graph in that looks like:
user ---mentioned---> url
I'm trying to figure out the best way (using tinkerpop) to find the url "with the most in edges." I was able, in 1.3.0 to do this pretty easy with SQL: select url, in.size() as in_size from Links ORDER_BY in_size DESC
That seems a lot harder in 1.4.0 sql - where it seems even in_mentioned.size() doesn't work... but... more importantly - what's the best way with gremlin or pure tinkerpop to get the "highest." - I was able to use groupCount to get *all* and then sort after that, but that doesn't sound like it'll scale...
That query is like:
graph.v("@class" => "User").out_e(:mentioned).in_v.groupCount(:url).sort {|a,b| a[1] <=> b[1] }
Forgive the weird syntax... we're using Pacer in Jruby, but i'm more interested in the philosophy of tinkerpop/gremlin rather than actual syntax.
So to sum it up:
"find the top 10 link vertexes with the highest count of in_edges, using Tinkerpop and/or gremlin"
Thanks for any help! I'm sure it's a newbie question.
Topper