Scheduled stock API (beta)

Scheduled stock reads netex route data files. The files are saved as database structures. New and changed data are sent as kafka messages based on dated service journey.

Netex common file

This file contains global data for an operator. This includes organizations, vehicle types and route points.

Netex line file

This file specifies information for one train line for an operator. The data includes routes, journey patterns, service journeys and dated service journeys. The system requires static keys for lines, service journeys and dated service journeys.

Authentication

The Seating beta requires a Bearer Token in the Authorization header created by the Entur Authentication server to be passed for every request.

Guides

Netex line file

Defines one train line.

Netex id will be used when comparing line definitions. Hence it is necessary that ids are stable.

Line

Defines a line with service journeys and dated service journeys.

<Line version="6" id="GOA:Line:L50">
  <Name>Oslo-Stavanger</Name>
  <TransportMode>rail</TransportMode>
  <PublicCode>50</PublicCode>
  <PrivateCode>L50</PrivateCode>
  <OperatorRef ref="GOA:Operator:GOA" />
  <RepresentedByGroupRef ref="GOA:Network:GOA" />
</Line>

Line: Name

Defines the displayed name of the line.

<Name>Oslo-Stavanger</Name>

Line: TransportMode

Defines the type of transport.

<TransportMode>rail</TransportMode>

Line: RepresentedByGroupRef

Used to find the operator of the line.

<RepresentedByGroupRef ref="GOA:Network:GOA" />

JourneyPattern

Defines the pattern for a service journey.

<JourneyPattern version="0" id="GOA:JourneyPattern:L50-1">
  <Name>KRS-STV</Name>
  <RouteRef ref="GOA:Route:L50-F" version="0" />
  <pointsInSequence>
    <StopPointInJourneyPattern order="1" version="0" id="GOA:StopPointInJourneyPattern:L50-1-1">
      <ScheduledStopPointRef ref="GOA:ScheduledStopPoint:KRS-1" />
      <ForAlighting>false</ForAlighting>
      <DestinationDisplayRef ref="GOA:DestinationDisplay:L50-STV" />
    </StopPointInJourneyPattern>
    <StopPointInJourneyPattern order="2" version="0" id="GOA:StopPointInJourneyPattern:L50-1-2">
      <ScheduledStopPointRef ref="GOA:ScheduledStopPoint:NDL-2" />
      <RequestStop>true</RequestStop>
    </StopPointInJourneyPattern>
    <StopPointInJourneyPattern order="3" version="0" id="GOA:StopPointInJourneyPattern:L50-1-3">
      <ScheduledStopPointRef ref="GOA:ScheduledStopPoint:MDL-1" />
      <RequestStop>true</RequestStop>
    </StopPointInJourneyPattern>
  </pointsInSequence>
</JourneyPattern>

JourneyPattern: Name

Defines the displayed name of the journey pattern.

JourneyPattern: StopPointInJourneyPattern: ScheduledStopPointRef

Maps to ScheduledStopPoint in the shared file

<ScheduledStopPointRef ref="GOA:ScheduledStopPoint:KRS-1" />

JourneyPattern: StopPointInJourneyPattern: ForAlighting

If set to false, passengers may not leave the train on this stop.

<ForAlighting>false</ForAlighting>

JourneyPattern: StopPointInJourneyPattern: ForBoarding

If set to false, passengers may not board the train on this stop.

<ForBoarding>false</ForBoarding>

ServiceJourney

Defines a journey starting at a specified time.

<ServiceJourney version="1" id="GOA:ServiceJourney:701_197" created="2021-09-29T17:31:51" changed="2021-10-04T19:50:44">
  <Name>701</Name>
  <Description>701 [05:02 : KRS-STV]</Description>
  <PrivateCode>701</PrivateCode>
  <TransportMode>rail</TransportMode>
  <TransportSubmode>
    <RailSubmode>regionalRail</RailSubmode>
  </TransportSubmode>
  <JourneyPatternRef ref="GOA:JourneyPattern:L50-1" version="0" />
  <OperatorRef ref="GOA:Operator:GOA" />
  <LineRef ref="GOA:Line:L50" version="6" />
  <passingTimes>
    <TimetabledPassingTime version="0" id="GOA:TimetabledPassingTime:1-KRS">
      <StopPointInJourneyPatternRef ref="GOA:StopPointInJourneyPattern:L50-1-1" version="0" />
      <DepartureTime>05:02:00</DepartureTime>
    </TimetabledPassingTime>
    <TimetabledPassingTime version="0" id="GOA:TimetabledPassingTime:2-NDL">
      <StopPointInJourneyPatternRef ref="GOA:StopPointInJourneyPattern:L50-1-2" version="0" />
      <ArrivalTime>05:10:00</ArrivalTime>
      <DepartureTime>05:11:00</DepartureTime>
    </TimetabledPassingTime>
  </passingTimes>
  <parts>
    <JourneyPart version="0" id="GOA:JourneyPart:701_197_1">
      <Description>KRS - STV</Description>
      <MainPartRef ref="GOA:JourneyPart:701_197_1" version="0" />
      <TrainNumberRef ref="GOA:TrainNumber:L50-1" version="0" />
      <FromStopPointRef ref="GOA:ScheduledStopPoint:KRS-1" />
      <ToStopPointRef ref="GOA:ScheduledStopPoint:STV-2" />
      <StartTime>05:02:00</StartTime>
      <EndTime>08:05:00</EndTime>
    </JourneyPart>
  </parts>
