0

我正在使用 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

基本上只是在加载 faunus.properties 后运行 gV

格式是否正确或应该采取其他措施来解决错误。无法理解问题从何而来。

提前致谢

4

1 回答 1

1

您的示例显示的格式不是 Faunus 可读的有效 JSON 格式(又名 titan-hadoop)。该示例显示了从 Blueprints GraphSON 编写器生成的边缘列表格式。Faunus 需要文档中显示的邻接列表格式(康斯坦丁在原始问题的评论中正确提及):

http://s3.thinkaurelius.com/docs/titan/0.5.4/graphson-io-format.html

当 Faunus 去读取这样的文件时,邻接表允许在 hadoop 节点之间拆分。

于 2015-06-15T16:01:38.023 回答