Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page describes the adjustments, additions and changes that have been made to the NeTEx traffic data that Samtrafiken will deliver to a limited number of timetable data consumers such as SJ. Some of the changes have also been introduced in Samtrafiken’s regular NeTEx exports.

For a general description of NeTEx data published by Samtrafiken, please see the documentation here: Samtrafiken NeTEx export

When delivering NeTEx sales data to Samtrafiken then only a subset of these additions are imported. Please refer to the documentation here: Samtrafiken NeTEx import and for special adjustments here: Special cases for for sending sales data to Samtrafiken.

Stops file - _stops.xml

The <StopPlace> element has been extended with additional <KeyValue> elements in order to provide information concerning: interchanges, "Rikshållplats"-numbers and whether a stop is sellable or not.

...

Code Block
breakoutModefull-width
            <StopPlace changed="2023-08-23T22:49:53" modification="revise" version="20210926" id="SE:074:StopPlace:9021074000002000">
                <ValidBetween>
                    <FromDate>2021-09-26T00:00:00</FromDate>
                </ValidBetween>
                <keyList>
                    <KeyValue>
                        <Key>minimumInterchangeSeconds</Key>
                        <Value>900</Value>
                    </KeyValue>
                    <KeyValue>
                        <Key>sellable</Key>
                        <Value>true</Value>
                    </KeyValue>                    
                    <KeyValue>
                        <Key>rikshallplatsNummer</Key>
                        <Value>740000002</Value>
                    </KeyValue>
                    <KeyValue>
                        <Key>interchanges</Key>
                        <Value>279:279:BLT:BLT:300|279:279:BLT:SLT:300|279:279:BLT:JLT:840|279:279:SLT:BLT:300|279:279:SLT:SLT:300|279:279:SLT:JLT:840|279:279:JLT:BLT:540|279:279:JLT:SLT:540|279:279:JLT:JLT:600|586:300:::1200</Value>
                    </KeyValue>
                    <KeyValue>
                      <Key>trafikverketSignatures</Key>
                      <Value>G</Value>
                    </KeyValue>
                </keyList>
                <Name>Göteborg Centralstation</Name>
                <ShortName>Göteborg C</ShortName>
                <PrivateCode>2</PrivateCode>
                <Centroid>
                    <Location>
                        <Longitude>11.973478</Longitude>
                        <Latitude>57.708894</Latitude>
                    </Location>
                </Centroid>
                <OrganisationRef ref="SE:074:Authority:9010074000000000"/>
                <TransportMode>other</TransportMode>
                <StopPlaceType>other</StopPlaceType>
                <Weighting>preferredInterchange</Weighting>

Information about new and changed stops: changed and modification attributes

The changed attribute shows the last time that data for a StopPlace was changed in some way.

...

All fields and key-values on a StopPlace are evaluated in order to determine if it has been changed, EXCEPT for version and ValidBetween, because they change with every new dataset.

KeyValue: rikshallplatsNummer

This contains the “Rikshållplats”-number of the stop.

KeyValue: minimumInterchangeSeconds

This contains the default minimum time (in seconds) needed to make a change at this stop. The value is only specified if a change is allowed (as specified by the <Weighting> element).

The value is taken from Samtrafiken's BRM-system, similar to what you can see here: https://brm.samtrafiken.se/showtimes?pta=-1&station=g%C3%B6teborg+centralstation .

KeyValue: interchanges

This value contains specific change times (in seconds) between specific producers. It is used instead of the minimumInterchangeSeconds value for interchanges between the producer-pairs specified here.

...

Each of these values is interpreted as:

FromProducer:ToProducer:FromProductTransportMode:ToProductTransportMode:MinimumInterchangeTime

The value is taken from Samtrafiken's BRM-system, similar to what you can see here: https://brm.samtrafiken.se/showtimes?pta=-1&station=g%C3%B6teborg+centralstation.
The producer numbers in “FromProducer” and “ToProducer” refer to the producer responsible for sales, and prices and which is displayed to the public. This is the value “salesAuthorityNumber” on a Line (used to be called färdmedelsproducent in Petra).

KeyValue: sellable

This value is true if the stop is sellable.

