Faunus json reader json 文件格式错误
Faunus json reader error in json file format
我正在使用 json 文件将节点和边加载到 faunus gremlin,但它给我这样的错误...
java.io.IOException: A JSONObject text must end with '}' at character 1 of {
at com.thinkaurelius.faunus.formats.graphson.FaunusGraphSONUtility.fromJSON(FaunusGraphSONUtility.java:76)
at com.thinkaurelius.faunus.formats.graphson.GraphSONRecordReader.nextKeyValue(GraphSONRecordReader.java:41)
我有 json 文件(实际文件)的这种格式...
{
"mode": "NORMAL",
"vertices": [
{
"_id": "5",
"PostId": "5",
"Vtype": "Post",
"_type": "vertex"
},
{
"_id": "definitions",
"_type": "vertex",
"Count": "9",
"TagId": "definitions"
}
]
}
{
"mode": "NORMAL",
"edges": [
{
"_outV": "definitions",
"_type": "edge",
"_id": 0,
"_inV": "5",
"_label": "totalAuthorIs"
}
]
}
看看我在 gremlin 上做了什么:
http://i.imgur.com/wzzOmw9.png
加载后基本上就运行g.Vfaunus.properties
格式是否正确或应该采取其他措施来解决错误。无法理解问题从何而来。
提前致谢
您的示例显示的格式不是 Faunus(又名 titan-hadoop)可读的有效 JSON 格式。该示例显示了从 Blueprints GraphSON writer 生成的边缘列表格式。 Faunus 需要邻接表格式,如文档中所示(在 Konstantin 对原始问题的评论中正确提及):
http://s3.thinkaurelius.com/docs/titan/0.5.4/graphson-io-format.html
邻接表允许这样的文件在 Faunus 去读取它时在 hadoop 节点之间拆分。
我正在使用 json 文件将节点和边加载到 faunus gremlin,但它给我这样的错误...
java.io.IOException: A JSONObject text must end with '}' at character 1 of {
at com.thinkaurelius.faunus.formats.graphson.FaunusGraphSONUtility.fromJSON(FaunusGraphSONUtility.java:76)
at com.thinkaurelius.faunus.formats.graphson.GraphSONRecordReader.nextKeyValue(GraphSONRecordReader.java:41)
我有 json 文件(实际文件)的这种格式...
{
"mode": "NORMAL",
"vertices": [
{
"_id": "5",
"PostId": "5",
"Vtype": "Post",
"_type": "vertex"
},
{
"_id": "definitions",
"_type": "vertex",
"Count": "9",
"TagId": "definitions"
}
]
}
{
"mode": "NORMAL",
"edges": [
{
"_outV": "definitions",
"_type": "edge",
"_id": 0,
"_inV": "5",
"_label": "totalAuthorIs"
}
]
}
看看我在 gremlin 上做了什么: http://i.imgur.com/wzzOmw9.png
加载后基本上就运行g.Vfaunus.properties
格式是否正确或应该采取其他措施来解决错误。无法理解问题从何而来。
提前致谢
您的示例显示的格式不是 Faunus(又名 titan-hadoop)可读的有效 JSON 格式。该示例显示了从 Blueprints GraphSON writer 生成的边缘列表格式。 Faunus 需要邻接表格式,如文档中所示(在 Konstantin 对原始问题的评论中正确提及):
http://s3.thinkaurelius.com/docs/titan/0.5.4/graphson-io-format.html
邻接表允许这样的文件在 Faunus 去读取它时在 hadoop 节点之间拆分。