Schema.org中isPartOf和hasPart之间的区别? [英] The difference between isPartOf and hasPart in Schema.org?

查看:209
本文介绍了Schema.org中isPartOf和hasPart之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Schema.org属性isPartOfhasPart之间的区别是什么?何时使用一个属性而不是另一个属性?

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 authorOf. This is because you can use every property for both directions, with the help of the syntax:

  • RDFa:
    rev
    (example)

微数据:
itemprop-reverse > (非标准,这是使RDFa优于微数据的原因之一)
(示例)

Microdata:
itemprop-reverse (non-standard, which is one of the reasons to prefer RDFa over Microdata)
(example)

JSON-LD:
@reverse
(示例)

JSON-LD:
@reverse
(example)

这篇关于Schema.org中isPartOf和hasPart之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