What is the difference between the Schema.org properties isPartOf
and hasPart
and when to use the one instead of the other?
相关问题
- Microdata/Schema.org/SEO: How to properly set a Co
- schema.org BusinessFunction - GoodRelations
- When to use the subclass in RDFS?
- How do I use Schema.org to identify filters on our
- Schema.org opening hours with lunch break
相关文章
- Schema.org for closed on a holiday / given date
- Multiple contexts in JSON-LD
- Right way to set microdata for Q&A HTML
- How to mark data using schema.org and JSON-LD on a
- Can I use multiple itemtypes in one itemscope for
- Validation error: “The itemprop attribute was spec
- Duplicate JSON-LD scripts in head
- Schema.org for acronym / abbreviation (in a glossa
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. This is because you can use every property for both directions, with the help of the syntax:authorOf
RDFa:
rev
(example)
Microdata:
itemprop-reverse
(non-standard, which is one of the reasons to prefer RDFa over Microdata)(example)
JSON-LD:
@reverse
(example)