GEO

Schema酒店结构化数据:核心模型与最佳实践

2026/1/26
Schema酒店结构化数据:核心模型与最佳实践
AI Summary (BLUF)

This document explains how to use Schema.org vocabulary to markup hotel and accommodation information on the web, focusing on the three core objects (LodgingBusiness, Accommodation, Offer) and the Multi-Typed Entity (MTE) technique for describing room offers. 本文档详细介绍了如何使用Schema.org词汇表在网页上标记酒店和住宿信息,重点阐述了三个核心对象(住宿业务、住宿单元、报价)以及用于描述房间报价的多类型实体技术。

Using Schema.org for Hotels and Accommodations

  Note: This article references the development version of Schema.org. For details on our development process, please see how we work.

注意:本文参考了 Schema.org 的开发版本。有关我们开发流程的详细信息,请参阅我们的工作方式

  This page provides foundational knowledge and best practices for using Schema.org vocabulary to semantically annotate information about hotels and various other accommodation types. For feature requests or contributions, please use the GitHub repository.

本页提供了使用 Schema.org 词汇表对酒店及各类住宿信息进行语义标注的基础知识和最佳实践。如需功能请求或贡献代码,请使用 GitHub 仓库

  See also: acknowledgements

另请参阅:致谢

概述

Overview

  When modeling hotel-related information for the web using Schema.org, three core entity types form the foundation:

使用 Schema.org 为网络上的酒店相关信息建模时,三个核心实体类型构成了基础:

  • A LodgingBusiness: This represents the establishment itself, such as a hotel, hostel, resort, or campground. It is the local business and physical place that houses the actual rental units (e.g., hotel rooms). A lodging business may span multiple buildings but typically constitutes a coherent location.
    • 一个 住宿业务:这代表住宿场所本身,例如酒店、青年旅社、度假村或露营地。它是容纳实际租赁单元(如酒店房间)的本地企业和物理场所。一个住宿业务可能包含多栋建筑,但通常构成一个连贯的地点。
  • An Accommodation: This refers to the actual rentable units within the establishment, such as hotel rooms, suites, apartments, meeting rooms, or camping pitches. These are the concrete objects offered for rental.
    • 一个 住宿单元:这指的是场所内实际可租赁的单元,例如酒店房间、套房、公寓、会议室或露营位。这些是提供租赁的具体对象。
  • An Offer: This models the commercial proposal to rent an accommodation unit for a specific price and under defined conditions (e.g., occupancy type, advance booking requirements, terms and conditions).
    • 一个 报价:这模拟了以特定价格和规定条件(例如,入住类型、提前预订要求、条款与条件)租赁住宿单元的商业提议。

  In Schema.org, an offer for a hotel room follows the same pattern as an offer for any other product or service. However, an Accommodation is not a subclass of Product or Service. To enable an Offer to be associated with an Accommodation, Schema.org utilizes its Multi-Typed Entity (MTE) feature.

在 Schema.org 中,酒店房间的报价遵循与其他任何产品或服务报价相同的模式。然而,Accommodation 并不是 ProductService 的子类。为了使 Offer 能够与 Accommodation 关联,Schema.org 利用了其**多类型实体(MTE)**功能。

  When defining an instance of an Accommodation offered by a LodgingBusiness, it is described as being both the specific accommodation type (e.g., HotelRoom) and a Product. Consequently, a Hotel makes an Offer for a HotelRoom that is also identified as a Product. Prices and terms are thus properties of the Offer, not of the Hotel or HotelRoom directly.

