我试图用JanusGraph在Gremlin shell中输出一个子图作为GraphSON.
TinkerPop文档供参考:http://tinkerpop.apache.org/docs/current/reference/#graphson-reader-writer
当我编写完整的图形时,这工作正常,但是,当我想编写一个我使用这些命令查询的子图时:
gremlin> subGraph = g.V(45240).repeat(__.bothE().subgraph('subGraph').bothV()).times(4).cap('subGraph').next()
Run Code Online (Sandbox Code Playgroud)
我使用相同的写命令:
gremlin> subGraph.io(IoCore.graphson()).writeGraph("45240_sub4.json")
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
(是java.lang.IllegalStateException)(通过引用链:org.janusgraph.graphdb.relations.RelationIdentifier ["inVertexId"])
搜索周围,我发现另一个线程说我需要导入一个包以便正确地执行此操作(对于TitanGraph,但我认为它也适用于JanusGraph):在gremlin中导入包
但是,每当我尝试导入时:
gremlin> import com.thinkaurelius.titan.graphdb.tinkerpop.io.graphson.TitanGraphSONModule
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
导入定义无效:'com.thinkaurelius.titan.graphdb.tinkerpop.io.graphson.TitanGraphSONModule'; 原因:启动失败:script1494618250861805544050.groovy:1:无法解析类com.thinkaurelius.titan.graphdb.tinkerpop.io.graphson.TitanGraphSONModule @ line 1,第1列.import com.thinkaurelius.titan.graphdb.tinkerpop.io. graphson.TitanGraphSONModule ^
1错误
如何使用JanusGraph在Gremlin shell中将子图输出为GraphSON?