我试图用JanusGraph在Gremlin
shell中输出一个子图作为GraphSON.
当我编写完整的图形时,这工作正常,但是,当我想编写一个我使用这些命令查询的子图时:
gremlin> subGraph = g.V(45240).repeat(__.bothE().subgraph('subGraph').bothV()).times(4).cap('subGraph').next()
我使用相同的写命令:
gremlin> subGraph.io(IoCore.graphson()).writeGraph("45240_sub4.json")
我收到此错误:
(was java.lang.IllegalStateException) (through reference chain: org.janusgraph.graphdb.relations.RelationIdentifier[“inVertexId”])
搜索周围,我发现另一个线程说我需要导入一个包以便正确地执行此操作(对于TitanGraph,但我认为它也适用于JanusGraph):Import package in gremlin
但是,每当我尝试导入时:
gremlin> import com.thinkaurelius.titan.graphdb.tinkerpop.io.graphson.TitanGraphSONModule
我收到此错误:
Invalid import definition: ‘com.thinkaurelius.titan.graphdb.tinkerpop.io.graphson.TitanGraphSONModule’; reason: startup failed:
script1494618250861805544050.groovy: 1: unable to resolve class com.thinkaurelius.titan.graphdb.tinkerpop.io.graphson.TitanGraphSONModule
@ line 1, column 1.
import com.thinkaurelius.titan.graphdb.tinkerpop.io.graphson.TitanGraphSONModule
^
1 error
如何使用JanusGraph在Gremlin shell中将子图输出为GraphSON?