火车票预订

使用场景

以下使用场景展示了 TrainReservation 架构的常见用法示例。请使用这些示例确保您的标记结构正确。

基本预订确认

在发送预订确认时,请在电子邮件中嵌入以下标记。

Google 应用会在行程当天显示预订详情,并通知用户出发时间,以便用户准时到达火车站(考虑到交通方式、路况等因素)。如果您提供入住登记网址(如下例所示),Google 应用会在行程开始前 24 小时向用户显示此网址。

JSON-LD

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "TrainReservation",
  "reservationNumber": "AB3XY2",
  "reservationStatus": "http://schema.org/ReservationConfirmed",
  "reservationFor": {
    "@type": "TrainTrip",
    "departureStation": {
      "@type": "TrainStation",
      "name": "Munich Central"
    },
    "departureTime": "2017-01-04T10:30:00+01:00",
    "arrivalStation": {
      "@type": "TrainStation",
      "name": "Paris Gare De Lyon"
    },
    "arrivalTime": "2017-01-04T03:10:00+01:00"
  }
}
</script>

微数据

<div itemscope itemtype="http://schema.org/TrainReservation">
  <meta itemprop="reservationNumber" content="AB3XY2"/>
  <link itemprop="reservationStatus" href="http://schema.org/ReservationConfirmed"/>
  <div itemprop="reservationFor" itemscope itemtype="http://schema.org/TrainTrip">
    <div itemprop="departureStation" itemscope itemtype="http://schema.org/TrainStation">
      <meta itemprop="name" content="Munich Central"/>
    </div>
    <meta itemprop="departureTime" content="2017-01-04T10:30:00+01:00"/>
    <div itemprop="arrivalStation" itemscope itemtype="http://schema.org/TrainStation">
      <meta itemprop="name" content="Paris Gare De Lyon"/>
    </div>
    <meta itemprop="arrivalTime" content="2017-01-04T03:10:00+01:00"/>
  </div>
</div>

登机牌和车票

除了预订确认之外,您还可以在单独的电子邮件中触发确认卡片登机牌。

确认卡片不仅可以帮助用户准时到达火车站,还可以在行程期间向用户显示车票。为此,您需要在标记中添加一些额外的字段。如果需要其他字段才能让乘客登车,请将其添加到 additionalTicketText 字段中。

对于没有预留座位的车票,这些字段为:numSeatsticketNumberticketToken

JSON-LD

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "TrainReservation",
  "reservationNumber": "AB3XY2",
  "underName": {
    "@type": "Person",
    "name": "Eva Green"
  },
  "reservationStatus": "http://schema.org/ReservationConfirmed",
  "reservationFor": {
    "@type": "TrainTrip",
    "departureStation": {
      "@type": "TrainStation",
      "name": "Munich Central"
    },
    "departureTime": "2017-01-04T10:30:00+01:00",
    "arrivalStation": {
      "@type": "TrainStation",
      "name": "Paris Gare De Lyon"
    },
    "arrivalTime": "2017-01-04T03:10:00+01:00"
  },
  "reservedTicket": {
    "@type": "Ticket",
    "underName": "Eva Green",
    "ticketNumber": "123XYZ",
    "ticketToken": "aztecCode:AB34",
    "additionalTicketText": "We recommend that you arrive at the station at least 30 minutes prior to your scheduled departure. Allow additional time if you need help with baggage or tickets."
  }
}
</script>

微数据

<div itemscope itemtype="http://schema.org/TrainReservation">
  <meta itemprop="reservationNumber" content="AB3XY2"/>
  <div itemprop="underName" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="Eva Green"/>
  </div>
  <link itemprop="reservationStatus" href="http://schema.org/ReservationConfirmed"/>
  <div itemprop="reservationFor" itemscope itemtype="http://schema.org/TrainTrip">
    <div itemprop="departureStation" itemscope itemtype="http://schema.org/TrainStation">
      <meta itemprop="name" content="Munich Central"/>
    </div>
    <meta itemprop="departureTime" content="2017-01-04T10:30:00+01:00"/>
    <div itemprop="arrivalStation" itemscope itemtype="http://schema.org/TrainStation">
      <meta itemprop="name" content="Paris Gare De Lyon"/>
    </div>
    <meta itemprop="arrivalTime" content="2017-01-04T03:10:00+01:00"/>
  </div>
  <div itemprop="reservedTicket" itemscope itemtype="http://schema.org/Ticket">
    <meta itemprop="underName" content="Eva Green"/>
    <meta itemprop="ticketNumber" content="123XYZ"/>
    <meta itemprop="ticketToken" content="aztecCode:AB34"/>
    <meta itemprop="additionalTicketText" content="We recommend that you arrive at the station at least 30 minutes prior to your scheduled departure. Allow additional time if you need help with baggage or tickets."/>
  </div>
