Hi there,
Using Titan v0.5.4. Is there a way to hit the Titan API from within a Gremlin user defined step?
I'm trying to define a .followers() step which takes an optional count parameter. I thought I could be doing something that'd resemble this:
Gremlin.defineStep('followers', [Vertex, Pipe], { count = 20 ->
query().labels("follows").direction(IN).orderBy("timestamp", Order.DESC).limit(count).vertices()._()
This obviously doesn't work and Rexster returns the following error:
error: "javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: com.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.query() is applicable for argument types: () values: [] Possible solutions: every(), every(groovy.lang.Closure), grep(), grep(java.lang.Object), dump(), any()"
Until TP3 is out, the goal is to allow a query such as g.query().has('label', 'user').has('name', 'foobar').vertices()._().followers(50) and efficiently retrieve foobar's latest 50 followers.
I'm not even sure this is feasible. Any ideas?
Thanks,
Jean-Baptiste