2021-08-22 05:55:02 +03:00
|
|
|
{
|
|
|
|
"$schema": "http://json-schema.org/schema",
|
|
|
|
"title": "Train Info InfoFer Scrap Result Schema",
|
|
|
|
"description": "Results of scrapping InfoFer website for train info",
|
|
|
|
"definitions": {
|
|
|
|
"delayType": {
|
|
|
|
"description": "Delay of the train (negative for being early)",
|
2021-08-22 23:55:49 +03:00
|
|
|
"type": "integer"
|
2021-08-22 05:55:02 +03:00
|
|
|
},
|
|
|
|
"stationArrDepTime": {
|
|
|
|
"description": "Time of arrival at/departure from station",
|
|
|
|
"type": ["object", "null"],
|
|
|
|
"properties": {
|
|
|
|
"scheduleTime": {
|
|
|
|
"description": "The time the train is scheduled to arrive/depart",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"status": {
|
|
|
|
"type": ["object", "null"],
|
|
|
|
"properties": {
|
|
|
|
"delay": {
|
|
|
|
"$ref": "#/definitions/delayType"
|
|
|
|
},
|
|
|
|
"real": {
|
|
|
|
"description": "Determines whether delay was actually reported or is an approximation",
|
|
|
|
"type": "boolean"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"required": ["delay", "real"]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"required": ["scheduleTime"]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
2021-08-22 15:41:55 +03:00
|
|
|
"rank": {
|
|
|
|
"description": "The rank of the train",
|
|
|
|
"type": "string",
|
|
|
|
"examples": [
|
|
|
|
"74",
|
|
|
|
"15934"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"number": {
|
|
|
|
"description": "The number of the train",
|
|
|
|
"type": "string",
|
|
|
|
"examples": [
|
|
|
|
"R",
|
|
|
|
"R-E",
|
|
|
|
"IR",
|
|
|
|
"IRN"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"date": {
|
|
|
|
"description": "Date of departure from the first station",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"operator": {
|
|
|
|
"description": "Operator of the train",
|
|
|
|
"type": "string",
|
|
|
|
"examples": [
|
|
|
|
"CFR Călători",
|
|
|
|
"Softrans",
|
|
|
|
"Regio Călători"
|
|
|
|
]
|
|
|
|
},
|
2021-08-22 05:55:02 +03:00
|
|
|
"route": {
|
|
|
|
"description": "Route of the train",
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"from": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"to": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"required": ["from", "to"]
|
|
|
|
},
|
|
|
|
"status": {
|
|
|
|
"description": "Current status of the train",
|
|
|
|
"type": ["object", "null"],
|
|
|
|
"properties": {
|
|
|
|
"delay": {
|
|
|
|
"$ref": "#/definitions/delayType"
|
|
|
|
},
|
|
|
|
"station": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"state": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": ["passing", "arrival", "departure"]
|
|
|
|
}
|
2021-08-23 04:01:18 +03:00
|
|
|
},
|
|
|
|
"required": ["delay", "station", "state"]
|
2021-08-22 05:55:02 +03:00
|
|
|
},
|
|
|
|
"stations": {
|
|
|
|
"description": "List of stations the train stops at",
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"name": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"km": {
|
|
|
|
"description": "The distance the train travelled until reaching this station",
|
2021-08-22 23:55:49 +03:00
|
|
|
"type": "integer"
|
2021-08-22 05:55:02 +03:00
|
|
|
},
|
|
|
|
"stoppingTime": {
|
|
|
|
"description": "The number of minutes the train is scheduled to stop in this station",
|
2021-08-22 23:55:49 +03:00
|
|
|
"type": ["integer", "null"],
|
|
|
|
"minimum": 1
|
2021-08-22 05:55:02 +03:00
|
|
|
},
|
|
|
|
"platform": {
|
|
|
|
"description": "The platform the train stopped at",
|
|
|
|
"type": ["string", "null"]
|
|
|
|
},
|
|
|
|
"arrival": {
|
|
|
|
"$ref": "#/definitions/stationArrDepTime"
|
|
|
|
},
|
|
|
|
"departure": {
|
|
|
|
"$ref": "#/definitions/stationArrDepTime"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"required": ["name", "km"]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2021-08-23 04:01:18 +03:00
|
|
|
"required": ["route", "stations", "rank", "number", "date", "operator"]
|
2021-08-22 05:55:02 +03:00
|
|
|
}
|