1

假设我有以下 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

4

1 回答 1

2

我不确定您是否真的想为整个三元组分配“类型”,但是当您要求它并提及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"
      }
    ]
  }
]
于 2015-06-05T12:04:30.680 回答