【问题标题】:Is there a way to convert JSON-LD to N-Quads format?有没有办法将 JSON-LD 转换为 N-Quads 格式?
【发布时间】:2018-01-16 06:51:50
【问题描述】:

我们需要以 JSON-LD 格式存储数据以维护目录,并将目录中的数据批量提取到支持 RDF 数据格式的图形数据库中。为此,我们一直在研究 Cayley 和 DBgraph,但这些数据库支持 N-Quads 作为其数据格式。

是否有具有 JSON-LD 数据格式的图形数据库,或者有没有办法将 JSON-LD 格式转换为 N-Quads/Turtle 格式?

【问题讨论】:

  • Apache Jena 当然能够解析 JSON-LD,参见 the docs
  • @AKSW 我们正在评估 Cayley 以构建知识图谱。对此有何建议或看法?
  • 请注意,工具推荐在 StackOverflow 上被认为是题外话。也就是说,大多数三元存储/框架/解析工具包应该能够做到这一点。

标签: rdf json-ld format-conversion n-quads


【解决方案1】:

将 JSON-LD 转换为 N-Quads(和返回)是 JSON-LD API 规范中描述的核心算法。任何符合标准的 JSON-LD 处理器都支持这一点。

【讨论】:

    【解决方案2】:

    Pyld 提供了将 jsonld 标准化为其他 RDF 格式的选项。

    # normalize a document using the RDF Dataset Normalization Algorithm
    # (URDNA2015), see: http://json-ld.github.io/normalization/spec/
    normalized = jsonld.normalize(
        doc, {'algorithm': 'URDNA2015', 'format': 'application/nquads'})
    # normalized is a string that is a canonical representation of the document
    # that can be used for hashing, comparison, etc.
    

    以下是链接:

    https://github.com/digitalbazaar/pyld

    【讨论】:

    猜你喜欢
    • 2012-05-03
    • 1970-01-01
    • 1970-01-01
    • 2020-01-10
    • 2022-07-06
    • 1970-01-01
    • 2018-03-15
    • 1970-01-01
    • 2016-07-08
    相关资源
    最近更新 更多