0
votes

I have just tried to run the simple demo on Frames from the gremlin console:

TinkerGraph graph = TinkerGraphFactory.createTinkerGraph();

FramedGraphFactory factory = new FramedGraphFactory(new GremlinGroovyModule());

after adding an import com.tinkerpop.frames.*; (yes, tinkerpop frames is in my classpath) but the console does not recognize the FramedGraphFactory class.

In fact, if I run the

gremlin> show classes

command, it replies that nothing has been loaded. Any clue?

Thanks

PS Details: I am on Ubuntu, downloaded gremlin-groovy-2.4.0.

I have also downloaded the frames jar, and set the classpath:

echo $CLASSPATH

/home/dev/frames-2.5.0.jar

then started gremlin and imported frames:

import com.tinkerpop.frames.*

finally

TinkerGraph graph = TinkerGraphFactory.createTinkerGraph();

FramedGraphFactory factory = new FramedGraphFactory(new GremlinGroovyModule()); 

produces:

groovysh_evaluate: 50: unable to resolve class FramedGraphFactory 
 @ line 50, column 30.
   FramedGraphFactory factory = new FramedGraphFactory(new GremlinGroovyModule()); //(1) Factories should be reused for performance and memory conservation.
                                ^
groovysh_evaluate: 50: unable to resolve class GremlinGroovyModule 
 @ line 50, column 53

.

1
can you please post your REPL session (i.e. what you are typing and what error you are getting back)?stephen mallette
Hi Stephen, thanks for stepping in! Details have been added aboveMirco A. Mannucci

1 Answers

1
votes

Try this:

gremlin> Grape.grab([group:"com.tinkerpop",module:"frames",version:"2.4.0"])
==>null
gremlin> graph = TinkerGraphFactory.createTinkerGraph()                     
==>tinkergraph[vertices:6 edges:6]
gremlin> import com.tinkerpop.frames.*                                      
==>import com.tinkerpop.gremlin.*
==>import com.tinkerpop.gremlin.java.*
==>import com.tinkerpop.gremlin.pipes.filter.*
...
==>import groovy.grape.Grape
==>import com.tinkerpop.frames.*
gremlin> import com.tinkerpop.frames.modules.gremlingroovy.*                
==>import com.tinkerpop.gremlin.*
==>import com.tinkerpop.gremlin.java.*
==>import com.tinkerpop.gremlin.pipes.filter.*
==>import com.tinkerpop.gremlin.pipes.sideeffect.*
...
gremlin> factory = new FramedGraphFactory(new GremlinGroovyModule());       
==>com.tinkerpop.frames.FramedGraphFactory@645c1312

Omit the use of Grape at the start if you already have the jar copied, though if you copy make sure you have all the Frames dependencies and not just the Frames jar itself (Grape hides such things from you).