summaryrefslogtreecommitdiff
path: root/schema.json
blob: 1e89c985b86e7be953ab6baa9919a71ba9ea3429 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
{
  "$id": "https://git.finalrewind.org/db-zugbildung-to-json/plain/schema.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "DB Fernverkehr train composition plan",
  "type": "object",
  "properties": {
    "deprecated": {
      "type": "boolean",
      "example": false,
      "description": "if true, this JSON export version is no longer supported and will be removed in the future"
    },
    "source": {
      "type": "string",
      "example": "2021_ZpAR_Wi_Endstück.pdf",
      "description": "PDF file used to generate this JSON export"
    },
    "valid": {
      "type": "string",
      "example": "2020-12-13/2021-06-12",
      "description": "ISO 8601 interval describing when this train composition dataset is valid"
    },
    "train": {
      "type": "object",
      "description": "dict mapping train numbers to probably valid train objects",
      "additionalProperties": {
        "$ref": "#/definitions/train"
      }
    }
  },
  "definitions": {
    "traincomposition": {
      "type": "object",
      "properties": {
        "train_variants": {
          "type": "object",
          "description": "dict mapping train numbers to list of possible train objects",
          "additionalProperties": {
            "type": "array",
            "items": {
              "$ref": "#/definitions/train"
            }
          }
        }
      }
    },
    "train": {
      "type": "object",
      "properties": {
        "rawType": {
          "type": "string",
          "example": "ICE-W",
          "description": "train type as specified in train composition PDF"
        },
        "type": {
          "type": "string",
          "example": "ICE 3",
          "description": "scheduled train type as estimated from rawType and wagon data"
        },
        "shortType": {
          "type": "string",
          "example": "3",
          "description": "A short identifier useful to differentiate between train types such as ICE 3 / ICE 3 Redesign or IC1 / IC2 KISS"
        },
        "name": {
          "type": "string",
          "example": "ICE International",
          "description": "train name / line name / description as specified in PDF"
        },
        "empty": {
          "type": "boolean",
          "example": false,
          "description": "true if this is an empty train without passenger service (\"Leerfahrt\")"
        },
        "route": {
          "$ref": "#/definitions/route"
        },
        "commonAttr": {
          "$ref": "#/definitions/trainAttr"
        },
        "attrVariants": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/trainAttr"
          }
        },
        "cycle": {
          "$ref": "#/definitions/cycle"
        },
        "hasWagon": {
          "$ref": "#/definitions/hasWagon"
        },
        "wagons": {
          "$ref": "#/definitions/wagons"
        }
      }
    },
    "route": {
      "type": "object",
      "properties": {
        "preStart": {
          "type": "string",
          "example": "Berlin-Rummelsburg (Triebzuganlage)",
          "description": "station where the train is prepared / provisioned"
        },
        "start": {
          "type": "string",
          "example": "Berlin-Gesundbrunnen (05:53)",
          "description": "first station(s) with passenger service. may contain scheduled departure time."
        },
        "middle": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "end": {
          "type": "string",
          "example": "München (10:02)",
          "description": "terminal station(s) with passenger service. may contain scheduled arrival time."
        },
        "postEnd": {
          "type": "string",
          "description": "station where the train is parked"
        }
      }
    },
    "trainAttr": {
      "type": "object",
      "properties": {
        "brakingPercentage": {
          "type": "integer",
          "example": 177,
          "description": "Bremshundertstel"
        },
        "length": {
          "type": "integer",
          "example": 402,
          "description": "train length (including powercar)"
        },
        "series": {
          "type": "string",
          "example": "406",
          "description": "powercar series"
        },
        "series2": {
          "type": "string",
          "description": "series of second powercar (if present)"
        },
        "station": {
          "type": "string",
          "example": "Basel SBB",
          "description": "station name, may be prefixed with a plus sign"
        },
        "vmax": {
          "type": "integer",
          "example": 300,
          "description": "rated maximum speed in km/h"
        }
      }
    },
    "cycle": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "from": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "to": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "hasWagon": {
      "type": "object",
      "additionalProperties": {
        "type": "boolean",
        "description": "true iff the wagon or locomotive type described by the key is scheduled for the train"
      },
      "example": {
        "174.5": true,
        "DApza": true,
        "DBpbzfa": true,
        "PBpza": true
      }
    },
    "wagons": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "example": "DBpbzfa",
            "description": "wagon or locomotive type"
          },
          "number": {
            "type": "integer",
            "example": 1,
            "description": "wagon number"
          }
        }
      }
    }
  }
}