简体   繁体   English

JSON文件格式的Faunus JSON阅读器错误

[英]Faunus json reader error in json file format

I'm using a json file to load nodes and edges to faunus gremlin but it gives me error like this... 我正在使用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)

I have this format for the json file (actual file)... 我有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"
        } 
         ]  
          }

Here's look at what I did at gremlin: http://i.imgur.com/wzzOmw9.png 这是我在gremlin所做的事情: http : //i.imgur.com/wzzOmw9.png

Basically just ran gV after loading faunus.properties 基本上在加载faunus.properties之后才运行gV

Is the format correct or should do something else to resolve the error. 格式是否正确,还是应该采取其他措施解决错误。 Can't understand where the problem is creeping from. 无法理解问题的根源。

Thanks in advance 提前致谢

Your example shows a format that is not a valid JSON format readable by Faunus (aka titan-hadoop). 您的示例显示的格式不是Faunus(aka titan-hadoop)可读的有效JSON格式。 That example shows an edge list format produced from the Blueprints GraphSON writer. 该示例显示了由Blueprints GraphSON编写器生成的边缘列表格式。 Faunus requires an adjacency list format as shown in the documentation (correctly mentioned in the comment by Konstantin on the original question): Faunus需要一个邻接列表格式,如文档中所示(康斯坦丁在原始问题的评论中正确提及):

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

The adjacency list allows such a file to be split among hadoop nodes when Faunus goes to read it. 当Faunus进行读取时,邻接列表允许将此类文件拆分到hadoop节点之间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM