gpt4 book ai didi

microdata - 每天使用 schema.org 的不同(类型)开放时间

转载 作者:行者123 更新时间:2023-12-04 17:50:46 24 4
gpt4 key购买 nike

我在我的网站上使用微数据,特别是 LocalBusiness 架构。
我也在读这个:schema.org: Multiple opening hours on same day

但我想要的是每天定义开放时间是什么,因为它们可能会有很大差异。

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

<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

不仅如此,在某些日子里,一家企业可能只能通过预约才能营业。
如何指定?我假设当我在我的

最佳答案

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 的描述:

The opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas ',' separating each day. Day or time ranges are specified using a hyphen '-'.

  • Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su.
  • Times are specified using 24:00 time. For example, 3pm is specified as 15:00.
  • Here is an example: Tuesdays and Thursdays 4-8pm.
  • If a business is open 7 days a week, then it can be specified as Monday through Sunday, all day.


虽然 openingHours description 使用具有 datetime 属性的 time 元素,每周时间范围不是有效值,因此使用 meta 元素可能更可取。

此外,所有派生自 Place 的 Item-Types还有一个 openingHoursSpecification 属性(property)。它比 openingHours 更罗嗦属性(property)。这根手杖有点像这样使用:
<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>

关于microdata - 每天使用 schema.org 的不同(类型)开放时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17058982/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com