Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
420 views
in Technique[技术] by (71.8m points)

structured data - The difference between isPartOf and hasPart in Schema.org?

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...