Json loading with gremlin server in titan graph database

心不动则不痛 提交于 2020-01-07 06:59:30

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!