2014-11-08 59 views
0

我正在尝试创建一个新的Tinker图。但它给出以下例外无法在Tinkerpop3中创建新的TinkerGraph

我对图数据库很新。我只是在ubuntu linux上安装了tinkerpop3。有人能帮助我,如果我想念任何事情,谢谢。

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) 

回答

3

您没有TinkerPop3的正确语法。若要从TinkerPop2 “经典” 的图形,你必须做的:

  \,,,/ 
     (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] 
+0

谢谢你的回答。但它不工作。请让我告知是否有任何额外的工作要做。你能否告诉我是否有任何材料可用于练习tinkerpop3。 – 2014-11-11 12:22:40

+0

我不能说你做错了什么。请注意我从Gremlin Console实际会话中更新的答案。这里有大量的文档:http://www.tinkerpop.com/docs/3.0.0-SNAPSHOT/ – 2014-11-11 12:32:34

+0

插件激活:tinkerpop.server 插件激活:tinkerpop.utilities 插件激活:tinkerpop.tinkergraph我没有得到上述lines.is有任何xml配置我不知道 – 2014-11-11 13:38:07