V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Apol1oBelvedere
V2EX  ›  问与答

Google Cloud Platform 的 BigQuery 上传 JSON-LD 格式数据始终解析报错,有无办法修复或线下验证工具?

  •  
  •   Apol1oBelvedere · 1 天前 · 291 次点击

    Google Cloud Platform 的 BigQuery 上传 JSON-LD 格式数据始终解析报错,已经注意了如下语法要点:

    1. 每行一个对象:每个完整的 JSON 对象必须占据一行。在 Notepad++中显示行尾符号能看到[CR][LF]格式字符。
    2. 严禁外层中括号:整个文件不能包裹在 [...] 中。
    3. 严禁行尾逗号:每行末尾的对象后面不能有逗号 ,。
    4. 禁止跨行:一个 JSON 对象内部不能有换行符。所有的键值对必须挤在同一行内。
    5. 字符编码:必须是 不带 BOM 的 UTF-8 编码。也用 Emeditor 重新转过。

    也尝试编写 Python 脚本验证,能通过。但是导入 BigQuery 还是报错如下:

    未能创建表:Error while reading data, error message: Failed to parse JSON: Unknown token type; Unexpected token; Parser terminated before end of string File: a.json
    
    未能创建表:Error while reading data, error message: Failed to parse JSON: Parser terminated before end of string File: b.json
    

    请问有无办法修复或线下 JSON-LD 格式验证工具?

    目前尚无回复
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   1108 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 17:55 · PVG 01:55 · LAX 09:55 · JFK 12:55
    ♥ Do have faith in what you're doing.