Gremlin 使用GraphJson导出和导入Janus图形
我正在使用Gremlin I/O库(GraphSONMapper+GraphSONWriter)将已经存在的Janus图形导出到GraphJsonGremlin 使用GraphJson导出和导入Janus图形,gremlin,tinkerpop,janusgraph,janus,Gremlin,Tinkerpop,Janusgraph,Janus,我正在使用Gremlin I/O库(GraphSONMapper+GraphSONWriter)将已经存在的Janus图形导出到GraphJson The json file content after export is (export.json) { "id": { "@type": "g:Int64", "@value": 2289864 }, "label": "user", "outE": { "user_group": [ {
The json file content after export is (export.json)
{
"id": {
"@type": "g:Int64",
"@value": 2289864
},
"label": "user",
"outE": {
"user_group": [
{
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "5po9l-1d2vc-1ij9-9mw"
}
},
"inV": {
"@type": "g:Int64",
"@value": 12488
},
"properties": {
"access_type": "E"
}
}
]
},
"properties": {
"username": [
{
"id": {
"@type": "janusgraph:RelationIdentifier",
"@value": {
"relationId": "5pnvd-1d2vc-2txh"
}
},
"value": "tester"
}
]
}
}
我想直接将这个json数据导入到一个新的图形中。我尝试使用下面的命令导入,但在反序列化过程中遇到下面的错误
graph = TinkerGraph.open();
graph.io(graphson()).readGraph('/tmp/export.json');
Exception : org.apache.tinkerpop.shaded.jackson.databind.JsonMappingException: Could not deserialize the JSON value as required. Nested exception:org.apache.tinkerpop.shaded.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.lang.String` out of START_OBJECT token
at [Source: (ByteArrayInputStream); line: 1, column: 137]
at [Source: (ByteArrayInputStream); line: 1, column: 137] (through reference chain: java.util.LinkedHashMap["outE"]>java.util.LinkedHashMap["user_group"]>java.util.ArrayList[0]>java.util.LinkedHashMap["id"])
有人能帮我把上面的图导入一个新的Janus图吗
顶点和边的集合?你有没有找到它?