首页 > 解决方案 > 微数据:为什么 Google 要求在场地举办活动?

问题描述

我有以下微数据 HTML 代码:

<div itemscope itemtype="http://schema.org/PerformingArtsTheater">
    <h2  itemprop="name">The Old Vic</h2>
    <div itemscope itemtype="http://schema.org/TheaterEvent" itemprop="http://schema.org/event">
        <h3 itemprop="name">Endgame</h3>
       <div itemprop="startDate">2020-01-27</div>
  </div>
</div>

即:一个PerformingArtsTheater叫做“The Old Vic”的事件有一个事件,TheaterEvent叫做“Endgame”。

当一个事件发生在 aPerformingArtsTheaterPlace,我会认为很明显,它TheaterEvent的位置是同一个“PerformingArtsTheater”?

但是谷歌的结构化数据测试工具发现了一个错误TheaterEvent:“A value for the location field is required.”。

怎么来的?这里的一个location字段充其量不是多余的,最坏的情况是矛盾吗?

(比如“老维克的二月:塞缪尔贝克特在老维克的残局。”)

有没有办法在不引入冗余的情况下取悦 Gogle?

标签: schema.orgmicrodata

解决方案


Thing > Event > TheaterEvent

TheaterEvent(剧院表演。) -location属性预期类型 place具体的对象,如PerformingArtsTheater

Thing > Place > CivicStructure > PerformingArtsTheater

在您的情况下,PerformingArtsTheater 是The Old Vic- 正确的数据结构大纲:

位置(事件片段的必需属性)

https://developers.google.com/search/docs/data-types/event

<div itemprop="location" itemscope="" itemtype="http://schema.org/PerformingArtsTheater">
  <span itemprop="name">Theater name</span>
  <meta itemprop="address" content="London, UK"/>
</div>

在此处输入图像描述

将位置作为 PerformingArtsTheater 属性(嵌套对象)

<section itemscope="" itemtype="http://schema.org/TheaterEvent">
  <h2  itemprop="name">Event Name</h2>
  <div itemprop="startDate">2020-01-27</div>
  <address itemprop="location" itemscope="" itemtype="http://schema.org/PerformingArtsTheater">
    <p itemprop="name" content="Theater name">Theater name</p>
    <meta itemprop="address" content="Bennelong Point, Sydney NSW 2000, Australia"/>
  </address>
</section>

结果 ==> 没有错误:

在此处输入图像描述

谷歌片段预览(添加图片、描述等) 在此处输入图像描述

顺便说一句,这是嵌套 schema.org 对象的一个​​很好的例子。


推荐阅读