将美化的 json/graphson 导入 JanusGraph 是否有其他人有此问题?
完全相同但未美化的文件(无回车、制表符、空格)将完美导入,但如果美化它会失败并出现以下错误:
graph.io(graphson()).readGraph("data/tgraph2.json")
Could not deserialize the JSON value as required. Nested exception: java.lang.InstantiationException: Cannot deserialize the value with the detected type contained in the JSON ('tinker:graph') to the type specified in parameter to the object mapper (class java.util.LinkedHashMap). Those types are incompatible. at [Source: (ByteArrayInputStream); line: 1, column: 3]
请注意,编辑文件以手动删除第一个换行符并将错误消息更改为... at [Source: (ByteArrayInputStream); line: 1, column: 12]
etc - 所以这绝对是文件中的空格问题。
版本 3.x
当然,这不是理想的行为。无论是用空格美化还是缩小,json 都应该同样有效。