【问题标题】:JSON-LD frame for mixed type definitions: @type and rdf:type in the same graph混合类型定义的 JSON-LD 框架:@type 和 rdf:type 在同一个图中
【发布时间】:2016-01-15 09:16:02
【问题描述】:

有时使用 sparql 构建图形会创建具有混合类型定义而不是 @type 的 JSON-LD 文档(rdf:type 和 @type 在同一个图形中)。在 JSON-LD Playground 中查看 gist

具有混合类型定义的示例图:

{
  "@context": {
    "label": "http://www.w3.org/2000/01/rdf-schema#label",
    "ex": "http://example.org/ex#",
    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
    "rdfs": "http://www.w3.org/2000/01/rdf-schema#"
  },
  "@graph": [
    {
      "@id": "ex:Test1",
      "rdf:type": "ex:ExampleClass",
      "label": "Test 1"
    },
    {
      "@id": "ex:Test2",
      "@type": "ex:AnotherExampleClass",
      "label": "Test 2"
    }
  ] 
}

有没有办法使用框架来转换所有实例以使用@type 而不是 rdf:type?

【问题讨论】:

  • 这个问题与错误的标识符有关。一些标识符是字符串而不是东西。

标签: json-ld


【解决方案1】:

当您有像 rdf:type 这样的错误数据指向字符串时,就会发生这种情况。没有找到用框架解决此问题的方法,但修复数据有效。

【讨论】:

    猜你喜欢
    • 2019-11-15
    • 1970-01-01
    • 2018-11-13
    • 2017-05-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多