diff --git a/schemas/data-ingress/darwin-data/darwin-TS.json b/schemas/data-ingress/darwin-data/darwin-TS.json new file mode 100644 index 0000000..19ae075 --- /dev/null +++ b/schemas/data-ingress/darwin-data/darwin-TS.json @@ -0,0 +1,190 @@ +{ + "$id": "https://schema.owlboard.info/data-ingress/darwin/TS.schema.json", + "$schema": "https://json-schema.org/draft-07/schema#", + "title": "DarwinTSData", + "type": "object", + "required": [ + "rid", + "ssd", + "locs", + "rf" + ], + "additionalProperties": false, + "properties": { + "rid": { + "type": "string", + "name": "RID", + "description": "The RID of the service that the data applies to" + }, + "uid": { + "type": "string", + "name": "UID", + "description": "The UID of the timetable entry for this service" + }, + "ssd": { + "type": "string", + "format": "date", + "name": "Service Start Date", + "description": "The date on which the service commences" + }, + "rf": { + "type": "boolean", + "name": "isReverseFormation", + "description": "Whether the service is running in reverse formation" + }, + "lr": { + "type": "object", + "name": "Late Reason", + "description": "Late Reason Object", + "additionalProperties": false, + "required": [ + "c" + ], + "properties": { + "c": { + "type": "integer", + "name": "Reason code", + "description": "The reason code for the delay" + }, + "t": { + "type": "string", + "name": "TIPLOC", + "description": "The TIPLOC where the delay occurred" + }, + "n": { + "type": "boolean", + "name": "Near", + "description": "Whether the delay occurred NEAR the TIPLOC, otherwise at the TIPLOC" + } + } + }, + "locs" : { + "type": "array", + "items": {"$ref": "#/definitions/location"} + } + }, + "definitions": { + "location": { + "type": "object", + "required": ["t"], + "properties": { + "t": { + "type": "string", + "name": "TIPLOC", + "description": "The TIPLOC of the location" + }, + "wta": { + "type": "string", + "name": "Working Time of Arrival", + "description": "The scheduled arrival time from the working timetable" + }, + "wtd": { + "type": "string", + "name": "Working Time of Departure", + "description": "The scheduled departure time from the working timetable" + }, + "pta": { + "type": "string", + "name": "Public Time of Arrival", + "description": "The scheduled arrival time from the public timetable" + }, + "ptd": { + "type": "string", + "name": "Public time of departure", + "description": "The scheduled departure time from the public timetable" + }, + "wtp": { + "type": "string", + "name": "Working pass time", + "description": "The scheduled pass time from the working timetable" + }, + "d": { + "name": "Departure data", + "$ref": "#/definitions/forecastTime" + }, + "a": { + "name": "Arrival data", + "$ref": "#/definitions/forecastTime" + }, + "p": { + "name": "Pass data", + "$ref": "#/definitions/forecastTime" + }, + "plt": { + "name": "Platform data", + "$ref": "#/definitions/platformStatus" + } + } + }, + "forecastTime": { + "type": "object", + "name": "Forecast/Actual Time", + "properties": { + "et": { + "type": "string", + "name": "Estimated Time", + "description": "The estimated time of this event" + }, + "at": { + "type": "string", + "name": "Actual Time", + "description": "The actual time of this event" + }, + "wet": { + "type": "string", + "name": "Working Estimated Time", + "description": "The estimated 'working' time" + }, + "atRem": { + "type": "boolean", + "name": "AT Removal", + "description": "If true, previous AT given was not valid, delete it" + }, + "del": { + "type": "boolean", + "name": "Delayed", + "description": "If this train is delayed (Display delayed if no ET/AT)" + }, + "src": { + "type": "string", + "name": "Data source", + "description": "The source of this data (Darwin/Trust/CIS etc)" + } + } + }, + "platformStatus": { + "type": "object", + "name": "PlatformData", + "required": [ + "sup" + ], + "properties": { + "sup": { + "type": "boolean", + "name": "Suppressed", + "description": "Whether the platform is suppressed (hidden to public)" + }, + "n": { + "type": "string", + "name": "Platform Number", + "description": "The platform at which this event will occur" + }, + "src": { + "type": "string", + "name": "Data source", + "description": "The name of the source of the platform data" + }, + "c": { + "type": "boolean", + "name": "Platform Confirmed", + "description": "Whether the platform has been confirmed by local CIS" + }, + "cisSup": { + "type": "boolean", + "name": "CIS suppressed", + "description": "Whether the local CIS has suppressed the platform (not needed to determine whether to suppress or not)" + } + } + } + } +} \ No newline at end of file