当定义一个由 LodgingBusiness 提供的 Accommodation 实例时,它被描述为同时是特定的住宿类型(例如 HotelRoom一个 Product。因此,Hotel 为同时被标识为 ProductHotelRoom 创建一个 Offer。价格和条款因此是 Offer 的属性,而不是 HotelHotelRoom 的直接属性。

  The markup for MTEs is straightforward across different syntaxes:

在不同语法中,MTE 的标记方法很简单:

  • Microdata: <div itemscope itemtype="https://schema.org/HotelRoom https://schema.org/Product">
    • Microdata<div itemscope itemtype="https://schema.org/HotelRoom https://schema.org/Product">
  • RDFa: <div vocab="https://schema.org/" typeof="HotelRoom Product">
    • RDFa<div vocab="https://schema.org/" typeof="HotelRoom Product">
  • JSON-LD:
    {
      "@context": "https://schema.org/",
      "@type": ["HotelRoom", "Product"]
    }
    
    • JSON-LD:
    {
      "@context": "https://schema.org/",
      "@type": ["HotelRoom", "Product"]
    }
    

  For rental accommodations, it is crucial to attach the businessFunction property with the value LeaseOut (from the GoodRelations ontology) to the Offer. This clarifies the intent to lease rather than sell the property, allowing reuse of these types for real estate listings.

对于租赁住宿,必须在 Offer 上附加 businessFunction 属性,其值为 LeaseOut(来自 GoodRelations 本体)。这明确了租赁而非出售的意图,并允许将这些类型重用于房地产列表。

基本模型

Basic Model

  The diagram below illustrates the core pattern for describing offers for hotel rooms and other accommodations.

下图展示了描述酒店房间及其他住宿报价的核心模式。

Schema.org pattern for describing hotel room offers

描述酒店房间报价的 Schema.org 模式

  • All Accommodation types are subclasses of Place. To use them as the subject of an Offer, employ the MTE technique (assigning both an Accommodation type and Product).
    • 所有 Accommodation 类型都是 Place 的子类。要将它们用作 Offer 的主体,请使用 MTE 技术(同时分配一个 Accommodation 类型和 Product)。
  • All LodgingBusiness types are subclasses of LocalBusiness, which itself is a subclass of both Place and Organization.
    • 所有 LodgingBusiness 类型都是 LocalBusiness 的子类,而 LocalBusiness 本身又是 PlaceOrganization 的子类。
  • The relationship between an accommodation and its business is represented by:
    • 住宿单元与其业务之间的关系通过以下方式表示:
    • containedInPlace (from room to business) or containsPlace (from business to room).
      • containedInPlace(从房间到业务)或 containsPlace(从业务到房间)。
  • The relationship between an offer and the room is represented by:
    • 报价与房间之间的关系通过以下方式表示:
    • offers (from room product to offer) or itemOffered (from offer to room product).
      • offers(从房间产品到报价)或 itemOffered(从报价到房间产品)。
  • The relationship between the lodging business and its offers is represented by:
    • 住宿业务与其报价之间的关系通过以下方式表示:
    • makesOffer (from business to offer) or offeredBy (from offer to business).
      • makesOffer(从业务到报价)或 offeredBy(从报价到业务)。
  • For offers that include more than just the room (e.g., meals) or span multiple nights, use the includesObject property with one or more TypeAndQuantityNode objects.
    • 对于包含不仅仅是房间(例如餐食)或跨越多个夜晚的报价,请使用 includesObject 属性以及一个或多个 TypeAndQuantityNode 对象。

住宿业务类型

Types of Lodging Businesses

  Schema.org currently provides explicit types for the following kinds of lodging businesses:

Schema.org 目前为以下类型的住宿业务提供了明确的类型:

  • BedAndBreakfast
    • BedAndBreakfast
  • Campground
    • Campground
  • Hostel
    • Hostel
  • Hotel
    • Hotel
  • Motel
    • Motel
  • Resort
    • Resort

  This list may be extended. For other forms, use the generic LodgingBusiness type. The additionalType property can link to external identifiers (e.g., from a controlled vocabulary) to specify the exact type.

此列表可能会扩展。对于其他形式,请使用通用的 LodgingBusiness 类型。additionalType 属性可以链接到外部标识符(例如,来自受控词表)以指定确切类型。

住宿单元类型

Types of Accommodations

  For specific kinds of accommodations, the following types are available:

对于特定类型的住宿单元,有以下类型可用:

  • Apartment
    • Apartment
  • CampingPitch
    • CampingPitch
  • Room (with subtypes HotelRoom, MeetingRoom)
    • Room(包含子类型 HotelRoomMeetingRoom
  • House
    • House
  • Suite
    • Suite

  This list may also be extended. Use the generic Accommodation type for others, optionally with additionalType for precision.

此列表也可能扩展。对于其他类型,请使用通用的 Accommodation 类型,可以选择使用 additionalType 来提高精确度。

基础示例

Minimal Example

  At its most basic, you can mark up a hotel with fundamental information like name, description, contact details, photos, star rating, and a price range, without detailing individual room offers.

最基本的形式是,您可以使用名称、描述、联系方式、照片、星级和价格范围等基本信息来标记酒店,而无需详细说明单个房间报价。

  Microdata Example:

<div itemscope itemtype="https://schema.org/Hotel">
  <h1><span itemprop="name">ACME Hotel Innsbruck</span></h1>
  <span itemprop="description">A beautifully located business hotel right in the heart of the alps...</span>
  <div itemprop="address" itemscope itemtype="https://schema.org/PostalAddress">
    <span itemprop="streetAddress">Technikerstrasse 21</span>
    <span itemprop="postalCode">6020</span>
    <span itemprop="addressLocality">Innsbruck</span>, <span itemprop="addressRegion">Tyrol</span>, <span itemprop="addressCountry">Austria</span>
  </div>
  Phone: <span itemprop="telephone">+43 512 8000-0</span>
  <img itemprop="photo" src="../media/hotel_front.png" alt="Front view of the hotel" />
  Star rating: <span itemprop="starRating" itemscope itemtype="https://schema.org/Rating">
    <meta itemprop="ratingValue" content="4">****
  </span>
  Room rates: <span itemprop="priceRange">$100 - $240</span>
</div>

Microdata 示例:

<div itemscope itemtype="https://schema.org/Hotel">
  <h1><span itemprop="name">ACME Hotel Innsbruck</span></h1>
  <span itemprop="description">一家位于阿尔卑斯山中心的商务酒店,位置优越...</span>
  <div itemprop="address" itemscope itemtype="https://schema.org/PostalAddress">
    <span itemprop="streetAddress">Technikerstrasse 21</span>
    <span itemprop="postalCode">6020</span>
    <span itemprop="addressLocality">Innsbruck</span>, <span itemprop="addressRegion">Tyrol</span>, <span itemprop="addressCountry">Austria</span>
  </div>
  电话: <span itemprop="telephone">+43 512 8000-0</span>
  <img itemprop="photo" src="../media/hotel_front.png" alt="酒店正面视图" />
  星级: <span itemprop="starRating" itemscope itemtype="https://schema.org/Rating">
    <meta itemprop="ratingValue" content="4">****
  </span>
  房价: <span itemprop="priceRange">$100 - $240</span>
</div>

  Refer to the Hotel type page for a complete property list. The patterns described here apply equally to other lodging businesses (e.g., Campground, MeetingRoom) by substituting the appropriate type.

有关完整属性列表,请参阅 Hotel 类型页面。此处描述的模式同样适用于其他住宿业务(例如 CampgroundMeetingRoom),只需替换相应的类型即可。

酒店详细信息标记

Information about the Hotel

  If your website provides richer details, numerous additional Schema.org properties are available. Below are highlights for key areas.

如果您的网站提供更丰富的详细信息,可以使用许多额外的 Schema.org 属性。以下是关键领域的重点介绍。

地理位置

Geo Position

  Use GeoCoordinates within a geo property to specify latitude and longitude.

geo 属性中使用 GeoCoordinates 来指定纬度和经度。

<div itemprop="geo" itemscope itemtype="https://schema.org/GeoCoordinates">
  <meta itemprop="latitude" content="47.2649990" />
  <meta itemprop="longitude" content="11.3428720" />
</div>

电话与传真

Telephone and Fax

  Use telephone and faxNumber properties.

使用 telephonefaxNumber 属性。

Phone: <span itemprop="telephone">+43 512 8000-0</span>
Fax: <span itemprop="faxNumber">+43 512 8000-99</span>

星级评分

Star Rating

  Star ratings indicate accommodation quality. They can be simple numeric values or include the rating authority.

星级评分表示住宿质量。可以是简单的数值,也可以包含评级机构信息。

简单标记

Simple

  Mark up the numeric value directly using starRating.

直接使用 starRating 标记数值。

Star rating: <span itemprop="starRating" itemscope itemtype="https://schema.org/Rating">
  <meta itemprop="ratingValue" content="4">****
</span>

高级标记:评分类型

Advanced: Type of Star Rating

  Specify the awarding body (e.g., DEHOGA, HOTREC) using the author property of an embedded Rating.

使用内嵌 Ratingauthor 属性来指定颁发机构(例如 DEHOGA、HOTREC)。

Star rating: <span itemprop="starRating" itemscope itemtype="https://schema.org/Rating">
  <span itemprop="author" itemscope itemtype="https://schema.org/Organization">
    <span itemprop="name">DEHOGA</span>
  </span>
  <meta itemprop="ratingValue" content="4">****
</span>

  Note: Official star ratings use starRating. Customer reviews and aggregate ratings should use review/Review and aggregateRating/AggregateRating respectively.

注意: 官方星级评分使用 starRating。客户评论和综合评分应分别使用 review/ReviewaggregateRating/AggregateRating

照片与商标

Photos and Logo

  Use photo for images of the property and logo for the business logo.

使用 photo 表示物业图片,使用 logo 表示企业商标。

<img itemprop="logo" src="../media/logo.png" alt="hotel logo" />
<img itemprop="photo" src="../media/hotel_front.png" alt="Front view of the hotel" />

地图

Map

  Link to a map using the hasMap property.

使用 hasMap 属性链接到地图。

<a itemprop="hasMap" href="https://www.google.com/maps?ie=UTF8&hq&ll=47.1234,11.1234&z=13">
  Click here for a map.
</a>

营业时间(接待处)

Opening Hours (Reception)

  Use openingHours or the more structured openingHoursSpecification to indicate reception hours.

使用 openingHours 或结构更清晰的 openingHoursSpecification 来指示接待处营业时间。

Reception opening hours:
<meta itemprop="openingHours" content="Mo-Fr 07:00-23:00">Mon-Fri 07.00-23.00
<meta itemprop="openingHours" content="Sa 08:00-23:00">Saturdays 08.00-23.00
<meta itemprop="openingHours" content="Sun 08:00-12:00">Sundays 08.00-12.00

房间数量

Number of Rooms

  Use numberOfRooms. For a simple count, use a number. For a breakdown (e.g., single vs. double rooms), use QuantitativeValue.

使用 numberOfRooms。对于简单计数,使用数字。对于细分(例如,单人间与双人间),使用 QuantitativeValue

  Simple:

<span itemprop="numberOfRooms">60</span> rooms.

  Detailed:

<span itemprop="numberOf
← 返回文章列表
分享到:微博

版权与免责声明:本文仅用于信息分享与交流,不构成任何形式的法律、投资、医疗或其他专业建议,也不构成对任何结果的承诺或保证。

文中提及的商标、品牌、Logo、产品名称及相关图片/素材,其权利归各自合法权利人所有。本站内容可能基于公开资料整理,亦可能使用 AI 辅助生成或润色;我们尽力确保准确与合规,但不保证完整性、时效性与适用性,请读者自行甄别并以官方信息为准。

若本文内容或素材涉嫌侵权、隐私不当或存在错误,请相关权利人/当事人联系本站,我们将及时核实并采取删除、修正或下架等处理措施。 也请勿在评论或联系信息中提交身份证号、手机号、住址等个人敏感信息。