火车票预订

使用场景

以下用例展示了有关如何使用 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>

测试您的标记

您可以使用电子邮件标记测试工具验证您的标记。粘贴您的标记代码,然后点击验证按钮以扫描内容,然后在出现任何错误时接收报告。

规范

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

属性 类型 说明
reservationNumber 文本 必需)预留的编号或 ID。
网址 网址 可查看预订信息的网页。
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 或 URL 如果条形码图片托管在您的网站上,则此字段的值为该图片的网址或者条形码或二维码 URI,例如“barcode128:AB34”(ISO-15417 条形码)、"qrCode:AB34"(二维码)、"aztecCode:AB34"(阿兹特克代码),"barcodeEAN:1234"(EAN 代码)和“barcodeUPCA:1234”(UPCA 代码)。
reservedTicket.additionalTicketText 文本 关于门票的其他说明文字。
reservedTicket.price 文本 门票的总价。
reserveTicket.priceCurrency 文本 门票价格的币种(采用由 3 个字母表示的 ISO 4217 格式)。
reservedTicket.underName PersonOrganization 门票所面向的个人或组织。
reservedTicket.underName.name 文本 此人的姓名。
reservedTicket.ticketedSeat 席位 预订座位的位置(例如,(第 27B 条)。.
reservedTicket.ticketedSeat.seatingType 文本 座位的类型/等级。
reservedTicket.ticketedSeat.seatNumber 文本 预订座位的位置。
reservedTicket.ticketedSeat.seatRow 文本 预订座位的行位置。