0

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

.

Mike H-R
  • 7,726
  • 5
  • 43
  • 65

1 Answers1

1

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).

stephen mallette
  • 45,298
  • 5
  • 67
  • 135
  • yes it works! So looks like the problem was that I did not download all the dependencies of the frames jar file (from the online doc it is not too clear...). Anyway thanks! – Mirco A. Mannucci Apr 16 '14 at 19:34
  • Update: it does work, in the sense that it creates the framedGraph object. However, when I add the statement Person person=framedGraph.getVertex(1, Person.class); groovysh_evaluate: 52: unable to resolve class Person – Mirco A. Mannucci Apr 18 '14 at 15:33
  • I have tried to use the import >import com.tinkerpop.frames.domain.classes.* which is where the Person class is supposed to be, to no avail. Any clue? – Mirco A. Mannucci Apr 18 '14 at 15:33
  • those are "test" classes: https://github.com/tinkerpop/frames/tree/master/src/test/java/com/tinkerpop/frames/domain/classes – stephen mallette Apr 18 '14 at 18:15