Journey Parts

Overview

A JourneyPart is a subsection of a ServiceJourney that differs from the rest of the journey in at least one relevant characteristic — such as a different train number, operator, or on-board facilities. The ServiceJourney as a whole still runs from start to finish; JourneyParts subdivide it into meaningful segments for passenger information or operational purposes.

When to use: When the on-board service changes along a ServiceJourney (e.g. bistro available only on part of the route), or for a direct carriage (Kurswagen) that is pulled by different trains on different sections.

graph LR
  Bern -->|"IC 703 — bistro open"| Zürich
  Zürich -->|"IC 703 — no bistro"| StGallen["St. Gallen"]
  Bern -->|"ServiceJourney IC 703"| StGallen

Mapping between HRDF and NeTEx

HRDF NeTEx RG1 NeTEx RG2 Use Case
[attribut] per Teilstrecke JourneyPart JourneyPart Change of on-board facilities
*KW / *KWZ – JourneyPart with PurposeOfJourneyPartition:DirectCarriage, one per *KWZ Direct carriage (Kurswagen)

Use Cases in the Swiss Profile

1. Change of on-board facilities (PurposeOfJourneyPartition:FacilityChange)

When to use: When a service (e.g. bistro, wifi) is only available on part of the route.

In the example IC 703 Bern – St. Gallen, the bistro is open between Bern and Zürich (05:29–06:28) and again between Zürich and Wil SG (06:57–07:52), but not on the full journey.

<ServiceJourney id="ch:1:ServiceJourney:703" version="1">
  <!-- ... passingTimes ... -->
  <parts>
    <JourneyPart id="ch:1:JourneyPart:703-bistro-1" version="1">
      <FromStopPointRef ref="ch:1:sloid:7000:4:7" version="1"/>
      <ToStopPointRef ref="ch:1:sloid:218:7" version="1"/>
      <StartTime>05:29:00</StartTime>
      <StartTimeDayOffset>0</StartTimeDayOffset>
      <EndTime>06:28:00</EndTime>
      <EndTimeDayOffset>0</EndTimeDayOffset>
      <PurposeOfJourneyPartitionRef ref="ch:1:PurposeOfJourneyPartition:FacilityChange" version="1"/>
      <facilities>
        <ServiceFacilitySetRef ref="ch:1:ServiceFacilitySet:bistro-open" version="1"/>
      </facilities>
    </JourneyPart>
    <JourneyPart id="ch:1:JourneyPart:703-bistro-2" version="1">
      <FromStopPointRef ref="ch:1:sloid:3000:501:33" version="1"/>
      <ToStopPointRef ref="ch:1:sloid:6302:1" version="1"/>
      <StartTime>06:57:00</StartTime>
      <StartTimeDayOffset>0</StartTimeDayOffset>
      <EndTime>07:52:00</EndTime>
      <EndTimeDayOffset>0</EndTimeDayOffset>
      <PurposeOfJourneyPartitionRef ref="ch:1:PurposeOfJourneyPartition:FacilityChange" version="1"/>
      <facilities>
        <ServiceFacilitySetRef ref="ch:1:ServiceFacilitySet:bistro-open" version="1"/>
      </facilities>
    </JourneyPart>
  </parts>
</ServiceJourney>

2. Direct carriage (PurposeOfJourneyPartition:DirectCarriage)

When to use: For a direct carriage (Kurswagen): a coach group that is pulled by different trains on different sections. See uc08 Direct carriages.

The coach group is one complete ServiceJourney from its first to its last stop. It contains one JourneyPart per pulling train, i.e. one per HRDF *KWZ line:

  • ParentJourneyRef references the ServiceJourney of the pulling train.
  • FromPointInPatternRef / ToPointInPatternRef delimit the section within the ServiceJourneyPattern of the pulling train. This can be a sub-range, e.g. if the pulling train continues after the coach group has been detached.
  • TrainNumberRef is the train number of the pulling train.
  • StartTime / EndTime with the day offsets give the time bounds of the section.
  • JourneyPartCoupleRef is not used.

The ServiceJourney of the coach group lists the train numbers of all pulling trains in trainNumbers, in the order of the sections.

In the example direct carriage 37 Zürich HB – Bremen Hbf, the coach group is pulled by train 472 (Zürich HB – Basel Bad Bf), train 470 (Basel Bad Bf – Hannover Hbf; 470 continues to Hamburg-Altona) and train 2746 (Hannover Hbf – Bremen Hbf).

