RDFa OfferCatalog Syntax

荒凉一梦 提交于 2019-12-02 04:22:39

To link items together, you need a suitable property. Like author (to state which Person is the creator of the SoftwareApplication), or like hasOfferCatalog (to state which SoftwareApplication is offered by the Person).

Inverse properties

In most cases, Schema.org defines its properties only for one direction. So there is only author, and no authorOf. If you need the property for the other direction, you can use RDFa’s rev attribute.

Linking instead of repeating

If you don’t want to repeat your data (i.e., only define it once and link/refer to this definition instead), you can provide a URL value. Schema.org allows this for all properties, even if URL is not listed as expected type. If you want to follow Semantic Web best practices, give your entities URLs (as identifiers) with RDFa’s resource attribute, and use these URLs as property values to refer to the entities.

For this, simply use one of the linking elements (e.g., elements with href or src attribute).

Example

Using the author case as example:

<!-- on the page about the software: /software/5 -->

<div typeof="schema:SoftwareApplication" resource="/software/5#this">
  Author: 
  <a property="schema:author" typeof="schema:Person" href="/persons/alice#i">Alice</a>
</div>
<!-- on the page about the person: /persons/alice -->

<div typeof="schema:Person" resource="/persons/alice#i">
  Authored by:
  <a rev="schema:author" typeof="schema:SoftwareApplication" href="/software/5#this">Software 5</a>
</div>

Errors in Google’s SDTT

If the Structured Data Testing Tool gives errors about missing properties, note that it doesn’t mean that something is wrong with your markup. Schema.org never requires a property.

It just means that these properties are required for getting a certain Google search feature. So ignore these errors if you don’t want to get the feature (or if you can’t provide all required properties).

Thank you for the other response, I'll have a read over the linked resources, I have also found a solution to the specific case in my question.

Google Search Console has a page on Carousels which shows that you can use ListItem, which only "needs" URL, to populate the hasOfferCatalog property. E.g.

<span property="itemListElement" typeof="ListItem">
  <meta property="position" content="1" />
  <meta property="url" content="https://www.my-domain.tld/ProjectName/" />
</span>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!