0

假设您有一个简单的 RDF 语句x:Object x:predicate x:Subject,它在 JSON-LD 中表示为{"@id": "x:Object", "x:predicate": {"@id": "x:Subject"}}. 你如何指代具体的宾-谓-主关系,如何“处理”事实关系?"@id"JSON-LD 中语句的内联标识是什么?您如何将“元数据”归因于陈述?

您如何在 JSON-LD 中表达语句,其中主题是另一个语句,例如[x:Subject x:predicate x:Object] x:metaPredicate x:MetaObject

您如何在 JSON-LD 中表达语句,其中对象是另一个语句,例如x:MetaSubject x:metaPredicate [x:Subject x:predicate x:Object]

您如何在 JSON-LD 中表达语句,其中谓词是另一个语句(奇怪但可能),例如x:MetaSubject [x:Subject x:predicate x:Object] x:MetaObject

(PS: I realize the [] syntax of my samples is not conformant Turtle, but they serve to express my thoughts/questions.)

4

1 回答 1

2

您需要使用具体化,为此存在标准化的词汇表。在 JSON-LD 中,它看起来有点像这样:

{
  "@context": {
    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
    "subject": { "@id": "rdf:subject", "@type": "@id" },
    "predicate": { "@id": "rdf:predicate", "@type": "@id" },
    "object": { "@id": "rdf:object", "@type": "@id" }
  },
  "@type": "rdf:Statement",
  "subject": "x:Subject",
  "predicate": "x:predicate",
  "object": { "@id": "x:Object" },
  "x:metaPredicate": "x:MetaObject"
}
于 2015-11-25T20:37:51.530 回答