GraphML进入泰坦

时间:2016-08-31 14:03:36

标签: titan gremlin graphml

我是泰坦世界的新人。我想将存储在GraphML文件中的数据导入数据库。

  1. 我下载了titan-1.0.0-hadoop1
  2. 我跑./titan.sh
  3. 我跑./gremlin.sh
  4. 在Gremlin控制台中,我写道:

    :remote connect tinkerpop.server ../conf/remote.yaml
    
  5. 接下来,我写道:

    graph.io(IoCore.graphml()).readGraph("/tmp/file.graphml")
    
  6. 我收到了消息: 没有这样的属性:类的图形:groovysh_evaluate

  7. 你能帮帮我吗?

    IMO是来自gremlin-server.log的最有趣的日志:

    84   [main] INFO  org.apache.tinkerpop.gremlin.server.GremlinServer  - Configuring Gremlin Server from conf/gremlin-server/gremlin-server.yaml
    158  [main] INFO  org.apache.tinkerpop.gremlin.server.util.MetricManager  - Configured Metrics ConsoleReporter configured with report interval=180000ms
    160  [main] INFO  org.apache.tinkerpop.gremlin.server.util.MetricManager  - Configured Metrics CsvReporter configured with report interval=180000ms to fileName=/tmp/gremlin-server-metrics.csv
    196  [main] INFO  org.apache.tinkerpop.gremlin.server.util.MetricManager  - Configured Metrics JmxReporter configured with domain= and agentId=
    197  [main] INFO  org.apache.tinkerpop.gremlin.server.util.MetricManager  - Configured Metrics Slf4jReporter configured with interval=180000ms and loggerName=org.apache.tinkerpop.gremlin.server.Settings$Slf4jReporterMetrics
    1111 [main] WARN  org.apache.tinkerpop.gremlin.server.GremlinServer  - Graph [graph] configured at [conf/gremlin-server/titan-berkeleyje-server.properties] could not be instantiated and will not be available in Gremlin Server.  GraphFactory message: GraphFactory could not instantiate this Graph implementation [class com.thinkaurelius.titan.core.TitanFactory]
    java.lang.RuntimeException: GraphFactory could not instantiate this Graph implementation [class com.thinkaurelius.titan.core.TitanFactory]
    ...
    1113 [main] INFO  org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor  - Initialized Gremlin thread pool.  Threads in pool named with pattern gremlin-*
    1499 [main] INFO  org.apache.tinkerpop.gremlin.groovy.engine.ScriptEngines  - Loaded nashorn ScriptEngine
    2044 [main] INFO  org.apache.tinkerpop.gremlin.groovy.engine.ScriptEngines  - Loaded gremlin-groovy ScriptEngine
    2488 [main] WARN  org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor  - Could not initialize gremlin-groovy ScriptEngine with scripts/empty-sample.groovy as script could not be evaluated - javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: graph for class: Script1
    2488 [main] INFO  org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor  - Initialized GremlinExecutor and configured ScriptEngines.
    2581 [main] WARN  org.apache.tinkerpop.gremlin.server.AbstractChannelizer  - Could not instantiate configured serializer class - org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0 - it will not be available. There is no graph named [graph] configured to be used in the useMapperFromGraph setting
    2582 [main] INFO  org.apache.tinkerpop.gremlin.server.AbstractChannelizer  - Configured application/vnd.gremlin-v1.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0
    2719 [main] WARN  org.apache.tinkerpop.gremlin.server.AbstractChannelizer  - Could not instantiate configured serializer class - org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0 - it will not be available. There is no graph named [graph] configured to be used in the useMapperFromGraph setting
    2720 [main] WARN  org.apache.tinkerpop.gremlin.server.AbstractChannelizer  - Could not instantiate configured serializer class - org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0 - it will not be available. There is no graph named [graph] configured to be used in the useMapperFromGraph setting
    ...
    

2 个答案:

答案 0 :(得分:1)

您需要创建图表。 graph关键字未在脚本中的任何位置声明。

答案 1 :(得分:1)

Titan Server documentation简要介绍了这一点,但很容易被忽视。

  

:>是"提交"将该行上的Gremlin发送到当前活动的遥控器的命令。

在步骤5中,您需要将脚本命令提交到远程服务器。在Gremlin控制台中,您可以通过:submit:>启动命令来实现此目的。

:> graph.io(IoCore.graphml()).readGraph("/tmp/file.graphml")

如果您未将脚本提交到远程服务器,Gremlin控制台将尝试在控制台的JVM中处理脚本。 graph未在本地定义,这就是您在步骤6中看到错误的原因。

更新:根据您的gremlin-server.log,问题是,使用./bin/titan.sh start启动Titan的用户没有相应的文件权限来创建目录({{1} })默认图形配置(db/berkeley)使用。尝试更新titan-berkeleyje-server.properties目录上的文件权限。