【问题标题】:Not able to create new TinkerGraph in Tinkerpop3无法在 Tinkerpop3 中创建新的 TinkerGraph
【发布时间】:2014-11-08 07:20:47
【问题描述】:

我正在尝试创建一个新的修补程序图。但它给出了以下异常

我对图形数据库非常陌生。我刚刚在 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)

【问题讨论】:

    标签: groovy gremlin tinkerpop


    【解决方案1】:

    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]
    

    【讨论】:

    • 感谢您的回复。但它不起作用。如果还有其他工作要做,请告诉我。你能告诉我是否有任何材料可用于 tinkerpop3 的练习。
    • 我不能说你做错了什么。请注意我从实际 Gremlin 控制台会话中更新的答案。这里有大量文档:tinkerpop.com/docs/3.0.0-SNAPSHOT
    • 插件已激活:tinkerpop.server 插件已激活:tinkerpop.utilities 插件已激活:tinkerpop.tinkergraph 我没有收到上述行。是否有任何我不知道的 xml 配置
    • 这些东西应该开箱即用。您使用的是预构建的发行版吗? tinkerpop.com/downloads/3.0.0.M5/gremlin-console-3.0.0.M5.zip
    • 谢谢你。激活服务器、实用程序、修补程序后,它工作正常。我的疑问是我们如何与 java 程序进行通信以修补图形数据库。你能帮帮我吗?
    【解决方案2】:

    对于3.3,你需要使用g = TinkerFactory.createModern()

    更多详情请参考Apache TinkerPop Getting Started

    希望对你有帮助

    【讨论】:

      猜你喜欢
      • 2019-06-04
      • 1970-01-01
      • 1970-01-01
      • 2013-12-22
      • 2017-12-22
      • 1970-01-01
      • 2012-10-30
      • 2015-04-25
      • 1970-01-01
      相关资源
      最近更新 更多