<ServiceJourney id="ch:1:ServiceJourney:KW37" version="1" responsibilitySetRef="ch:1:ResponsibilitySet:DB">
  <!-- ... -->
  <trainNumbers>
    <TrainNumberRef ref="ch:1:TrainNumber:472" version="1"/>
    <TrainNumberRef ref="ch:1:TrainNumber:470" version="1"/>
    <TrainNumberRef ref="ch:1:TrainNumber:2746" version="1"/>
  </trainNumbers>
  <parts>
    <!-- ... part 1: train 472 ... -->
    <JourneyPart id="ch:1:JourneyPart:KW37:2" version="1">
      <Description lang="de">Kurswagen 37 am Zug 470, Basel Bad Bf - Hannover Hbf</Description>
      <ParentJourneyRef ref="ch:1:ServiceJourney:470" version="1"/>
      <TrainNumberRef ref="ch:1:TrainNumber:470" version="1"/>
      <FromPointInPatternRef ref="ch:1:ServiceJourneyPattern:470:1" version="1"/>
      <ToPointInPatternRef ref="ch:1:ServiceJourneyPattern:470:2" version="1"/>
      <StartTime>23:40:00</StartTime>
      <StartTimeDayOffset>0</StartTimeDayOffset>
      <EndTime>06:12:00</EndTime>
      <EndTimeDayOffset>1</EndTimeDayOffset>
      <PurposeOfJourneyPartitionRef ref="ch:1:PurposeOfJourneyPartition:DirectCarriage" version="1"/>
    </JourneyPart>
    <!-- ... part 3: train 2746 ... -->
  </parts>
</ServiceJourney>

3. Change of ProductCategoryRef

We will do this with "ch:1:PurposeOfJouryneyPartition:TypeOfProductCategoryChange"

LATER Example

4. Change of train number — NOT USED in the Swiss profile

Status: This use case is intentionally not implemented via JourneyPart in the Swiss profile.

Although passenger displays may show a train number change as if it were a single continuous journey, in the underlying data this is always modeled as two separate ServiceJourneys linked via a ServiceJourneyInterchange (suppressed in passenger-facing presentation). See uc01 Durchbindung.

This concerns a train that operates under different train numbers on different sections of the same ServiceJourney. It does not concern direct carriages, where TrainNumberRef in the JourneyPart names the pulling train (see above).

5. Splitting and Joining

JourneyPart together with CoupledJourneycould be used for a different modeling of joining and splitting (see relevant use case). However, we currently won’t do that.

6. Integrating data from different sources to have something to load into a trip planner in international travel

A ServiceJourney may exist in the Swiss system only up to the first commercial stop abroad and completely but with less information in the Austrian system. To make sure that real-time data is easily applied the aggregated NeTEx timetable may still wish to keep the original delivered ServiceJourney. The relevant parts are then also modeled with JourneyPart and CoupledJourney. We won’t do this either. But we study this for some international projects we have on aggregation of timetables.

7. Notice only for a part of the ServiceJourney

We don’t use JourneyPart for this. NoticeAssignment can be valid only for a part of the ServiceJourney (StartPointInPatternRef and EndPointInPatternRef).

Table

Used for a change of facilities and for direct carriages (see uc05_journey_parts). The first JourneyPart shows a change of facilities, the second one a direct carriage.

Table: parts

Sub Element Usage Card Type Description Note
  JourneyPart optional 0..* JourneyPart_VersionStructure A part of a VEHICLE JOURNEY created according to a specific functional purpose, for instance in situations when vehicle coupling or separating occurs.  
