2
votes

I'm new in Titan world. I would like to import data stored in GraphML file into a database.

  1. I downloaded titan-1.0.0-hadoop1
  2. I run ./titan.sh
  3. I run ./gremlin.sh
  4. In Gremlin console I wrote:

    :remote connect tinkerpop.server ../conf/remote.yaml
    
  5. Next, I wrote:

    graph.io(IoCore.graphml()).readGraph("/tmp/file.graphml")
    
  6. I got message: No such property: graph for class: groovysh_evaluate

Could you help me?

IMO the most interesting logs from 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
did you make any changes in remote.yaml or gremlin-server.yaml?Jason Plurad
are there any errors in gremlin-server.log? do you see a line in there something similar to INFO org.apache.tinkerpop.gremlin.server.GremlinServer - Graph [graph] was successfully configured via [conf/gremlin-server/titan-berkeleyje-server.properties].?Jason Plurad
@JasonPlurad, no I do not edit remote.yaml or gremlin-server.yamlDomel
@JasonPlurad When I execute step 4 in gremlin-server.log I don't see ...was successfully configured via...Domel
updated my answer below. problem might be file permissions on the $TITAN_HOME directory.Jason Plurad

2 Answers

1
votes

You need to create a graph. the graph keyword isn't declared anywhere in your script.

1
votes

This is briefly covered in the Titan Server documentation, but it is easily overlooked.

The :> is the "submit" command which sends the Gremlin on that line to the currently active remote.

In step 5, you need to submit your script command to the remote server. In the Gremlin Console, you do this by starting your command with :submit or :> for shorthand.

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

If you don't submit the script to the remote server, the Gremlin Console will attempt to process the script within the console's JVM. graph is not defined locally, and that is why you saw the error in step 6.

Update: Based on your gremlin-server.log it looks like the issue is that the user that starts Titan with ./bin/titan.sh start doesn't have the appropriate file permissions to create the directory (db/berkeley) used by the default graph configuration (titan-berkeleyje-server.properties). Try updating the file permissions on the $TITAN_HOME directory.