</div>

对于有预留座位的车票,这些字段为:seatNumberseatingTypeticketNumberticketToken

JSON-LD

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "TrainReservation",
  "reservationNumber": "AB3XY2",
  "underName": {
    "@type": "Person",
    "name": "Eva Green"
  },
  "reservationStatus": "http://schema.org/ReservationConfirmed",
  "reservationFor": {
    "@type": "TrainTrip",
    "departureStation": {
      "@type": "TrainStation",
      "name": "Munich Central"
    },
    "departureTime": "2017-01-04T10:30:00+01:00",
    "arrivalStation": {
      "@type": "TrainStation",
      "name": "Paris Gare De Lyon"
    },
    "arrivalTime": "2017-01-04T03:10:00+01:00"
  },
  "reservedTicket": {
    "@type": "Ticket",
    "underName": "Eva Green",
    "ticketedSeat": {
      "@type": "Seat",
      "seatNumber": "27B",
      "seatingType": "1st Class"
    },
    "ticketNumber": "123XYZ",
    "ticketToken": "aztecCode:AB34",
    "additionalTicketText": "We recommend that you arrive at the station at least 30 minutes prior to your scheduled departure. Allow additional time if you need help with baggage or tickets."
  }
}
</script>

微数据

<div itemscope itemtype="http://schema.org/TrainReservation">
  <meta itemprop="reservationNumber" content="AB3XY2"/>
  <div itemprop="underName" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="Eva Green"/>
  </div>
  <link itemprop="reservationStatus" href="http://schema.org/ReservationConfirmed"/>
  <div itemprop="reservationFor" itemscope itemtype="http://schema.org/TrainTrip">
    <div itemprop="departureStation" itemscope itemtype="http://schema.org/TrainStation">
      <meta itemprop="name" content="Munich Central"/>
    </div>
    <meta itemprop="departureTime" content="2017-01-04T10:30:00+01:00"/>
    <div itemprop="arrivalStation" itemscope itemtype="http://schema.org/TrainStation">
      <meta itemprop="name" content="Paris Gare De Lyon"/>
    </div>
    <meta itemprop="arrivalTime" content="2017-01-04T03:10:00+01:00"/>
  </div>
  <div itemprop="reservedTicket" itemscope itemtype="http://schema.org/Ticket">
    <meta itemprop="underName" content="Eva Green"/>
    <div itemprop="ticketedSeat" itemscope itemtype="http://schema.org/Seat">
      <meta itemprop="seatNumber" content="27B"/>
      <meta itemprop="seatingType" content="1st Class"/>
    </div>
    <meta itemprop="ticketNumber" content="123XYZ"/>
    <meta itemprop="ticketToken" content="aztecCode:AB34"/>
    <meta itemprop="additionalTicketText" content="We recommend that you arrive at the station at least 30 minutes prior to your scheduled departure. Allow additional time if you need help with baggage or tickets."/>
  </div>
</div>

多位乘客

如需描述涉及多位乘客的预订,请针对每位乘客的每个行程段使用一个 TrainReservation

JSON-LD

