Schema.org中isPartOf和hasPart之间的区别? [英] The difference between isPartOf and hasPart in Schema.org?
问题描述
Schema.org属性isPartOf
和hasPart
之间的区别是什么?何时使用一个属性而不是另一个属性?
What is the difference between the Schema.org properties isPartOf
and hasPart
and when to use the one instead of the other?
推荐答案
如其页面上所述,它们是逆属性.
As noted on their pages, they are inverse properties.
以一个示例为例,假设一个网站是网站的一部分.然后,您可以声明以下其中一项:
As an example, let’s take a webpage that is part of a website. You could then state one of these:
-
WebSite
hasPart
WebPage
WebPage
isPartOf
WebSite
选择哪一个都没关系. (但是当然,可能有些消费者只认识其中一种属性.)
It doesn’t matter which one you choose. (But there might of course be consumers that only recognize one of these properties.)
注意:大多数情况下,Schema.org并未为属性定义反向等效项.例如,有 author
,但没有 .这是因为在语法的帮助下,您可以将两个方向的每个属性都使用:authorOf
Note: Most of the time, Schema.org doesn’t define an inverse equivalent for a property. For example, there is author
, but no . This is because you can use every property for both directions, with the help of the syntax:authorOf
RDFa:
rev
(example)
微数据:
itemprop-reverse
> (非标准,这是
(示例)
Microdata:
itemprop-reverse
(non-standard, which is one of the reasons to prefer RDFa over Microdata)
(example)
JSON-LD:
@reverse
(example)
这篇关于Schema.org中isPartOf和hasPart之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!