tinkerpop 2.6.0 with titan-server-0.4.4 (titan + rester + cassandra) :: GremlinGroovyEngine for g.V()

61 views
Skip to first unread message

dp

unread,
Feb 8, 2015, 9:24:26 PM2/8/15
to gremli...@googlegroups.com
All,

I am using tinkerpop 2.6.0 with titan-server-0.4.4 (titan + rester + cassandra). I am using the GremlinGroovyScriptEngine to evaluate the script.

The  GremlinGroovyEngine for g.V() gives the below error. Please help.


Script:

 g.V().has('type','IUser').has('userId',T.eq,userId).fill(results)


Error Received: 


javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: com.tinkerpop.blueprints.impls.rexster.RexsterGraph.V() is applicable for argument types: () values: []

Possible solutions: is(java.lang.Object), any(), use([Ljava.lang.Object;), any(groovy.lang.Closure), use(java.util.List, groovy.lang.Closure), use(java.lang.Class, groovy.lang.Closure)

at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:348)

at org.codehaus.groovy.jsr223.GroovyCompiledScript.eval(GroovyCompiledScript.java:41)

at javax.script.CompiledScript.eval(CompiledScript.java:92)



-Regards, Durga

Priya

unread,
Feb 9, 2015, 5:00:47 AM2/9/15
to gremli...@googlegroups.com
 there(


try using and u have 2 .has in same statement

i tried this

gremlin>  g.V().and(_().has('categoryName','gel'),_().has('type','category')).map
15:30:03 WARN  com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx  - Query requires iterating over all vertices [()]. For better performance, use indexes
==>{categoryName=gel, type=category}
==>{categoryName=gel, type=category}
 

Daniel Kuppitz

unread,
Feb 9, 2015, 6:38:33 AM2/9/15
to gremli...@googlegroups.com
Hi Durka,


I bet you have to call Gremlin.load() if you want it to be available within a GroovyScriptEngine container.

Cheers,
Daniel


--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/612ba287-0868-4721-95cd-1ec564cfc66c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

dp

unread,
Feb 9, 2015, 7:37:18 AM2/9/15
to gremli...@googlegroups.com

Thank you Priya and Daniel for replies. 


This expression is working good in rexster-console, rexster-dog-house tool.     Here is my code from Java. This was working with rester 2.6.0 on arangodb graph. But on Titan+Rexster+Cassandra (2.4.0) this is showing the error.           


As per Daniel's Suggestion, I tried using Gremlin.load() and not resolved.


String expr = "g.V().has('type','IUser').has('userId',T.eq,userId).fill(results)";

Gremlin.load();  // I tried using this in static method too.

                GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine();

CompiledScript scriptengine.compile(expr);

List results = new ArrayList();

javax.script.Bindings bindings = engine.createBindings();

bindings.put("g", getConnection());

bindings.put("userId", "user1");

bindings.put("results", results);

System.err.println(">>>>>>>>>>>> " + expr);

try {

Object obj = script.eval(bindings);

                             }catch(Exception e){

                             }


thanks in advance.
-Durga

Daniel Kuppitz

unread,
Feb 9, 2015, 7:48:05 AM2/9/15
to gremli...@googlegroups.com
Hey Durga,

just shooting in the dark here, but don't you have to add the bindings before you compile the script?

Cheers,
Daniel


Message has been deleted

dp

unread,
Feb 9, 2015, 12:59:26 PM2/9/15
to gremli...@googlegroups.com
Daniel,

I am compiling the script and putting in cache.

Then I am binding parameters every time I execute. This was working in Rexster 2.6.0 as well as in ArangoDB.

I observed that the Rexster 2.4.0 version in the titan-all-server 0.4.4 version. Not sure if that causing the issue.

:)

-Regards, Durga
Reply all
Reply to author
Forward
0 new messages