<script type="application/ld+json">
[
  {
    "@context": "http://schema.org",
    "@type": "TrainReservation",
    "reservationNumber": "AB3XY2",
    "reservationStatus": "http://schema.org/ReservationConfirmed",
    "reservationFor": {
      "@type": "TrainTrip",
      "departureStation": {
        "@type": "TrainStation",
        "name": "Munich Central"
      },
      "departureTime": "2017-01-04T10:30:00+01:00",
      "arrivalStation": {
        "@type": "TrainStation",
        "name": "Paris Gare De Lyon"
      },
      "arrivalTime": "2017-01-04T03:10:00+01:00"
    },
    "reservedTicket": {
      "@type": "Ticket",
      "underName": {
        "@type": "Person",
        "name": "Eva Green"
      }
    }
  },
  {
    "@context": "http://schema.org",
    "@type": "TrainReservation",
    "reservationNumber": "AB3XY2",
    "reservationStatus": "http://schema.org/ReservationConfirmed",
    "reservationFor": {
      "@type": "TrainTrip",
      "departureStation": {
        "@type": "TrainStation",
        "name": "Munich Central"
      },
      "departureTime": "2017-01-04T10:30:00+01:00",
      "arrivalStation": {
        "@type": "TrainStation",
        "name": "Paris Gare De Lyon"
      },
      "arrivalTime": "2017-01-04T03:10:00+01:00"
    },
    "reservedTicket": {
      "@type": "Ticket",
      "underName": {
        "@type": "Person",
        "name": "John Green"
      }
    }
  },
  {
    "@context": "http://schema.org",
    "@type": "TrainReservation",
    "reservationNumber": "AB3XY2",
    "reservationStatus": "http://schema.org/ReservationConfirmed",
    "reservationFor": {
      "@type": "TrainTrip",
      "departureStation": {
        "@type": "TrainStation",
        "name": "Munich Central"
      },
      "departureTime": "2017-01-04T10:30:00+01:00",
      "arrivalStation": {
        "@type": "TrainStation",
        "name": "Paris Gare De Lyon"
      },
      "arrivalTime": "2017-01-04T03:10:00+01:00"
    },
    "reservedTicket": {
      "@type": "Ticket",
      "underName": {
        "@type": "Person",
        "name": "Carol Green"
      }
    }
  },
  {
    "@context": "http://schema.org",
    "@type": "TrainReservation",
    "reservationNumber": "AB3XY2",
    "reservationStatus": "http://schema.org/ReservationConfirmed",
    "reservationFor": {
      "@type": "TrainTrip",
      "departureStation": {
        "@type": "TrainStation",
        "name": "Munich Central"
      },
      "departureTime": "2017-01-04T10:30:00+01:00",
      "arrivalStation": {
        "@type": "TrainStation",
        "name": "Paris Gare De Lyon"
      },
      "arrivalTime": "2017-01-04T03:10:00+01:00"
    },
    "reservedTicket": {
      "@type": "Ticket",
      "underName": {
        "@type": "Person",
        "name": "Daniel Green"
      }
    }
  }
]
</script>

微数据

<div itemscope itemtype="http://schema.org/TrainReservation">
  <meta itemprop="reservationNumber" content="AB3XY2"/>
  <link itemprop="reservationStatus" href="http://schema.org/ReservationConfirmed"/>
  <div itemprop="reservationFor" itemscope itemtype="http://schema.org/TrainTrip">
    <div itemprop="departureStation" itemscope itemtype="http://schema.org/TrainStation">
      <meta itemprop="name" content="Munich Central"/>
    </div>
    <meta itemprop="departureTime" content="2017-01-04T10:30:00+01:00"/>
    <div itemprop="arrivalStation" itemscope itemtype="http://schema.org/TrainStation">
      <meta itemprop="name" content="Paris Gare De Lyon"/>
    </div>
    <meta itemprop="arrivalTime" content="2017-01-04T03:10:00+01:00"/>
  </div>
  <div itemprop="reservedTicket" itemscope itemtype="http://schema.org/Ticket">
    <div itemprop="underName" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Eva Green"/>
    </div>
  </div>
