在 JSON-LD 中具体化三元组
Reify triples in JSON-LD
假设我有以下 JSON 文档:
{
"@id":"http://www.example.com/id/linkFrom",
"http://www.example.com/link":{
"@id":"http://www.example.com/id/linkTo",
"linkType":{
"@id": "http://www.example.com/vocab#specialLink"
}
}
}
如何表示三元组 <http://www.example.com/id/linkFrom> <http://www.example.com/link> <http://www.example.com/id/linkTo>
的类型为 http://www.example.com/vocab#specialLink
?
我不确定你是否真的想将 "a type" 分配给整个三元组,但是当你要求它并提到 Reification 时,你可以这样做:
[
{
"@id": "http://www.example.com/id/linkFrom",
"http://www.example.com/link": [
{
"@id": "http://www.example.com/id/linkTo"
}
]
},
{
"@id": "http://www.example.com/reifi/1",
"@type": [
"http://www.example.com/vocab#specialLink",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement"
],
"http://www.w3.org/1999/02/22-rdf-syntax-ns#subject": [
{
"@id": "http://www.example.com/id/linkFrom"
}
],
"http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate": [
{
"@id": "http://www.example.com/link"
}
],
"http://www.w3.org/1999/02/22-rdf-syntax-ns#object": [
{
"@id": "http://www.example.com/id/linkTo"
}
]
}
]
假设我有以下 JSON 文档:
{
"@id":"http://www.example.com/id/linkFrom",
"http://www.example.com/link":{
"@id":"http://www.example.com/id/linkTo",
"linkType":{
"@id": "http://www.example.com/vocab#specialLink"
}
}
}
如何表示三元组 <http://www.example.com/id/linkFrom> <http://www.example.com/link> <http://www.example.com/id/linkTo>
的类型为 http://www.example.com/vocab#specialLink
?
我不确定你是否真的想将 "a type" 分配给整个三元组,但是当你要求它并提到 Reification 时,你可以这样做:
[
{
"@id": "http://www.example.com/id/linkFrom",
"http://www.example.com/link": [
{
"@id": "http://www.example.com/id/linkTo"
}
]
},
{
"@id": "http://www.example.com/reifi/1",
"@type": [
"http://www.example.com/vocab#specialLink",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement"
],
"http://www.w3.org/1999/02/22-rdf-syntax-ns#subject": [
{
"@id": "http://www.example.com/id/linkFrom"
}
],
"http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate": [
{
"@id": "http://www.example.com/link"
}
],
"http://www.w3.org/1999/02/22-rdf-syntax-ns#object": [
{
"@id": "http://www.example.com/id/linkTo"
}
]
}
]