</ServiceJourney>

ServiceJourney: Name

Defines the displayed name of the service journey.

<Name>701</Name>

ServiceJourney: TransportMode

Defines the type of transport. Will override value given for line.

<TransportMode>rail</TransportMode>

ServiceJourney: TransportSubmode

Defines the sub type of transport.

<RailSubmode>regionalRail</RailSubmode>

ServiceJourney: TimetabledPassingTime: DepartureTime

Defined departure time from each stop on a journey. The departure time on the first stop of the journey define the departure time for the journey.

<DepartureTime>05:02:00</DepartureTime>

DatedServiceJourney

Defines a journey date of a service journey.

<DatedServiceJourney version="0" id="GOA:DatedServiceJourney:701_KRS-STV_21-10-08" created="2021-09-29T17:31:51">
  <TrainBlockRef ref="GOA:TrainBlock:705-LOD_6443-1" version="0" />
  <ServiceJourneyRef ref="GOA:ServiceJourney:701_197" version="1" />
  <OperatingDayRef ref="GOA:OperatingDay:2021-10-08-Fri" />
</DatedServiceJourney>

DatedServiceJourney: OperatingDayRef

Reference to journey date in the shared file.

<OperatingDayRef ref="GOA:OperatingDay:2021-10-08-Fri" />

DatedServiceJourney: TrainBlockRef

Reference to material definition for this journey.

<TrainBlockRef ref="GOA:TrainBlock:705-LOD_6443-1" version="0" />

TrainBlock

Defines the material for dated service journeys.

<TrainBlock version="0" id="GOA:TrainBlock:705-LOD_6443-1">
    <blockParts>
        <TrainBlockPart order="1" version="0" id="GOA:TrainBlockPart:705-LOD_6443-1-1">
            <CompoundTrainRef ref="GOA:CompoundTrain:_BFM73-4_BMU73-3_BFR73-2_BM73-1" />
            <journeyParts>
                <JourneyPartRef ref="GOA:JourneyPart:705-LOD_6443_2" version="0" />
            </journeyParts>
        </TrainBlockPart>
        <TrainBlockPart order="2" version="0" id="GOA:TrainBlockPart:705-LOD_6443-1-2">
            <CompoundTrainRef ref="GOA:CompoundTrain:_BM73-1_BFR73-2_BMU73-3_BFM73-4" />
            <journeyParts>
                <JourneyPartRef ref="GOA:JourneyPart:705-LOD_6443_3" version="0" />
            </journeyParts>
        </TrainBlockPart>
    </blockParts>
</TrainBlock>

TrainBlock: TrainBlockPart

Defines material for the dated service journey on one part of the journey.

TrainBlock: TrainBlockPart: CompoundTrainRef

Reference to the actual train definition in the shared file.

<CompoundTrainRef ref="GOA:CompoundTrain:_BM73-1_BFR73-2_BMU73-3_BFM73-4" />

TrainBlock: TrainBlockPart: JourneyPartRef

Reference to the journey part for which this material is valid. If there are more than one entry in the list, the first one is used.

<JourneyPartRef ref="GOA:JourneyPart:705-LOD_6443_3" version="0" />

Netex shared file

This file contains data that is used by a group of line files.

Netex id will be used when comparing material definitions and routes. Hence it is necessary that ids are stable.

Authority

Defines the authority that controls the corresponding lines.

<Authority version="1" id="GOA:Authority:GOA">
  <CompanyNumber>999999999</CompanyNumber>
  <Name>Go-Ahead Nordic</Name>
  <LegalName>Go-Ahead Nordic AS</LegalName>
  <ContactDetails>
    <Email>post@go-aheadnordic.no</Email>
    <Phone>+47 55 55 55 55</Phone>
    <Url>www.go-aheadnordic.no</Url>
  </ContactDetails>
</Authority>

Train

Defines a train or part of a train.

<Train version="0" id="GOA:Train:73_1-2-3-4">
  <Name>type 73</Name>
  <components>
    <TrainComponent order="1" version="0" id="GOA:TrainComponent:73_1-2-3-4-1-A" status="inactive">
      <Label>1</Label>
      <TrainElementRef ref="PEN:TrainElement:GOA-BM73A-COMFORT" versionRef="1" />
      <OperationalOrientation>forwards</OperationalOrientation>
    </TrainComponent>
    <TrainComponent order="2" version="0" id="GOA:TrainComponent:73_1-2-3-4-2-A">
      <Label>2</Label>
      <TrainElementRef ref="PEN:TrainElement:GOA-BFR73A-STANDARD-CAFETERIA" versionRef="1" />
      <OperationalOrientation>forwards</OperationalOrientation>
    </TrainComponent>
    <TrainComponent order="3" version="0" id="GOA:TrainComponent:73_1-2-3-4-3-A">
      <Label>3</Label>
      <TrainElementRef ref="PEN:TrainElement:GOA-BMU73A-STANDARD-ANIMALS-ALLOWED" versionRef="1" />
      <OperationalOrientation>forwards</OperationalOrientation>
    </TrainComponent>
    <TrainComponent order="4" version="0" id="GOA:TrainComponent:73_1-2-3-4-4-A">
      <Label>4</Label>
      <TrainElementRef ref="PEN:TrainElement:GOA-BFM73A-FAMILY" versionRef="1" />
      <OperationalOrientation>forwards</OperationalOrientation>
    </TrainComponent>
  </components>
