【问题标题】:GraphML inport into TitanGraphML 导入 Titan
【发布时间】:2017-01-08 04:11:55
【问题描述】:

我是泰坦世界的新手。我想将存储在 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

你能帮帮我吗?

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

84 [main] INFO org.apache.tinkerpop.gremlin.server.GremlinServer - 从 conf/gremlin-server/gremlin-server.yaml 配置 Gremlin 服务器 158 [main] INFO org.apache.tinkerpop.gremlin.server.util.MetricManager - 配置的 Metrics ConsoleReporter 配置为报告间隔 = 180000ms 160 [main] INFO org.apache.tinkerpop.gremlin.server.util.MetricManager - 配置的指标 CsvReporter 配置为报告间隔 = 180000ms 到文件名 =/tmp/gremlin-server-metrics.csv 196 [main] INFO org.apache.tinkerpop.gremlin.server.util.MetricManager - 配置的指标 JmxReporter 配置为 domain= 和 agentId= 197 [main] INFO org.apache.tinkerpop.gremlin.server.util.MetricManager - 配置的指标 Slf4jReporter 配置为间隔=180000ms 和 loggerName=org.apache.tinkerpop.gremlin.server.Settings$Slf4jReporterMetrics 1111 [main] WARN org.apache.tinkerpop.gremlin.server.GremlinServer - 在 [conf/gremlin-server/titan-berkeleyje-server.properties] 配置的图形 [graph] 无法实例化,并且在 Gremlin Server 中不可用. GraphFactory 消息:GraphFactory 无法实例化此 Graph 实现 [class com.thinkaurelius.titan.core.TitanFactory] java.lang.RuntimeException:GraphFactory 无法实例化此 Graph 实现 [class com.thinkaurelius.titan.core.TitanFactory] ... 1113 [main] INFO org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor - 初始化 Gremlin 线程池。池中的线程以模式 gremlin-* 命名 1499 [main] INFO org.apache.tinkerpop.gremlin.groovy.engine.ScriptEngines - 加载 nashorn ScriptEngine 2044 [main] INFO org.apache.tinkerpop.gremlin.groovy.engine.ScriptEngines - 加载 gremlin-groovy ScriptEngine 2488 [main] WARN org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor - 无法使用 scripts/empty-sample.groovy 初始化 gremlin-groovy ScriptEngine,因为无法评估脚本 - javax.script.ScriptException:groovy.lang .MissingPropertyException:没有这样的属性:类图:Script1 2488 [main] INFO org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor - 初始化 GremlinExecutor 并配置 ScriptEngines。 2581 [main] WARN org.apache.tinkerpop.gremlin.server.AbstractChannelizer - 无法实例化配置的序列化程序类 - org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0 - 它不可用。在 useMapperFromGraph 设置中没有配置名为 [graph] 的图 第2582章 2719 [main] WARN org.apache.tinkerpop.gremlin.server.AbstractChannelizer - 无法实例化配置的序列化程序类 - org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0 - 它不可用。在 useMapperFromGraph 设置中没有配置名为 [graph] 的图 2720 [main] WARN org.apache.tinkerpop.gremlin.server.AbstractChannelizer - 无法实例化配置的序列化程序类 - org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0 - 它不可用。在 useMapperFromGraph 设置中没有配置名为 [graph] 的图 ...

【问题讨论】:

  • 您是否对remote.yamlgremlin-server.yaml 进行了任何更改?
  • gremlin-server.log 有错误吗?你看到里面有类似INFO org.apache.tinkerpop.gremlin.server.GremlinServer - Graph [graph] was successfully configured via [conf/gremlin-server/titan-berkeleyje-server.properties].的行吗?
  • @JasonPlurad,不,我不编辑 remote.yamlgremlin-server.yaml
  • @JasonPlurad 当我在 gremlin-server.log 中执行第 4 步时,我看不到 ...was successfully configured via...
  • 在下面更新了我的答案。问题可能是$TITAN_HOME 目录的文件权限。

标签: titan gremlin graphml


【解决方案1】:

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

【讨论】:

  • 当我在 Gremlin 控制台Graph graph = TinkerFactory.createModern();graph.io(IoCore.graphml()).readGraph("/tmp/file.graphml") 中写信时,我收到了同样的信息。
【解决方案2】:

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 的用户没有适当的文件权限来创建默认图形配置使用的目录 (db/berkeley) (titan-berkeleyje-server.properties)。尝试更新$TITAN_HOME 目录的文件权限。

【讨论】:

  • 我收到了同样的信息。在第 6 步中,我尝试:gremlin> graph.io(IoCore.graphml()).readGraph("/tmp/file.graphml")gremlin> :> graph.io(IoCore.graphml()).readGraph("/tmp/file.graphml")
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多