【发布时间】: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