0

I am trying to create a new tinker graph. But it is giving following exception

i am very new to graph databases. I just have installed tinkerpop3 on ubuntu linux. can some one help me if i am missing any thing, Thanks.

 gremlin> g = TinkerGraphFactory.createTinkerGraph()

 No such property: TinkerGraphFactory for class: groovysh_evaluate
    Display stack trace? [yN] y
    groovy.lang.MissingPropertyException: No such property: TinkerGraphFactory for class: groovysh_evaluate
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:51)
        at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
        at groovysh_evaluate.run(groovysh_evaluate:3)
        at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
        at org.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:68)
        at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:159)
        at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:121)
        at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:93)
        at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:130)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:150)
        at org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:123)
        at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:57)
        at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:130)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:150)
        at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:83)
        at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
        at com.tinkerpop.gremlin.console.Console.<init>(Console.groovy:99)
        at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:636)
        at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
        at com.tinkerpop.gremlin.console.Console.main(Console.groovy:230)
cfrick
  • 35,203
  • 6
  • 56
  • 68
Ramana K
  • 3
  • 1
  • 3

2 Answers2

3

You don't have the right syntax for TinkerPop3. To create the "classic" graph from TinkerPop2 you have to do:

         \,,,/
         (o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin> g = TinkerFactory.createClassic()
==>tinkergraph[vertices:6 edges:6]
gremlin> g.V()
==>v[1]
==>v[2]
==>v[3]
==>v[4]
==>v[5]
==>v[6]
stephen mallette
  • 45,298
  • 5
  • 67
  • 135
  • Thank u for your reply.But it is not working.please let me inform if any additional work to be done. can u please tell me if there any material is available for practice of tinkerpop3. – Ramana K Nov 11 '14 at 12:22
  • I can't say what you are doing wrong. Note my updated answer from an actual Gremlin Console session. There is tons of documentation here: http://www.tinkerpop.com/docs/3.0.0-SNAPSHOT/ – stephen mallette Nov 11 '14 at 12:32
  • plugin activated: tinkerpop.server plugin activated: tinkerpop.utilities plugin activated: tinkerpop.tinkergraph i am not getting the above lines.is there any xml configuration i dont know – Ramana K Nov 11 '14 at 13:38
  • These things should just work out of the box. Are you using the pre-built distribution? http://tinkerpop.com/downloads/3.0.0.M5/gremlin-console-3.0.0.M5.zip – stephen mallette Nov 11 '14 at 14:05
  • Thank u. it is working fine after activating server, utilities, tinkergraph. my doubt is how can we communicate with java program to tinker graph database. can u please help me. – Ramana K Nov 12 '14 at 05:41
  • thank u it is working. my doubt is how can we communicate with java program to tinkerpop graph database – Ramana K Nov 12 '14 at 06:04
  • TinkerGraph is an in-memory java database. You are communicating with it by virtue of opening it. Perhaps you should read through the documentation a bit more and then post some more specific questions about your doubts as needed. – stephen mallette Nov 12 '14 at 11:40
  • I have the same problem: g = TinkerFactory.createClassic() gives: groovy.lang.MissingPropertyException: No such property: TinkerFactory for class: groovysh_evaluate at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50) at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231) at groovysh_evaluate.run(groovysh_evaluate:51) – Andrea T Nov 16 '14 at 01:25
  • The above commands are for TinkerPop3. I can only assume that you are using a TinkerPop2 distribution. There should be no problem with this command using the distribution defined in the comments above (copied here to avoid any confusion: http://tinkerpop.com/downloads/3.0.0.M5/gremlin-console-3.0.0.M5.zip) – stephen mallette Nov 16 '14 at 11:39
0

For 3.3, you need to use g = TinkerFactory.createModern()

For more details, refer Apache TinkerPop Getting Started

Hope this helps

pwwpche
  • 621
  • 1
  • 5
  • 20
livetolearn
  • 221
  • 3
  • 11