</div>
<div itemscope itemtype="http://schema.org/TrainReservation">
  <meta itemprop="reservationNumber" content="AB3XY2"/>
  <link itemprop="reservationStatus" href="http://schema.org/ReservationConfirmed"/>
  <div itemprop="reservationFor" itemscope itemtype="http://schema.org/TrainTrip">
    <div itemprop="departureStation" itemscope itemtype="http://schema.org/TrainStation">
      <meta itemprop="name" content="Munich Central"/>
    </div>
    <meta itemprop="departureTime" content="2017-01-04T10:30:00+01:00"/>
    <div itemprop="arrivalStation" itemscope itemtype="http://schema.org/TrainStation">
      <meta itemprop="name" content="Paris Gare De Lyon"/>
    </div>
    <meta itemprop="arrivalTime" content="2017-01-04T03:10:00+01:00"/>
  </div>
  <div itemprop="reservedTicket" itemscope itemtype="http://schema.org/Ticket">
    <div itemprop="underName" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="John Green"/>
    </div>
  </div>
</div>
<div itemscope itemtype="http://schema.org/TrainReservation">
  <meta itemprop="reservationNumber" content="AB3XY2"/>
  <link itemprop="reservationStatus" href="http://schema.org/ReservationConfirmed"/>
  <div itemprop="reservationFor" itemscope itemtype="http://schema.org/TrainTrip">
    <div itemprop="departureStation" itemscope itemtype="http://schema.org/TrainStation">
      <meta itemprop="name" content="Munich Central"/>
    </div>
    <meta itemprop="departureTime" content="2017-01-04T10:30:00+01:00"/>
    <div itemprop="arrivalStation" itemscope itemtype="http://schema.org/TrainStation">
      <meta itemprop="name" content="Paris Gare De Lyon"/>
    </div>
    <meta itemprop="arrivalTime" content="2017-01-04T03:10:00+01:00"/>
  </div>
  <div itemprop="reservedTicket" itemscope itemtype="http://schema.org/Ticket">
    <div itemprop="underName" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Carol Green"/>
    </div>
  </div>
</div>
<div itemscope itemtype="http://schema.org/TrainReservation">
  <meta itemprop="reservationNumber" content="AB3XY2"/>
  <link itemprop="reservationStatus" href="http://schema.org/ReservationConfirmed"/>
  <div itemprop="reservationFor" itemscope itemtype="http://schema.org/TrainTrip">
    <div itemprop="departureStation" itemscope itemtype="http://schema.org/TrainStation">
      <meta itemprop="name" content="Munich Central"/>
    </div>
    <meta itemprop="departureTime" content="2017-01-04T10:30:00+01:00"/>
    <div itemprop="arrivalStation" itemscope itemtype="http://schema.org/TrainStation">
      <meta itemprop="name" content="Paris Gare De Lyon"/>
    </div>
    <meta itemprop="arrivalTime" content="2017-01-04T03:10:00+01:00"/>
  </div>
  <div itemprop="reservedTicket" itemscope itemtype="http://schema.org/Ticket">
    <div itemprop="underName" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Daniel Green"/>
    </div>
  </div>
</div>

包含所有受支持字段的示例

为方便参考,以下示例填充了所有受支持的字段:

JSON-LD

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "TrainReservation",
  "reservationNumber": "AB3XY2",
  "url": "http://eurotravel/view/AB3XY2",
  "underName": {
    "@type": "Person",
    "name": "John Smith",
    "email": "john@mail.com"
  },
  "programMembership": {
    "@type": "ProgramMembership",
    "memberNumber": "12345",
    "program": "STA"
  },
  "bookingAgent": {
    "@type": "Organization",
    "name": "European Vacations",
    "url": "http://eurotravel/"
  },
  "bookingTime": "2013-01-14T13:05:00-05:00",
  "modifiedTime": "2013-03-14T13:05:00-05:00",
  "confirmReservationUrl": "http://eurotravel/confirm?id=AB3XY2",
  "cancelReservationUrl": "http://eurotravel/cancel?id=AB3XY2",
  "modifyReservationUrl": "http://eurotravel/edit?id=AB3XY2",
  "reservationStatus": "http://schema.org/ReservationConfirmed",
  "checkinUrl": "http://train.com/checkin?id=AB3XY2",
  "reservationFor": {
    "@type": "TrainTrip",
    "trainNumber": "9203",
    "trainName": "Orient Express",
    "trainCode": "iGTV",
    "trainCompany": {
      "@type": "Organization"
    },
    "departureStation": {
      "@type": "TrainStation",
      "name": "Munich Central"
    },
    "departurePlatform": "64",
    "departureTime": "2017-01-04T10:30:00+01:00",
    "arrivalStation": {
      "@type": "TrainStation",
      "name": "Paris Gare De Lyon"
    },
    "arrivalPlatform": "101B",
    "arrivalTime": "2017-01-04T03:10:00+01:00"
  },
  "reservedTicket": {
    "@type": "Ticket",
    "ticketNumber": "123XYZ",
    "downloadUrl": "?",
    "printUrl": "?",
    "ticketToken": "qrCode:123456789",
    "additionalTicketText": "?",
    "price": "135.00",
    "priceCurrency": "EUR",
    "underName": {
      "@type": "Person",
      "name": "Mary Smith"
    },
    "ticketedSeat": {
      "@type": "Seat",
      "seatingType": "1st Class",
      "seatNumber": "27",
      "seatRow": "A"
    }
  }
}
</script>

