Rexster 0.8 Old Syntax to Achieve Order step?

26 views
Skip to first unread message

rAndomPi

unread,
May 31, 2012, 5:16:37 PM5/31/12
to gremli...@googlegroups.com
Another group at my company setup a Rexster server running 0.8 that I'm trying to query.

I'd like to run a query like the following (grab the vertex of the highest degree who has name property of 'algebra'):

g.idx('dbpedia')[[name:'algebra']].order{it.outE.count()}.next()

But the order step is not recognized on version 0.8. 

==>An error occurred while processing the script for language [groovy]: javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: com.tinkerpop.gremlin.groovy.GremlinGroovyPipeline.order() is applicable for argument types: (Script187$_run_closure1) values: [Script187$_run_closure1@77c01708]
Possible solutions: grep(), store(), or([Lcom.tinkerpop.pipes.Pipe;), grep(java.lang.Object), reset(), size()

I tried downloading Rexster 2.0.0 to use as a console (and hopefully take advantage of the order step), but I can't connect to the server which I think is running on 0.8 or 0.7.  So I'm guessing a new version of the Rexster console can't connect to an older version of a Rexster server?

What would be the equivalent query in the old syntax to achieve the order step above?

Thanks!
-R

Marko Rodriguez

unread,
May 31, 2012, 10:15:48 PM5/31/12
to gremli...@googlegroups.com
Hi,

The order step came in Gremlin 2.0.0+.

To do it in Gremlin 1.x, you use Groovy sort. Thus,

g.idx('dbpedia')[[name:'algebra']].transform{[it, it.outE.count()]}.sort{a,b -> a[1] <=> b[1]}

...I believe :). Play with it :).

HTH,
Marko.

Pierre De Wilde

unread,
Jun 1, 2012, 1:20:52 AM6/1/12
to gremli...@googlegroups.com
 Hi,

So I'm guessing a new version of the Rexster console can't connect to an older version of a Rexster server?

Right. Rexster Server and Rexster Console works in sync.

Pierre

rAndomPi

unread,
Jun 4, 2012, 5:20:07 PM6/4/12
to gremli...@googlegroups.com
Cool thanks, this worked!
Reply all
Reply to author
Forward
0 new messages