KeyValue: trafikverketSignatures

The Trafikverket station signature associated with this stop. Can be more than one, in which case signatures are separated by a comma.

Example values: CST for Stockholms Central Station, ÖSV,ÖSVI for Östersund Västra.

General data - _shared.xml

The <Authority> element now has the <PrivateCode> element specified. This is the producer number used for traffic data, interchanges, line files etc.

...

Code Block
<Authority version="20210926" id="SE:074:Authority:9010300000000000">
    <ValidBetween>
      <FromDate>2021-09-26T00:00:00</FromDate>
    </ValidBetween>
    <PrivateCode>300</PrivateCode>
    <Name>Öresundståg AB</Name>
    <LegalName>Öresundståg AB</LegalName>
    <OrganisationType>authority</OrganisationType>
</Authority>

Line files - line.xml

Naming of files

The line files now have been changed so that the file name contains the producer number (Authority.PrivateCode) and line number of the line.

...

The format is thus: “line_<producerNumber>_<lineNumber>_<internalId>.xml"

Line

The <Line> element has been extended with a <KeyValue> containing the salesAuthorityNumber. The salesAuthorityNumber refers to the number/PrivateCode of the Authority that is responsible for sales and prices. Below is an example of SL Pendeltåg line 40:

Code Block
<Line version="220224" id="SE:074:Line:9011222004000000">
    <ValidBetween>
        <FromDate>2022-02-24T00:00:00</FromDate>
    </ValidBetween>
    <keyList>
        <KeyValue>
            <Key>salesAuthorityNumber</Key>
            <Value>275</Value>
        </KeyValue>
    </keyList>
    <Name>40</Name>
    <TransportMode>rail</TransportMode>
    <TransportSubmode>
        <RailSubmode>unknown</RailSubmode>
    </TransportSubmode>
    <PublicCode>40</PublicCode>
    <PrivateCode>40</PrivateCode>
    <RepresentedByGroupRef ref="SE:074:Network:9010222000000000"/>
</Line>

ServiceJourney

The <ServiceJourney> element has been extended with a <KeyValue> containing the productCode, a <KeyValue> fingerprint to detect changes, as well as a <KeyValue> with the attributes defined for the <ServiceJourney>.

...

Code Block
breakoutModewide
<ServiceJourney version="any" id="SE:074:ServiceJourney:30_300_300_1036_1036_J_RE_2">
    <keyList>
        <KeyValue>
            <Key>productCode</Key>
            <Value>RE</Value>
        </KeyValue>
        <KeyValue>
            <Key>fingerprint</Key>
            <Value>nib84qjrt4p3pvaiatvag8u32cnjno8j</Value>
        </KeyValue>    
    </keyList>
    <PrivateCode>1036</PrivateCode>    
    <TransportMode>rail</TransportMode>
    <TransportSubmode>
        <RailSubmode>unknown</RailSubmode>
    </TransportSubmode>
    <dayTypes>
        <DayTypeRef ref="SE:074:DayType:ah0l8tejnuptnmgqvmp348sc3t8pmk72"/>
    </dayTypes>
    <JourneyPatternRef ref="SE:074:JourneyPattern:949400000000636569" version="any"/>
    <OperatorRef ref="SE:074:Operator:9013300000100000"/>
    <trainNumbers>
        <TrainNumberRef>1036</TrainNumberRef>
    </trainNumbers>
    <passingTimes>
        ...
    </passingTimes>
    <facilities>
        <ServiceFacilitySet version="any" id="SE:074:ServiceFacilitySet:949400000001112786">
            <keyList>
                <KeyValue>
                    <Key>attributes</Key>
                    <Value>KOMAB,BOKEJB,EVFEUJ,KOMEL,KOMIUK,KOMLYF</Value>
                </KeyValue>
            </keyList>
            <MobilityFacilityList>suitableForWheelchairs</MobilityFacilityList>
            <PassengerCommsFacilityList>powerSupplySockets internet</PassengerCommsFacilityList>
            <ServiceReservationFacilityList>noReservationsPossible</ServiceReservationFacilityList>
        </ServiceFacilitySet>
    </facilities>
</ServiceJourney>