微数据

<div itemscope itemtype="http://schema.org/TrainReservation">
  <meta itemprop="reservationNumber" content="AB3XY2"/>
  <link itemprop="url" href="http://eurotravel/view/AB3XY2"/>
  <div itemprop="underName" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="John Smith"/>
    <meta itemprop="email" content="john@mail.com"/>
  </div>
  <div itemprop="programMembership" itemscope itemtype="http://schema.org/ProgramMembership">
    <meta itemprop="memberNumber" content="12345"/>
    <meta itemprop="program" content="STA"/>
  </div>
  <div itemprop="bookingAgent" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="European Vacations"/>
    <link itemprop="url" href="http://eurotravel/"/>
  </div>
  <meta itemprop="bookingTime" content="2013-01-14T13:05:00-05:00"/>
  <meta itemprop="modifiedTime" content="2013-03-14T13:05:00-05:00"/>
  <link itemprop="confirmReservationUrl" href="http://eurotravel/confirm?id=AB3XY2"/>
  <link itemprop="cancelReservationUrl" href="http://eurotravel/cancel?id=AB3XY2"/>
  <link itemprop="modifyReservationUrl" href="http://eurotravel/edit?id=AB3XY2"/>
  <link itemprop="reservationStatus" href="http://schema.org/ReservationConfirmed"/>
  <link itemprop="checkinUrl" href="http://train.com/checkin?id=AB3XY2"/>
  <div itemprop="reservationFor" itemscope itemtype="http://schema.org/TrainTrip">
    <meta itemprop="trainNumber" content="9203"/>
    <meta itemprop="trainName" content="Orient Express"/>
    <meta itemprop="trainCode" content="iGTV"/>
    <div itemprop="trainCompany" itemscope itemtype="http://schema.org/Organization">
    </div>
    <div itemprop="departureStation" itemscope itemtype="http://schema.org/TrainStation">
      <meta itemprop="name" content="Munich Central"/>
    </div>
    <meta itemprop="departurePlatform" content="64"/>
    <meta itemprop="departureTime" content="2017-01-04T10:30:00+01:00"/>
    <div itemprop="arrivalStation" itemscope itemtype="http://schema.org/TrainStation">
      <meta itemprop="name" content="Paris Gare De Lyon"/>
    </div>
    <meta itemprop="arrivalPlatform" content="101B"/>
    <meta itemprop="arrivalTime" content="2017-01-04T03:10:00+01:00"/>
  </div>
  <div itemprop="reservedTicket" itemscope itemtype="http://schema.org/Ticket">
    <meta itemprop="ticketNumber" content="123XYZ"/>
    <meta itemprop="downloadUrl" content="?"/>
    <meta itemprop="printUrl" content="?"/>
    <meta itemprop="ticketToken" content="qrCode:123456789"/>
    <meta itemprop="additionalTicketText" content="?"/>
    <meta itemprop="price" content="135.00"/>
    <meta itemprop="priceCurrency" content="EUR"/>
    <div itemprop="underName" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Mary Smith"/>
    </div>
    <div itemprop="ticketedSeat" itemscope itemtype="http://schema.org/Seat">
      <meta itemprop="seatingType" content="1st Class"/>
      <meta itemprop="seatNumber" content="27"/>
      <meta itemprop="seatRow" content="A"/>
    </div>
  </div>
