The difference between isPartOf and hasPart in Schema.org?

被刻印的时光 ゝ 提交于 2019-12-17 17:12:43

问题


What is the difference between the Schema.org properties isPartOf and hasPart and when to use the one instead of the other?


回答1:


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.)

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)

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

  • JSON-LD:
    @reverse
    (example)



来源:https://stackoverflow.com/questions/41494848/the-difference-between-ispartof-and-haspart-in-schema-org

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!