...
The root element situationExchangeDeliveryStructure
includes a response timestamp (when the XML structure was rendered), subscriptionRef
in case publish/subscribe is used for the data transfer, and exactly 1 one Situations
element.
The tables below list which fields are supported by Samtrafiken. Any fields or attributes which are not on the list listed are ignored.
Element | Required | Notes |
---|---|---|
Situations | Required | Contains one or more |
PtSituationElement
Element | Required | Notes |
---|---|---|
SituationNumber | Required | An internal identifier for a situation. May contain characters, but the number obtained by removing the characters should be unique for the situation |
Summary | Required | Short summary text PtSituationElement items without any |
summary are ignored. |
In case multiple elements are present, only the first summary is read |
Description | Optional | Complete text note for the message |
In case multiple elements are present, only the first description is read | ||
CreationTime | Required | The time when this situation was created |
Source.SourceType | Required | Required by the format specification, but not used by Samtrafiken |
Source.ExternalCode | Optional | Code for this deviation in external systems |
Source.Other | Optional | External system id |
Source.Name | Optional | The name of the source. Currently never exported by Samtrafiken |
Progress | Required |
Only the first validity period is read
ValidityPeriod.StartTime
Required
| ||
ValidityPeriod | Required | Only the first validity period is read |
ValidityPeriod.StartTime | Required | From which time the message applies |
ValidityPeriod.EndTime | Optional | At which time the message no longer applies |
Affects > StopPlaces > AffectedStopPlace
Optional
UndefinedReason | Required | Reason should always be The field is mandatory due to format specification, but is not used. |
Affects > StopPlaces > AffectedStopPlace | Optional | Currently unsupported If affected stop places are set, no other type of affects should be set |
Affects > StopPoints > AffectedStopPoints | Optional | If affected stop places are set, no other type of affects should be set |
Affects > Networks > AffectedNetwork | Optional | If affected networks are set, no other type of affects should be set |
Affects > VehicleJourneys > AffectedVehicleJourney | Optional | If affected vehicle journeys are set, no other type of affects should be set |
AffectedStopPlace
Currently not implemented
AffectedStopPoint
Element | Required | Notes |
---|---|---|
StopPointRef | Required | Should reference a StopPlace or Quay in the static data. Reference to a StopPlace if all quays are affected |
AffectedNetwork
Element | Required | Notes |
---|---|---|
AffectedLines | Required | Samtrafiken does not support a complete network being affected, so lines have to be specified. One or more AffectedLine elements |
AffectedVehicleJourney
Element | Required | Notes |
---|---|---|
FramedVehicleJourneyRef > DatedVehicleJourneyRef | Required |
One or more.
Reference to |
VehicleJourneyRefs
Forbidden
, for example | ||
FramedVehicleJourneyRef > DataFrameRef | Required | Trip start date in YYYY-MM-DD format. Used to match with static data |
VehicleJourneyRefs | Forbidden | Not supported. Messages containing one or more references will be rejected to prevent incorrect output. |
DatedVehicleJourneyRefs | Forbidden | Not supported. Messages containing one or more references will be rejected to prevent incorrect output. |
Route | Optional | Ignored by Samtrafiken - AffectedVehicleJourneys are applied to the entire vehicle journey |
AffectedLine
Element | Required | Notes |
---|---|---|
LineRef | Required | Should reference a line in the static data |
Routes > AffectedRoute | Optional | Not set if all routes are affected If set the situation only applies to the specified routes are marked as affected |
AffectedRoute
AffectedRoutes belong to AffectedLines, any filters applied here, such as only specific stops being affected, are combined with the affected line information. Only “Stop A”, in combination with “Only line 1”, will result in “Applies at stop A for traffic on line 1”.
AffectedRoutes may currently only be used to mark affected stops along a line. RouteRef shall not be used.
Element | Required | Notes |
---|---|---|
RouteRef | Forbidden | RouteRef is not implemented by Samtrafiken. Messages containing it will be rejected to prevent incorrect output. |
StopPoints | Optional | The stop points where traffic for the AffectedLine will be affected. If not set, the affectedRoute element won’t have any effect. |
StopPoints > StopPointRef | Should reference a StopPlace or Quay in the static data. Reference to a StopPlace if all quays are affected. |
Examples
Stop no longer trafficked from a certain day, applied to the stop on specific lines
Code Block | ||||
---|---|---|---|---|
| ||||
<situationExchangeDeliveryStructure xmlns:ns5="http://www.siri.org.uk/siri" xmlns:ns2="http://www.ifopt.org.uk/acsb" xmlns:ns4="http://datex2.eu/schema/2_0RC1/2_0" xmlns:ns3="http://www.ifopt.org.uk/ifopt"> <ns5:ResponseTimestamp>2024-10-14T15:18:23.917+02:00</ns5:ResponseTimestamp> <ns5:SubscriberRef>Samtrafiken</ns5:SubscriberRef> <!-- as specified <ns5:SubscriptionRef>situation_exchange-1728919101</ns5:SubscriptionRef> <ns5:Status>true</ns5:Status> <ns5:Situations> by Samtrafiken when the subscription is created, not required when publish/subscribe is not used for data transfer --> <ns5:PtSituationElement> <ns5:CreationTime>2024-SubscriptionRef>situation_exchange-1728919101</ns5:SubscriptionRef> <!-- as specified by Samtrafiken when the subscription is created, not required when publish/subscribe is not used for data transfer --> <ns5:Situations> <ns5:PtSituationElement> <ns5:CreationTime>2024-10-07T13:57:38.53+02:00</ns5:CreationTime> <ns5:ParticipantRef>OrganisationName</ns5:ParticipantRef> <ns5:SituationNumber>TX1234567</ns5:SituationNumber> <ns5:Source> <ns5:SourceType>directReport<Other>RT1234567</ns5:SourceType>Other> <ns5:Other>RT1234567<Name>ORG\USER</ns5:Other>Name> <ns5:Name>ORG\USER<ExternalCode>RT1234567-TX1234567</ns5:Name>ExternalCode> <ns5:ExternalCode>RT1234567-TX1234567</ns5:ExternalCode> </ns5:Source> <ns5:Progress>open</ns5:Progress> <ns5:ValidityPeriod> <ns5:StartTime>2024-10-07T13:57:00+02:00</ns5:StartTime> </ns5:ValidityPeriod> <ns5:UndefinedReason></ns5:UndefinedReason><UndefinedReason/> <ns5:Severity>normal<Summary>Hållplats Västra Saltvik</ns5:Severity>Summary> <ns5:Language>en</ns5:Language>Description>Hållplats Västra Saltvik i Härnösand är färdigbyggd och trafikeras från och med <ns5:Summary>Hållplats Västra Saltvik</ns5:Summary> <ns5:Description>Hållplats Västra Saltvik i Härnösand är färdigbyggd och trafikeras från och med 7 oktober av linje 5017 oktober av linje 501, 532 och 534. Med anledning av detta trafikeras hållplats Hamnleden fortsättningsvis endast i riktning från stan.</ns5:Description> <ns5:Affects> <ns5:Networks> <ns5:AffectedNetwork> <ns5:AffectedLine> <ns5:LineRef>SE:022:Line:9011022050100000</ns5:LineRef> </ns5:AffectedLine> </ns5:AffectedNetwork> <ns5:AffectedNetwork> <ns5:AffectedLine> <ns5:LineRef>SE:022:Line:9011022053200000</ns5:LineRef> <ns5:Routes> <ns5:AffectedRoute> <ns5:StopPoints> <ns5:AffectedOnly>true</ns5:AffectedOnly> <ns5:AffectedStopPoint> <ns5:StopPointRef>SE:022:Quay:9022022000898005</ns5:StopPointRef> </ns5:AffectedStopPoint> <ns5:AffectedStopPoint> <ns5:StopPointRef>SE:022:Quay:9022022001948002</ns5:StopPointRef> </ns5:AffectedStopPoint> <!-- more stoppoints --> </ns5:StopPoints> </ns5:AffectedRoute> </ns5:Routes> </ns5:AffectedLine> </ns5:AffectedNetwork> <ns5:AffectedNetwork> <ns5:AffectedLine> <ns5:LineRef>SE:022:Line:9011022053400000</ns5:LineRef> <ns5:Routes> <ns5:AffectedRoute> <ns5:StopPoints> <ns5:AffectedOnly>true</ns5:AffectedOnly> <ns5:AffectedStopPoint> <ns5:StopPointRef>SE:022:Quay:9022022000898004</ns5:StopPointRef> </ns5:AffectedStopPoint> <ns5:AffectedStopPoint> <ns5:StopPointRef>SE:022:Quay:9022022001948002</ns5:StopPointRef> </ns5:AffectedStopPoint> <!-- more points --> </ns5:StopPoints> </ns5:AffectedRoute> </ns5:Routes> </ns5:AffectedLine> </ns5:AffectedNetwork> </ns5:Networks> <ns5:StopPoints> <ns5:AffectedStopPoint> <ns5:StopPointRef>SE:022:Quay:9022022080290001</ns5:StopPointRef> </ns5:AffectedStopPoint> <ns5:AffectedStopPoint> <ns5:StopPointRef>SE:022:Quay:9022022080290002</ns5:StopPointRef> </ns5:AffectedStopPoint> </ns5:StopPoints> </ns5:Affects> </ns5:PtSituationElement> </ns5:Situations> </situationExchangeDeliveryStructure> |
Cancelled stop on a route, ignored by Samtrafiken (this should be delivered as Siri-ET)
...
Stop no longer trafficked from a certain day, applied to a complete vehicle journey
Code Block | ||||
---|---|---|---|---|
| ||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <situationExchangeDeliveryStructure xmlns:ns5="http://www.siri.org.uk/siri" xmlns:<situationExchangeDeliveryStructure xmlns:ns5="http://www.siri.org.uk/siri" xmlns:ns2="http://www.ifopt.org.uk/acsb" xmlns:ns4="http://datex2.eu/schema/2_0RC1/2_0" xmlns:ns3="http://www.ifopt.org.uk/ifopt"> <ns5:ResponseTimestamp>2024-10-14T15:18:23.917+02:00</ns5:ResponseTimestamp> <ns5:SubscriberRef>Samtrafiken</ns5:SubscriberRef> <!-- subscriberRef as provided when samtrafiken registers for a pub/sub connection, not used for synchronous data transfer --> <ns5:SubscriptionRef>situation_exchange-1728919101</ns5:SubscriptionRef> <!-- subscriptionRef as provided when samtrafiken registers for a pub/sub connection, not used for synchronous data transfer --> <ns5:Status>true</ns5:Status> <ns5:Situations> <ns5:PtSituationElement> <ns5:CreationTime>2024-10-02T07:28:25.17+02:00</ns5:CreationTime> <ns5:ParticipantRef>OrganisationName</ns5:ParticipantRef> <ns5:SituationNumber>INTERNALID123</ns5:SituationNumber> <ns5:References> <ns5:RelatedToRef> <ns5:CreationTime>2024-10-02T05:28:25.327+02:00</ns5:CreationTime> <ns5:SituationNumber>INTERNALID123456</ns5:SituationNumber> <ns5:RelatedAs>associated</ns5:RelatedAs> </ns5:RelatedToRef> </ns5:References> <ns5:Source> ifopt.org.uk/ifopt"> <ns5:ResponseTimestamp>2024-10-14T15:18:23.917+02:00</ns5:ResponseTimestamp> <ns5:SubscriberRef>Samtrafiken</ns5:SubscriberRef> <!-- as specified by Samtrafiken when the subscription is created, not required when publish/subscribe is not used for data transfer --> <ns5:SourceType>directReport<SubscriptionRef>situation_exchange-1728919101</ns5:SourceType>SubscriptionRef> <!-- as specified by Samtrafiken when the subscription is created, not required <ns5:Other>RT1234567</ns5:Other> when publish/subscribe is not used for data transfer --> <ns5:Situations> <ns5:Name>ORG\USER</ns5:Name> <ns5:PtSituationElement> <ns5:ExternalCode>RT1234567-DI1234567<CreationTime>2024-10-07T13:57:38.53+02:00</ns5:ExternalCode>CreationTime> <<ns5:ParticipantRef>OrganisationName</ns5:Source>ParticipantRef> <ns5:Progress>open<SituationNumber>TX1234567</ns5:Progress>SituationNumber> <ns5:ValidityPeriod>Source> <ns5:StartTime>2024-10-02T07:21:00+02:00<Other>RT1234567</ns5:StartTime>Other> <ns5:Name>ORG\USER</ns5:Name> </ns5:ValidityPeriod> <ns5:UndefinedReason><ExternalCode>RT1234567-TX1234567</ns5:UndefinedReason>ExternalCode> <ns5:Language>en<</ns5:Language>Source> <ns5:Affects> :Progress>open</ns5:Progress> <ns5:VehicleJourneys>ValidityPeriod> <ns5:AffectedVehicleJourney><ns5:StartTime>2024-10-07T13:57:00+02:00</ns5:StartTime> </ns5:ValidityPeriod> <ns5:FramedVehicleJourneyRef> <UndefinedReason/> <ns5:Summary>Hållplats Västra Saltvik</ns5:Summary> <ns5:DataFrameRef>2024-10-02</ns5:DataFrameRef> <ns5:DatedVehicleJourneyRef>000500555003</ns5:DatedVehicleJourneyRef>Description>Hållplats Västra Saltvik i Härnösand är färdigbyggd och trafikeras från och med 7 oktober av linje 501, 532 och 534. Med anledning av detta trafikeras hållplats Hamnleden fortsättningsvis endast i riktning från stan.</ns5:Description> <ns5:Affects> </ns5:FramedVehicleJourneyRef> <ns5:VehicleJourneys> <ns5:Route> AffectedVehicleJourney> <ns5:StopPoints>FramedVehicleJourneyRef> <ns5:AffectedOnly>true<DataFrameRef>2024-10-02</ns5:AffectedOnly>DataFrameRef> <ns5:DatedVehicleJourneyRef>SE:022:ServiceJourney:000500555003</ns5:DatedVehicleJourneyRef> <ns5:AffectedStopPoint> </ns5:FramedVehicleJourneyRef> <ns5:StopPointRef>SE:022:Quay:9022022000001001</ns5:StopPointRef> <ns5:Route> <!-- currently ignored by Samtrafiken --> </ns5:AffectedStopPoint> <ns5:StopPoints> </ns5:StopPoints> <ns5:AffectedStopPoint> </ns5:Route> <<ns5:StopPointRef>SE:022:Quay:9022022000001001</ns5:AffectedVehicleJourney>StopPointRef> </ns5:VehicleJourneys> </ns5:Affects>AffectedStopPoint> <ns5:Consequences> </ns5:StopPoints> <ns5:Consequence> <ns5:Condition>cancelled<</ns5:Condition>Route> <ns5:Severity>normal<</ns5:Severity>AffectedVehicleJourney> </ns5:Consequence>VehicleJourneys> </ns5:Consequences>Affects> </ns5:PtSituationElement> </ns5:Situations> </situationExchangeDeliveryStructure> |