Skip to content

Commit

Permalink
Add TripMonitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrossberndt committed Aug 30, 2024
1 parent c8afc28 commit b0f42f5
Show file tree
Hide file tree
Showing 11 changed files with 774 additions and 4 deletions.
1 change: 1 addition & 0 deletions OJP/OJP_All.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<xs:include schemaLocation="OJP_SituationSupport.xsd"/>
<xs:include schemaLocation="OJP_StopEvents.xsd"/>
<xs:include schemaLocation="OJP_TripInfo.xsd"/>
<xs:include schemaLocation="OJP_TripMonitoring.xsd"/>
<xs:include schemaLocation="OJP_Trips.xsd"/>
<xs:include schemaLocation="OJP_Utility.xsd"/>
<xs:include schemaLocation="OJP_Status.xsd"/>
Expand Down
8 changes: 8 additions & 0 deletions OJP/OJP_RequestSupport.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="AbstractOJPSubscriptionRequestStructure">
<xs:annotation>
<xs:documentation>Basic subscription request structure common for OJP subscription requests.</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="siri:AbstractSubscriptionStructure"/>
</xs:complexContent>
</xs:complexType>
<xs:annotation>
<xs:documentation>========================================== Collection contexts ==========================================</xs:documentation>
</xs:annotation>
Expand Down
43 changes: 39 additions & 4 deletions OJP/OJP_Requests.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ The service also provides information about formation, occupancy, and capacity.
</xs:annotation>
<xs:element name="OJPTripRefineRequest" type="OJPTripRefineRequestStructure" substitutionGroup="siri:AbstractFunctionalServiceRequest">
<xs:annotation>
<xs:documentation>The trip refinement service retrieves additional or updated information (e.g., real-time data) about a given, previously retrieved trip. It does not depend on the assumption that the trip has been retrieved from the same server; it may, in fact, even stem from another source than a OJP system.
An example scenario may involve a trip retrieved from a system A and one wishes to refine the trip with real time information from another system B. As it cannot be ascertained that both systems use identical object IDs, this is signalled by setting ExternalObjectRefs to true.
<xs:documentation>The trip refinement service retrieves additional or updated information (e.g., real-time data) about a given, previously retrieved trip. It does not depend on the assumption that the trip has been retrieved from the same server; it may, in fact, even stem from another source than a OJP system.
An example scenario may involve a trip retrieved from a system A and one wishes to refine the trip with real time information from another system B. As it cannot be ascertained that both systems use identical object IDs, this is signalled by setting ExternalObjectRefs to true.
System B, being confronted with external IDs, must try to recognise the relevant objects in another way and retrieve them in its own database. In the response it will use its own object IDs. To maintain a consistent mapping, it is imperative that system B reflects the structure of the refine request precisely in its response (principle of structure maintenance).</xs:documentation>
</xs:annotation>
</xs:element>
Expand All @@ -314,8 +314,8 @@ System B, being confronted with external IDs, must try to recognise the relevant
</xs:complexType>
<xs:element name="OJPTripRefineDelivery" type="OJPTripRefineDeliveryStructure" substitutionGroup="siri:AbstractFunctionalServiceDelivery">
<xs:annotation>
<xs:documentation>The trip refinement service retrieves additional or updated information (e.g., real-time data) about a given, previously retrieved trip. It does not depend on the assumption that the trip has been retrieved from the same server; it may, in fact, even stem from another source than a OJP system.
An example scenario may involve a trip retrieved from a system A and one wishes to refine the trip with real time information from another system B. As it cannot be ascertained that both systems use identical object IDs, this is signalled by setting ExternalObjectRefs to true.
<xs:documentation>The trip refinement service retrieves additional or updated information (e.g., real-time data) about a given, previously retrieved trip. It does not depend on the assumption that the trip has been retrieved from the same server; it may, in fact, even stem from another source than a OJP system.
An example scenario may involve a trip retrieved from a system A and one wishes to refine the trip with real time information from another system B. As it cannot be ascertained that both systems use identical object IDs, this is signalled by setting ExternalObjectRefs to true.
System B, being confronted with external IDs, must try to recognise the relevant objects in another way and retrieve them in its own database. In the response it will use its own object IDs. To maintain a consistent mapping, it is imperative that system B reflects the structure of the refine request precisely in its response (principle of structure maintenance).</xs:documentation>
</xs:annotation>
</xs:element>
Expand Down Expand Up @@ -434,4 +434,39 @@ System B, being confronted with external IDs, must try to recognise the relevant
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:annotation>
<xs:documentation>========================================== Trip Monitoring Service (Subscription) ==========================================</xs:documentation>
</xs:annotation>
<xs:element name="OJPTripMonitoringSubscriptionRequest" type="OJPTripMonitoringSubscriptionRequestStructure" substitutionGroup="siri:AbstractFunctionalServiceSubscriptionRequest"/>
<xs:complexType name="OJPTripMonitoringSubscriptionRequestStructure">
<xs:complexContent>
<xs:extension base="AbstractOJPSubscriptionRequestStructure">
<xs:sequence>
<xs:element name="Trip" type="TripStructure"/>
<xs:element ref="OJPTripRequest" minOccurs="0"/>
<xs:element name="MonitoringParameters" type="TripMonitoringParamStructure" minOccurs="0"/>
<xs:group ref="AlertSettingsGroup"/>
<xs:element ref="siri:Extensions" minOccurs="0"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="OJPTerminateSubscriptionRequest" type="siri:TerminateSubscriptionRequestStructure">
<xs:annotation>
<xs:documentation>Request element for terminating subscriptions. To change parameters of a subscription, it is necessary to terminate and to re-subscribe. Successful termination is acknowledged by problem code TRIPMONITORING_SUBSCRIPTION_TERMINATED in a delivery.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="OJPTripMonitoringDelivery" type="OJPTripMonitoringDeliveryStructure" substitutionGroup="siri:AbstractFunctionalServiceDelivery"/>
<xs:complexType name="OJPTripMonitoringDeliveryStructure">
<xs:complexContent>
<xs:extension base="siri:AbstractServiceDeliveryStructure">
<xs:sequence>
<xs:element ref="OJPTripMonitoringSubscriptionRequest" minOccurs="0"/>
<xs:element ref="OJPTerminateSubscriptionRequest" minOccurs="0"/>
<xs:group ref="TripMonitoringResponseGroup"/>
<xs:element ref="siri:Extensions" minOccurs="0"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
192 changes: 192 additions & 0 deletions OJP/OJP_TripMonitoring.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="http://www.vdv.de/ojp" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:siri="http://www.siri.org.uk/siri" xmlns:gml="http://www.opengis.net/gml/3.2" targetNamespace="http://www.vdv.de/ojp" elementFormDefault="qualified" attributeFormDefault="unqualified" id="OJP_siri_service">
<xs:annotation>
<xs:documentation>OJP/OJP_TripMonitoring.xsd - Request and response definitions for trip monitoring.</xs:documentation>
</xs:annotation>
<xs:import namespace="http://www.siri.org.uk/siri" schemaLocation="../siri/xsd/siri_model/siri_all.xsd"/>
<xs:include schemaLocation="OJP_All.xsd"/>
<xs:annotation>
<xs:documentation>=============================== Alert Settings ==========================================</xs:documentation>
</xs:annotation>
<xs:group name="AlertSettingsGroup">
<xs:sequence>
<xs:element name="AlertTimeWindow" type="WeekdayTimePeriodStructure" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Time windows when alerts are welcome.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="MaximumAlertFrequency" type="xs:duration" minOccurs="0">
<xs:annotation>
<xs:documentation>Maximum frequency of subsequent alerts for the same reason.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="MaximumTimeBeforeEvent" type="xs:duration" minOccurs="0">
<xs:annotation>
<xs:documentation>Earliest time for first alert. Measured as duration before beginning of event. Only for dated events.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:group>
<xs:annotation>
<xs:documentation>=============================== Trip Monitoring Parameters ==========================================</xs:documentation>
</xs:annotation>
<xs:complexType name="TripMonitoringParamStructure">
<xs:annotation>
<xs:documentation>TripMonitoring parameters.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="Severity" type="siri:SeverityEnumeration" minOccurs="0">
<xs:annotation>
<xs:documentation>Priority of events.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="MinimumDelayChangeThreshold" type="xs:duration" minOccurs="0">
<xs:annotation>
<xs:documentation>Minimum delay to send new notifications.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="GetInformationFromDistributedSystems" type="xs:boolean" default="false" minOccurs="0">
<xs:annotation>
<xs:documentation>Whether to fetch and integrate information from other systems in the case of distributed journey planning. Default is false.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="IncludeAlternatives" type="xs:boolean" default="false" minOccurs="0">
<xs:annotation>
<xs:documentation>Whether alternative trips should be part of the response. Default is false.</xs:documentation>
</xs:annotation>
</xs:element>
<!--<xs:element name="FacilityMonitoringSubscription" type="siri:FacilityMonitoringSubscriptionStructure" minOccurs="0">
<xs:annotation>
<xs:documentation>Subscribing to the SIRI facility monitoring service. The monitoring time window of OJPTripMonitoringSubscriptionRequest overrides values in FacilityMonitoringSubscription(StartTime, PreviewInterval).</xs:documentation>
</xs:annotation>
</xs:element> Schema parser doesn't find/like FacilityMonitoringSubscriptionStructure in siri_facilityMonitoring_service.xsd -->
</xs:sequence>
</xs:complexType>
<xs:annotation>
<xs:documentation>=============================== Trip Monitoring Response ==========================================</xs:documentation>
</xs:annotation>
<xs:group name="TripMonitoringResponseGroup">
<xs:annotation>
<xs:documentation>TripMonitoring response structure.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="TripMonitoringResult" type="TripMonitoringResultStructure" minOccurs="0">
<xs:annotation>
<xs:documentation>Result structure.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:group>
<xs:complexType name="TripMonitoringResultStructure">
<xs:sequence>
<xs:element name="Problem" type="TripMonitoringProblemStructure" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Problems related to this TripMonitoring result.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="AffectedLeg" type="ObjectIdType" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Legs of the trip affected by a change.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="TripInfoResult" type="TripInfoResultStructure" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Details about the affected dated journeys of the trip.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="TripInfoResponseContext" type="ResponseContextStructure" minOccurs="0">
<xs:annotation>
<xs:documentation>Response context aggregated for all TripInfoResults.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="AlternativeTrip" type="TripResultStructure" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Alternatives to a delayed or otherwise compromised trip.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="FacilityCondition" type="siri:FacilityConditionStructure" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Results from SIRI facility monitoring service.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:annotation>
<xs:documentation>========================================== Problems ==========================================</xs:documentation>
</xs:annotation>
<xs:simpleType name="TripMonitoringProblemTypeEnumeration">
<xs:annotation>
<xs:documentation>Types of problems that may be returned in responses to trip monitoring requests.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="TRIPMONITORING_SUBSCRIPTION_REGISTERED">
<xs:annotation>
<xs:documentation>Used to acknowledge the reception and successful registration of a subscription request.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="TRIPMONITORING_SUBSCRIPTION_TERMINATED">
<xs:annotation>
<xs:documentation>Used to indicate the termination of the subscription.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="TRIPMONITORING_MAJOR_DELAY">
<xs:annotation>
<xs:documentation>The trip is likely to be delayed by more than 15 minutes.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="TRIPMONITORING_MINOR_DELAY">
<xs:annotation>
<xs:documentation>The trip has a predicted delay of less than an hour.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="TRIPMONITORING_SHORTENED_TRANSFER_TIME">
<xs:annotation>
<xs:documentation>One of the transfers will be shorter than planned.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="TRIPMONITORING_TRIPREQUEST_ORIGIN_UNKNOWN">
<xs:annotation>
<xs:documentation>The departure location is unknown.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="TRIPMONITORING_TRIPREQUEST_DESTINATION_UNKNOWN">
<xs:annotation>
<xs:documentation>The destination location is unknown.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="TRIPMONITORING_TRIP_UNKNOWN">
<xs:annotation>
<xs:documentation>The trip to be monitored is unknown.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="TRIPMONITORING_MONITORING_INTERVAL_INALID">
<xs:annotation>
<xs:documentation>The time window to send notfications is invalid, e.g., too early before the departure time. The service is nevertheless invoked, with the time window restricted to a valid interval.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="TRIPMONITORING_FACILITY_UNKNOWN">
<xs:annotation>
<xs:documentation>A facility specified in FacilityMonitoringSubscription is unknown.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="TRIPMONITORING_OTHER">
<xs:annotation>
<xs:documentation>A problem has occurred that does not have a specific problem type.</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="TripMonitoringProblemStructure">
<xs:annotation>
<xs:documentation>Problem that may be returned in responses to trip monitoring requests.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="Type" type="TripMonitoringProblemTypeEnumeration">
<xs:annotation>
<xs:documentation>Type of the trip monitoring problem.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:group ref="ProblemDetailGroup"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
1 change: 1 addition & 0 deletions docs/generate_tables/custom-ojp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
<xsd filePath="ojp/OJP_PlaceSupport.xsd"/>
<xsd filePath="ojp/OJP_StopEvents.xsd"/>
<xsd filePath="ojp/OJP_TripInfo.xsd"/>
<xsd filePath="ojp/OJP_TripMonitoring.xsd"/>
<xsd filePath="ojp/OJP_Trips.xsd"/>
<xsd filePath="ojp/OJP_JourneySupport.xsd"/>
<xsd filePath="ojp/OJP_Availability.xsd"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<OJP xmlns="http://www.vdv.de/ojp" xmlns:siri="http://www.siri.org.uk/siri" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1-dev" xsi:schemaLocation="http://www.vdv.de/ojp ../../../OJP.xsd">
<OJPRequest>
<siri:DataSupplyRequest>
<siri:RequestTimestamp>2023-03-17T09:30:47-05:00</siri:RequestTimestamp>
<siri:ConsumerRef>1231123</siri:ConsumerRef>
<siri:MessageIdentifier>7788788788</siri:MessageIdentifier>
<siri:AllData>true</siri:AllData>
</siri:DataSupplyRequest>
</OJPRequest>
</OJP>
Loading

0 comments on commit b0f42f5

Please sign in to comment.