</div>

测试您的标记

您可以使用电子邮件标记测试工具验证您的标记。粘贴标记代码,然后点击 Validate (验证)按钮,即可扫描内容并获得有关任何错误的报告。

规范

查看电子邮件的详细信息,了解其中是否有任何属性适用于您的火车预订。通过标记这些额外的属性,您可以让 Google 向用户显示有关火车预订的更丰富说明。

属性 类型 说明
reservationNumber 文字 必填 )预订的编号或 ID。
url 网址 可查看预订的网页。
underName PersonOrganization 乘客。
underName.name 文字 建议用于确认卡片/搜索回答 )人员的姓名。
underName.email 文字 电子邮件地址。
programMembership ProgramMembership 应用于预订的任何会员资格,例如常旅客计划、酒店会员计划等。
programMembership.memberNumber 文字 会员资格的标识符。
programMembership.program 文字 计划的名称。
bookingAgent OrganizationPerson 预订代理或代理机构。还接受字符串(例如“”“”)。
bookingAgent.name 文字 代理/服务的名称。
bookingAgent.url 网址 代理/服务的网站。
bookingTime DateTime 预订日期。
modifiedTime DateTime 建议用于确认卡片/搜索回答 )上次修改预订的时间。
confirmReservationUrl 网址 可确认预订的网页。
cancelReservationUrl 网址 可取消预订的网页。
modifyReservationUrl 网址 建议用于确认卡片/搜索回答 )可修改预订的网页。
reservationStatus ReservationStatus 必填 )预订的当前状态。
checkinUrl 网址 乘客可办理入住的网页。
reservationFor TrainTrip 必填 )有关火车行程的信息。
reservationFor.trainNumber 文字 建议用于确认卡片/搜索回答 )火车的编号。
reservationFor.trainName 文字 火车的名称。
reservationFor.trainCode 文字 火车的唯一标识符。
reservationFor.trainCompany 组织 运营火车的组织。还接受字符串(例如“”“”)。
reservationFor.departureStation TrainStation 必填 )火车出发的车站。
reservationFor.departureStation.name 文字 必填 )TrainStation 的名称。
reservationFor.departurePlatform 文字 火车出发的站台。
reservationFor.departureTime DateTime 必填 )预计出发时间。
reservationFor.arrivalStation TrainStation 必填 )火车到达的车站。
reservationFor.arrivalStation.name 文字 必填 )TrainStation 的名称。
reservationFor.arrivalPlatform 文字 火车到达的站台。
reservationFor.arrivalTime DateTime 必填 )预计到达时间。
reservedTicket 车票信息。
reservedTicket.ticketNumber 文字 车票的编号或 ID。
reservedTicket.downloadUrl 网址
reservedTicket.printUrl 网址
reservedTicket.ticketToken Text 或 网址 如果条形码图片托管在您的网站上,则该字段的值为图片的网址,或条形码或二维码 URI,例如“barcode128:AB34”(ISO-15417 条形码)、“qrCode:AB34”(二维码)、“aztecCode:AB34”(Aztec 代码)、“barcodeEAN:1234”(EAN 代码)和“barcodeUPCA:1234”(UPCA 代码)。
reservedTicket.additionalTicketText 文字 有关车票的其他说明文字。
reservedTicket.price 文字 车票的总价。
reservedTicket.priceCurrency 文字 车票价格的币种(采用由 3 个字母表示的 ISO 4217 格式)。
reservedTicket.underName PersonOrganization 车票所针对的 Person 或 Organization。
reservedTicket.underName.name 文字 人员的姓名。
reservedTicket.ticketedSeat 席位 预留座位的位置(例如 27B)。。
reservedTicket.ticketedSeat.seatingType 文字 座位的类型/等级。
reservedTicket.ticketedSeat.seatNumber 文字 预留座位的位置。
reservedTicket.ticketedSeat.seatRow 文字 预留座位所在的行。