6

我在我的网站上使用微数据,特别是 LocalBusiness 模式。我也在读这个:schema.org:同一天的多个营业时间

但我想要定义每天的营业时间,因为它们可能会有很大差异。

我目前在其他示例中看到的是:

<time itemprop="openingHours" datetime="Tu-Fr 10:00-14:00">XYZ</time>

我也可以使用这些选项中的任何一个吗?

<time itemprop="openingHours" datetime="Tu 10:00-14:00">XYZ</time>
<time itemprop="openingHours" datetime="Fr 11:00-14:00">XYZ</time>

或这个

<meta itemprop="openingHours" content="Tu 10:00-14:00">XYZ
<meta itemprop="openingHours" content="FR 11:00-14:00">XYZ

不仅如此,在某些日子里,企业可能只能通过预约开放。如何指定?我假设当我在 <time> 规范中离开一天时,它将被解释为已关闭,但我不知道预约。

** 更新 **

我现在有这个:

<div itemprop="openingHoursSpecification" itemscope="" itemtype="http://schema.org/OpeningHoursSpecification">
<link itemprop="dayOfWeek" href="http://purl.org/goodrelations/v1#Monday">
<time datetime="07:00">07:00</time> - <time datetime="01:00">01:00</time>
</div>

使用 Google 丰富的代码片段工具,我现在看到了

项目类型: http: //schema.org/localbusiness
属性:
名称: Syana
描述:
地址:项目 1
开放时间规范:项目 2
开放时间规范:项目 3

项目 2
类型: http: //schema.org/openinghoursspecification
属性:
dayofweek: http ://purl.org/goodrelations/v1#Monday

我在富网页摘要工具中看到了日期,但没有看到时间……为什么?

4

1 回答 1

9

LocalBusiness示例已更新,并显示了几天内多次的示例。

<div itemscope itemtype="http://schema.org/Restaurant">
  <span itemprop="name">GreatFood</span>
  ...
  Hours:
  <meta itemprop="openingHours" content="Mo-Sa 11:00-14:30">Mon-Sat 11am - 2:30pm
  <meta itemprop="openingHours" content="Mo-Th 17:00-21:30">Mon-Thu 5pm - 9:30pm
  <meta itemprop="openingHours" content="Fr-Sa 17:00-22:00">Fri-Sat 5pm - 10:00pm
</div>

更多来自的描述openingHours

营业时间。营业时间可以指定为每周的时间范围,从天开始,然后是每天的时间。可以用逗号“,”列出多天,分隔每一天。使用连字符“-”指定日期或时间范围。

  • 使用以下两个字母组合指定天数:Mo、Tu、We、Th、Fr、Sa、Su。
  • 使用 24:00 时间指定时间。例如,下午 3 点指定为 15:00。
  • 这是一个例子:周二和周四下午 4 点到 8 点。
  • 如果企业每周营业 7 天,则可以将其指定为周一至周日,全天。

尽管openingHours描述使用了带有 datetime 属性的 time 元素,但每周时间范围不是一个有效值,因此使用 meta 元素可能更可取。

此外,所有从Place派生的 Item-Types也有一个openingHoursSpecification属性。它比openingHours财产要啰嗦得多。这个手杖有点像这样使用:

<div itemscope itemtype="http://schema.org/Restaurant">
  <span itemprop="name">GreatFood</span>
  ...
  Hours:
  <div itemprop="openingHoursSpecification" itemscope
       itemtype="http://schema.org/OpeningHoursSpecification">
    <meta itemprop="description" content="Lunch Hours">
    <link itemprop="dayOfWeek" href="http://purl.org/goodrelations/v1#Monday">
    <link itemprop="dayOfWeek" href="http://purl.org/goodrelations/v1#Tuesday">
    <link itemprop="dayOfWeek" href="http://purl.org/goodrelations/v1#Wednesday">
    <link itemprop="dayOfWeek" href="http://purl.org/goodrelations/v1#Thursday">
    <link itemprop="dayOfWeek" href="http://purl.org/goodrelations/v1#Friday">
    <link itemprop="dayOfWeek" href="http://purl.org/goodrelations/v1#Saturday">

    Mon-Sat
    <time itemprop="opens" datetime="11:00">11am</time> -
    <time itemprop="closes" datetime="14:30">2:30pm</time>
  </div>
  <div itemprop="openingHoursSpecification" itemscope
       itemtype="http://schema.org/OpeningHoursSpecification">
    <meta itemprop="description" content="Supper Hours">
    <link itemprop="dayOfWeek" href="http://purl.org/goodrelations/v1#Monday">
    <link itemprop="dayOfWeek" href="http://purl.org/goodrelations/v1#Tuesday">
    <link itemprop="dayOfWeek" href="http://purl.org/goodrelations/v1#Wednesday">
    <link itemprop="dayOfWeek" href="http://purl.org/goodrelations/v1#Thursday">

    Mon-Thu
    <time itemprop="opens" datetime="17:00">5pm</time> -
    <time itemprop="closes" datetime="21:30">9:30pm</time>
  </div>
  <div itemprop="openingHoursSpecification" itemscope
       itemtype="http://schema.org/OpeningHoursSpecification">
    <meta itemprop="description" content="Weekend Supper Hours">
    <link itemprop="dayOfWeek" href="http://purl.org/goodrelations/v1#Friday">
    <link itemprop="dayOfWeek" href="http://purl.org/goodrelations/v1#Saturday">

    Fri-Sat
    <time itemprop="opens" datetime="17:00">5pm</time> -
    <time itemprop="closes" datetime="22:00">10:00pm</time>
  </div>
</div>
于 2013-06-17T20:45:28.177 回答