一个 RDF 语句可以有多个主题吗?

Can a RDF statement have more than one subject?

如果你对这个问题的回答是肯定的,你能给我一个使用 JSON-LD 格式的例子吗?

答案是

来自RDF 1.1 Concepts and Abstract Syntax

1.2 Resources and Statements

Asserting an RDF triple says that some relationship, indicated by the predicate, holds between the resources denoted by the subject and object. This statement corresponding to an RDF triple is known as an RDF statement. The predicate itself is an IRI and denotes a property, that is, a resource that can be thought of as a binary relation. (Relations that involve more than two entities can only be indirectly expressed in RDF.)


如果您只是在寻找具有常用术语的多个语句的语法糖。 —

在 Turtle 中,有 predicate lists and object lists, however, there are no subject lists
另见这个问题: .

更新

在JSON-LD 1.1 中,您可以使用@reverse 关键字,即。 e.写点像

{
  "@id": "#homer",
  "http://example.com/vocab#name": "Homer",
  "@reverse": {
    "http://example.com/vocab#parent": [
      {
        "@id": "#bart",
        "http://example.com/vocab#name": "Bart"
      }, {
        "@id": "#lisa",
        "http://example.com/vocab#name": "Lisa"
      }
    ]
  }
}

而不是

[
  {
    "@id": "#homer",
    "http://example.com/vocab#name": "Homer"
  }, {
    "@id": "#bart",
    "http://example.com/vocab#name": "Bart",
    "http://example.com/vocab#parent": { "@id": "#homer" }
  }, {
    "@id": "#lisa",
    "http://example.com/vocab#name": "Lisa",
    "http://example.com/vocab#parent": { "@id": "#homer" }
  }
]

实际上,答案可能需要一些澄清。在 RDF 规范定义的 "subject" 意义上,一个 RDF 语句不能有多个主题,因为它没有任何主题。

当一个人想谈论 "RDF triple" 时谈论 "RDF statement" 是很常见的。 RDF 三元组 是一种句法构造,它是三个元素的序列,按顺序称为 subjectpredicate,以及 对象。每个 RDF 三元组只有一个主题。在 RDF 规范的意义上,subject 是 IRI 或空白节点。但是,RDF 语句 不是 RDF 三元组。这是一个 RDF 三元组正在表达的事实。例如,如果我说地球绕着太阳转,我就是在发表声明。地球不是 RDF 规范意义上的主题,因为它不是 IRI(遵循 RFC 规范的字符序列)或空白节点(存在变量)。这是一个由东西组成的星球,none 当然是 UNICODE 字符。但是,我可以编写一个 RDF 三元组来表达语句:

dbr:Earth  onto:revolvesAround  dbr:Sun .

dbr: 是 DBpedia 资源的前缀 https://dbpedia.org/resource/。 这表达了 RDF 语句,根据该语句,某物(由 dbr:Earth 表示)根据 onto:revolvesAround 表示的关系与另一事物(由 dbr:Sun 表示)相关。但是这个陈述同样可以用下面的三元组来表达:

wd:Q2  onto:revolvesAround  wd:Q525 .

wd: 是维基数据的前缀 https://www.wikidata.org/wiki/。语句相同(考虑到 DBpedia 中声明 dbr:Earth owl:sameAs wd:Q2dbr:Sun owl:sameAs wd:525)但三元组不同。特别是,主题不同。因此,在某种意义上,您可能会争辩说同一个 RDF 语句可以有多个主题。无论您是在 JSON-LD 中还是在其他任何地方表示它都没有关系。