问题
I am trying to load Json file into the Titan graph database using gremlin query I got the following queries
graph = TitanFactory.open('conf/titan-cassandra-es.properties')
g = graph.traversal()
g.loadGraphSON('tjson.json.json')
I am getting error like
No signature of method: org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource.loadGraphSon() is applicable for argument types: (java.lang.String) values: [tjson.json]
question is : How to load the Json file
回答1:
I assume that you are using a newer version of Titan - meaning 1.0 or greater. If so, that syntax - g.loadGraphSON('tjson.json.json')
is no longer supported. That's the old TinkerPop 2.x syntax. Titan 1.0 and greater supports TinkerPop 3.x. You can read about the revised syntax here but it basically looks like this now:
graph.io(IoCore.graphson()).readGraph("graphson-file.json");
来源:https://stackoverflow.com/questions/44039683/json-loading-with-gremlin-server-in-titan-graph-database