+ validityConditions optional 1..1 validityConditions_RelStructure   We prefer to not use those
++ AvailabilityConditionRef optional 0..* AvailabilityConditionRefStructure    
+ MainPartRef optional 0..1 JourneyPartRefStructure Main JOURNEY PART for journey. For the use cases we support, this is not necessary
+ TrainNumberRef optional 0..1 TrainNumberRefStructure   TrainNumber used for this part. For a direct carriage the TrainNumber of the pulling train.
+ FromStopPointRef optional 1..1 ScheduledStopPointRefStructure Point at which this JOURNEY PART starts. ScheduledStopPoint where the part begins. On the level of Quay. Used for a change of facilities. The XSD only allows either FromStopPointRef/ToStopPointRef or FromPointInPatternRef/ToPointInPatternRef (choice), so one of the two pairs must be present.
+ ToStopPointRef expected 0..1 ScheduledStopPointRefStructure Point at which this JOURNEY PART ends. If not set it is until the end of the JOURNEY. We will make this element mandatory in the future. ScheduledStopPoint where the part ends. If not present, it is to the end of the ServiceJourney. But we prefer to have it explicitly. Not used together with FromPointInPatternRef/ToPointInPatternRef.
+ StartTime mandatory 0..1 time Start time of JOURNEY PART. Time bounds of the part
+ StartTimeDayOffset optional 0..1 DayOffsetType Number of days after journey start time that start time is.  
+ EndTime mandatory 0..1 time End time of JOURNEY PART. Time bounds of the part.
+ EndTimeDayOffset optional 0..1 DayOffsetType Number of days after journey start time that end time is.  
+ PurposeOfJourneyPartitionRef mandatory 0..1 PurposeOfJourneyPartitionRefStructure   Reason for the partition. Allowed values: ch:1:PurposeOfJourneyPartition:FacilityChange, ch:1:PurposeOfJourneyPartition:DirectCarriage, ch:1:PurposeOfJourneyPartition:TypeOfProductCategoryChange (see uc05_journey_parts). A change of train number is not modelled with JourneyPart. Other things are implemented with different elements. Especially Notices are done with NoticeAssignment and not JourneyPart.
+ facilities expected 0..1 serviceFacilitySets_RelStructure Facilities available during JOURNEY PART. ServiceFacilitySet valid for this part only. Used when there is a change in facilities.
++ ServiceFacilitySetRef expected 0..* ServiceFacilitySetRefStructure    
+ TypeOfProductCategoryRef optional 0..1 TypeOfProductCategoryRefStructure   Used when the product category changes
+ Description optional 0..* MultilingualString   Free text. In the example for direct carriages it names the direct carriage, the pulling train and the section.
++ @lang mandatory 1..1 xsd:string Attribute lang  
+ ParentJourneyRef optional 0..* VehicleJourneyRefStructure Reference to parent of which this is part. If given by context does not need to be stated. Used for a direct carriage: the ServiceJourney of the pulling train. One JourneyPart per HRDF *KWZ.
+ FromPointInPatternRef optional 0..* PointInSequenceRefStructure POINT at which applicability of JOURNEY PART starts. When using PASSING TIME this element is to be used. +v2.1 Used for a direct carriage: point in the ServiceJourneyPattern of the pulling train (ParentJourneyRef) where the part begins. Alternative to FromStopPointRef (choice in the XSD).
+ ToPointInPatternRef optional 0..* PointInSequenceRefStructure POINT at which applicability of JOURNEY PART ends. +v2.1 Used for a direct carriage: point in the ServiceJourneyPattern of the pulling train where the part ends. Can be before the end of the pulling train. Mandatory in the XSD if FromPointInPatternRef is used.

→ General NeTEx definition

Example