</Train>

Train: Id

The hyphened list give the actual carriage numbers of the train.

id="GOA:Train:73_1-2-3-4"

Train: Name

The display name of the train.

<Name>type 73</Name>

Train: TrainComponent: Order

The order of the carriage in the train. Counting from 1.

order="1"

Train: TrainComponent: Status

If set to "inactive", this carriage is closed. Default value is "active".

status="inactive"

Train: TrainComponent: Label

The carriage number in a train. It must be unique in a train composition.

<Label>1</Label>

Train: TrainComponent: TrainElementRef

Reference to a logical element(ref/versionRef) in rolling stock.

<TrainElementRef ref="PEN:TrainElement:GOA-BM73A-COMFORT" versionRef="1" />

This refers to logical element series="GOA-BM73A-COMFORT", version=1. This logical element must exist in rolling stock with status ACTIVE.

CompoundTrain

Defines the composition of one or more trains.

<CompoundTrain version="0" id="GOA:CompoundTrain:_BFM73-4_BMU73-3_BFR73-2_BM73-1">
    <components>
        <TrainInCompoundTrain version="0" id="GOA:TrainInCompoundTrain:73-B_1-2-3-4_1_1">
            <TrainRef ref="GOA:Train:73-B_1-2-3-4" version="0" />
        </TrainInCompoundTrain>
    </components>
</CompoundTrain>

CompoundTrain: TrainInCompoundTrain

One of the trains in the compound train.

CompoundTrain: TrainInCompoundTrain: TrainRef

Reference to the train in the shared file.

<TrainRef ref="GOA:Train:73-B_1-2-3-4" version="0" />

OperatingDay

Defines the calendar date of a day used by a dated service journey.

<OperatingDay version="0" id="GOA:OperatingDay:2021-10-05-Tue">
  <CalendarDate>2021-10-05</CalendarDate>
</OperatingDay>

OperatingDay: CalendarDate

The actual calendar date of an operating day.

<CalendarDate>2021-10-06</CalendarDate>

RoutePoint

Defines a point on a route. The route points must have a complete and correct list of scheduled stop points. Automatic rebooking when service journeys are changed or replaced, is based on this information.

<RoutePoint version="0" id="GOA:RoutePoint:OSL">
  <Name>Oslo S</Name>
  <projections>
    <PointProjection version="0" id="GOA:PointProjection:OSL-12">
      <ProjectedPointRef ref="GOA:ScheduledStopPoint:OSL-12" version="0" />
    </PointProjection>
    <PointProjection version="0" id="GOA:PointProjection:OSL-13">
      <ProjectedPointRef ref="GOA:ScheduledStopPoint:OSL-13" version="0" />
    </PointProjection>
    <PointProjection version="0" id="GOA:PointProjection:OSL-3">
      <ProjectedPointRef ref="GOA:ScheduledStopPoint:OSL-3" version="0" />
    </PointProjection>
    <PointProjection version="0" id="GOA:PointProjection:OSL-6">
      <ProjectedPointRef ref="GOA:ScheduledStopPoint:OSL-6" version="0" />
    </PointProjection>
  </projections>
</RoutePoint>

RoutePoint: Name

The displayed name of the route point.

<Name>Oslo S</Name>

RoutePoint: PointProjection: ProjectedPointRef

The reference used from JourneyPattern in the line file.

<ProjectedPointRef ref="GOA:ScheduledStopPoint:OSL-12" version="0" />

ScheduledStopPoint

Defines a point on a journey pattern.

<ScheduledStopPoint version="0" id="GOA:ScheduledStopPoint:OSL-6">
  <Name>Oslo S</Name>
</ScheduledStopPoint>

ScheduledStopPoint: Name

The displayed name of the scheduled stop point.

<Name>Oslo S</Name>

PassengerStopAssignment

Defines a place where passengers may enter or leave the train.

<PassengerStopAssignment order="76" version="0" id="GOA:PassengerStopAssignment:OSL-6">
  <ScheduledStopPointRef ref="GOA:ScheduledStopPoint:OSL-6" version="0" />
  <QuayRef ref="NSR:Quay:550" />
</PassengerStopAssignment>

PassengerStopAssignment: QuayRef

Defines the NSR code of the corresponding quay. Used to find NSR code for Stop Place.

<QuayRef ref="NSR:Quay:550" />

Scheduled Stock API Reference

See the API reference on Swagger Petstore