KeyValue: productCode

This contains the product code of the Service Journey. The possible values are defined in separate code lists shared by Samtrafiken here: Codelist: Product Category.

KeyValue: fingerprint

This is a fingerprint of all the data for the ServiceJourney. If anything changes on the ServiceJourney then the fingerprint value will change as well. It takes into account the operating days, passing stops and times, boarding/alighting, privateCode (trip number/train number), service facilities and more.

This can be used by you to detect if any changes have been made to the ServiceJourney, if you compare it with the fingerprint of the previous delivery.

KeyValue: attributes

This is a comma-separated list of attributes for the Service Journey. The possible values are defined in separate code lists shared by Samtrafiken here: Codelist: Attributes (service properties) .

...

Code Block
breakoutModewide
<ServiceJourney version="any" id="SE:074:ServiceJourney:300_17_f724f511e94aba890c97f8ee8d0b49d4">
    <keyList>
        <KeyValue>
            <Key>productCode</Key>
            <Value>RE</Value>
        </KeyValue>
    </keyList>
    <TransportMode>rail</TransportMode>
    <TransportSubmode>
        <RailSubmode>unknown</RailSubmode>
    </TransportSubmode>
    <dayTypes>
        <DayTypeRef ref="SE:074:DayType:250"/>
    </dayTypes>
    <JourneyPatternRef ref="SE:074:JourneyPattern:949400000000636703" version="any"/>
    <OperatorRef ref="SE:074:Operator:9013300000100000"/>
    <trainNumbers>
        <TrainNumberRef>1036</TrainNumberRef>
    </trainNumbers>
    <passingTimes>
        ...
    </passingTimes>
    <parts>
        <JourneyPart version="any" id="SE:074:JourneyPart:949400000000636703_1">
            <MainPartRef ref="SE:074:JourneyPart:949400000000636703_1" version="any"/>
            <FromStopPointRef ref="SE:074:ScheduledStopPoint:9022074000003001"/>
            <ToStopPointRef ref="SE:074:ScheduledStopPoint:9022074000120001"/>
            <StartTime>10:48:00</StartTime>
            <EndTime>11:00:00</EndTime>
            <facilities>
                <ServiceFacilitySet version="any" id="SE:074:ServiceFacilitySet:949400000001113899">
                    <keyList>
                        <KeyValue>
                            <Key>attributes</Key>
                            <Value>BOKEJB</Value>
                        </KeyValue>
                    </keyList>
                    <ServiceReservationFacilityList>noReservationsPossible</ServiceReservationFacilityList>
                </ServiceFacilitySet>
            </facilities>
        </JourneyPart>
    </parts>
    <facilities>
        <ServiceFacilitySet version="any" id="SE:074:ServiceFacilitySet:949400000001113897">
            <keyList>
                <KeyValue>
                    <Key>attributes</Key>
                    <Value>KOMAB,BOKP37,EVFEUJ,KOMEL,KOMIUK,KOMLYF,BOKFRI</Value>
                </KeyValue>
            </keyList>
            <MobilityFacilityList>suitableForWheelchairs</MobilityFacilityList>
            <PassengerCommsFacilityList>powerSupplySockets internet</PassengerCommsFacilityList>
            <ServiceReservationFacilityList>reservationsPossible</ServiceReservationFacilityList>
        </ServiceFacilitySet>
    </facilities>
</ServiceJourney>

Changed producers file - changes.csv

An additional file changes.csv has been added to the NeTEx dataset. This file contains a list of the changed carriers/producers based on the previously published NeTEx dataset.

...

  1. MODIFIED - Data for this producer has been modified in some way. The producer existed in the previous dataset.

  2. UNMODIFIED - Data for this producer has not been modified. The producer existed in the previous dataset.

  3. ADDED - The producer did not exist in the previous dataset. Its data has been added.

  4. DELETED - The producer existed in the previous dataset, but does not exist in the current one.

Changed lines file - changeslines.csv

An additional file changeslines.csv has been added to the NeTEx dataset. This file contains a list of the changed lines based on the previously published NeTEx dataset, so it gives a more detailed view of the changes than the changes.csv file that only shows changes on the producer level.

...