<?xml version="1.0" encoding="UTF-8"?>
<parts>
  <!-- Used for a change of facilities and for direct carriages (see uc05_journey_parts). The first JourneyPart shows a change of facilities, the second one a direct carriage. -->
  <JourneyPart id="ch:1:JourneyPart:703-bistro-1" version="1">
    <validityConditions>
      <!-- We prefer to not use those -->
      <AvailabilityConditionRef ref="generated" version="1"/>
    </validityConditions>
    <MainPartRef ref="ch:1:JourneyPart:703-bistro-1" version="1">
      <!-- For the use cases we support, this is not necessary -->
    </MainPartRef>
    <TrainNumberRef ref="ch:1:TrainNumber:231213" version="1">
      <!-- TrainNumber used for this part. For a direct carriage the TrainNumber of the pulling train. -->
    </TrainNumberRef>
    <FromStopPointRef ref="ch:1:sloid:7000:4:7" version="1">
      <!-- `ScheduledStopPoint` where the part begins. On the level of Quay. Used for a change of facilities. The XSD only allows either `FromStopPointRef`/`ToStopPointRef` or `FromPointInPatternRef`/`ToPointInPatternRef` (choice), so one of the two pairs must be present. -->
    </FromStopPointRef>
    <ToStopPointRef ref="ch:1:sloid:218:7" version="1">
      <!-- `ScheduledStopPoint` where the part ends. If not present, it is to the end of the ServiceJourney. But we prefer to have it explicitly. Not used together with `FromPointInPatternRef`/`ToPointInPatternRef`. -->
    </ToStopPointRef>
    <StartTime>05:29:00
      <!-- Time bounds of the part -->
    </StartTime>
    <StartTimeDayOffset>0</StartTimeDayOffset>
    <EndTime>06:28:00
      <!-- Time bounds of the part. -->
    </EndTime>
    <EndTimeDayOffset>0</EndTimeDayOffset>
    <PurposeOfJourneyPartitionRef ref="ch:1:PurposeOfJourneyPartition:FacilityChange" version="1">
      <!-- Reason for the partition. Allowed values: `ch:1:PurposeOfJourneyPartition:FacilityChange`, `ch:1:PurposeOfJourneyPartition:DirectCarriage`, `ch:1:PurposeOfJourneyPartition:TypeOfProductCategoryChange` (see uc05_journey_parts). A change of train number is not modelled with JourneyPart. Other things are implemented with different elements. Especially Notices are done with NoticeAssignment and not JourneyPart. -->
    </PurposeOfJourneyPartitionRef>
    <facilities>
      <!-- `ServiceFacilitySet` valid for this part only. Used when there is a change in facilities. -->
      <ServiceFacilitySetRef ref="ch:1:ServiceFacilitySet:bistro-open" version="1"/>
    </facilities>
    <TypeOfProductCategoryRef ref="ch:1:TypeOfProductCategory:B" version="1">
      <!-- Used when the product category changes -->
    </TypeOfProductCategoryRef>
  </JourneyPart>
  <JourneyPart id="ch:1:JourneyPart:KW37:2" version="1">
    <Description lang="de">Kurswagen 37 am Zug 470, Basel Bad Bf - Hannover Hbf
      <!-- Free text. In the example for direct carriages it names the direct carriage, the pulling train and the section. -->
    </Description>
    <ParentJourneyRef ref="ch:1:ServiceJourney:470" version="1">
      <!-- Used for a direct carriage: the `ServiceJourney` of the pulling train. One `JourneyPart` per HRDF `*KWZ`. -->
    </ParentJourneyRef>
    <TrainNumberRef ref="ch:1:TrainNumber:470" version="1"/>
    <FromPointInPatternRef ref="ch:1:ServiceJourneyPattern:470:1" version="1">
      <!-- Used for a direct carriage: point in the `ServiceJourneyPattern` of the pulling train (`ParentJourneyRef`) where the part begins. Alternative to `FromStopPointRef` (choice in the XSD). -->
    </FromPointInPatternRef>
    <ToPointInPatternRef ref="ch:1:ServiceJourneyPattern:470:2" version="1">
      <!-- Used for a direct carriage: point in the `ServiceJourneyPattern` of the pulling train where the part ends. Can be before the end of the pulling train. Mandatory in the XSD if `FromPointInPatternRef` is used. -->
    </ToPointInPatternRef>
    <StartTime>23:40:00</StartTime>
    <StartTimeDayOffset>0</StartTimeDayOffset>
    <EndTime>06:12:00</EndTime>
    <EndTimeDayOffset>1</EndTimeDayOffset>
    <PurposeOfJourneyPartitionRef ref="ch:1:PurposeOfJourneyPartition:DirectCarriage" version="1"/>
  </JourneyPart>
</parts>

→ Template

Usage Notes

  • JourneyParts are nested directly within the ServiceJourney under <parts>.
  • For a facility change, FromStopPointRef / ToStopPointRef reference ScheduledStopPoints of the ServiceJourney itself — a JourneyPart cannot introduce new stops.
  • For a direct carriage, FromPointInPatternRef / ToPointInPatternRef reference points in the ServiceJourneyPattern of the pulling train given in ParentJourneyRef.
  • A ServiceFacilitySet on a JourneyPart is valid for this part only.
  • JourneyPartCouple is not used in the Swiss profile, neither for splitting and joining (use ServiceJourneyInterchange, see uc02 Joining and splitting) nor for direct carriages.
  • JourneyPart may become relevant for train composition (Wagenreihung) data in a future version of the profile. See uc15 Formations.