Schema.org LocalBusiness 营业时间和银行 holidays/public 假期

Schema.org LocalBusiness openingHours and bank holidays/public holidays

我想知道在使用 Schema.org's openingHours 时如何处理银行假期(在英国)和圣诞节假期。

英国有几个日期很多企业都关门了,所以这些日期需要排除,它们每年也会略有变化:https://www.gov.uk/bank-holidays

openingHours 属性 不允许排除特定日期。

With specialOpeningHoursSpecification you can override the general opening hours that were specified with openingHours or openingHoursSpecification(比 openingHours 更具表现力的替代方法)。

属性 specialOpeningHoursSpecificationopeningHoursSpecification 取值 OpeningHoursSpecification

OpeningHoursSpecification中,您可以使用dayOfWeek property to specify the day it’s about. It expects a DayOfWeek value (which is an enumeration). It contains a value for each day in the week (Monday, Tuesday, etc.), but also the "special" value PublicHolidays:

This stands for any day that is a public holiday; it is a placeholder for all official public holidays in some particular location.

因此,如果您想声明您在(您所在位置的)public 节假日休息,您可以使用如下内容:

<div itemprop="specialOpeningHoursSpecification" itemscope itemtype="http://schema.org/OpeningHoursSpecification">
  <link itemprop="dayOfWeek" href="http://schema.org/PublicHolidays" />
  <p itemprop="description">‎Closed on public holidays.</p>
</div>

(表示关闭,因为opens 属性没有提供。)

实际上,已经建立的 http://schema.org/openingHoursSpecification 允许通过附加的 OpeningHoursSpecification 的 validFrom 和 validThrough 属性排除特定日期。

有关示例,请参阅 http://ebusiness-unibw.org/pipermail/goodrelations/2010-October/000261.html。请注意,该示例是在原始 GoodRelations 词汇表(现已集成到 schema.org 中)的上下文中,因此存在一些命名差异,描述如下:

http://wiki.goodrelations-vocabulary.org/Cookbook/Schema.org#Naming_Differences