forked from TOMP-WG/CDS-M
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tomp-cds.yaml
504 lines (475 loc) · 15.3 KB
/
tomp-cds.yaml
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
openapi: 3.0.0
info:
title: City Data Specification
description: This document describes as well the city part of the API as the Transport Operator (or MaaS Provider) part.
version: "0.1"
license:
name: Apache 2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
paths:
/meta-data/:
parameters:
- $ref: '#/components/parameters/apiVersion'
get:
description: This is the meta data used that must be used to construct the data that has to be delivered at the other endpoint. The TOs can get this information before constructing the information they have to supply.
tags:
- City
responses:
'200':
description: The bookings matching the query
content:
application/json:
schema:
$ref: '#/components/schemas/meta-data'
/trip-data/:
parameters:
- $ref: '#/components/parameters/apiVersion'
post:
description: The TO/MP should deliver data on a frequent base. This endpoint must be used.
tags:
- Transport Operator / MaaS Provider
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/data'
responses:
'200':
description: The bookings matching the query
components:
schemas:
meta-data:
type: array
items:
oneOf:
- $ref: '#/components/schemas/feature'
- $ref: '#/components/schemas/dimensionDescription'
- $ref: '#/components/schemas/valuesDescription'
data:
properties:
type:
$ref: '#/components/schemas/featureCollection'
featureCollection:
type: object
description: GeoJSon feature collection. There should be one description feature, one feature with geometry per area to report, one dimensionfeature per dimension (so at least 8 city, origin, destination, mode, year, month, day, hour, day_of_week, week)
required:
- type
- features
externalDocs:
url: https://tools.ietf.org/html/rfc7946#section-3.3
properties:
type:
type: string
enum:
- FeatureCollection
features:
type: array
items:
oneOf:
- $ref: '#/components/schemas/description'
- $ref: '#/components/schemas/feature'
- $ref: '#/components/schemas/dimensionDescription'
- $ref: '#/components/schemas/originDestinationData'
feature:
type: object
description: GeoJSon feature
required:
- type
- id
- geometry
externalDocs:
url: https://tools.ietf.org/html/rfc7946#section-3.2
properties:
type:
type: string
enum:
- Feature
id:
type: integer
geometry:
type: array
items:
oneOf:
- $ref: '#/components/schemas/point'
- $ref: '#/components/schemas/lineString'
- $ref: '#/components/schemas/polygon'
- $ref: '#/components/schemas/multiPoint'
- $ref: '#/components/schemas/multiPolygon'
- $ref: '#/components/schemas/multilineString'
properties:
type: object
description:
type: object
description: the discriptor entry for this dataset. Type should be 'Dataset'
properties:
type:
type: string
enum:
- Feature
geometry:
description: should be null
example: null
properties:
type: object
properties:
type:
type: string
enum: [Dataset]
name:
description: name for this dataset
type: string
description:
description: short description of the dataset
type: string
dimensionDescription:
type: object
description: the discriptor entry for this dataset. Type should be 'Dimension'.
discriminator:
propertyName: type
properties:
type:
type: string
enum:
- Feature
geometry:
description: should be null
example: null
properties:
type: object
properties:
type:
type: string
enum: [Dimension]
name:
$ref: '#/components/schemas/dimensionClasses'
description:
description: short description of the dimension
type: string
dimensionElements:
type: array
items:
anyOf:
- $ref: '#/components/schemas/cityDimension'
- $ref: '#/components/schemas/odDimension'
- $ref: '#/components/schemas/modeDimension'
- $ref: '#/components/schemas/yearDimension'
- $ref: '#/components/schemas/monthDimension'
- $ref: '#/components/schemas/dayDimension'
- $ref: '#/components/schemas/hourDimension'
- $ref: '#/components/schemas/dayOfWeekDimension'
- $ref: '#/components/schemas/weekDimension'
valuesDescription:
type: object
properties:
type:
type: string
enum:
- Feature
geometry:
description: should be null
example: null
properties:
$ref: '#/components/schemas/allValues'
allValues:
type: object
properties:
measumements:
type: array
items:
type: string
enum: [total_movements,unique_users,total_km,total_duration_minutes,total_co2,total_pm10,total_nox,total_number_of_stops,total_non_moving_assets,total_parking_time,total_charging_minutes,total_out_of_geofence]
example:
- total_movements
- unique_users
- total_km
- total_duration_minutes
- total_co2
- total_pm10
- total_nox
- total_number_of_stops
- total_non_moving_assets
- total_parking_time
- total_charging_minutes
- total_out_of_geofence
dimensionClasses:
type: string
description: all available dimensions. The dimensions should be in every originDestinationData. To report data from a specific area (e.g. number of parked assets), you should provide -1 in the destination field.
enum:
- city
- origin
- destination
- mode
- year
- month
- day
- week
- day_of_week
- hour
cityDimension:
type: string
description: The available cities ["Amsterdam", "Antwerp"]
enum:
- Amsterdam
odDimension:
type: number
description: the available id's of the area's in the real features
example: 1
yearDimension:
type: number
description: The allowed years
minimum: 2020
maximum: 2999
example: 2020
modeDimension:
type: string
description: The allowed modalities. to be completed.
enum:
- bike
- scooter
- shared-car
monthDimension:
type: number
description: the month index, starting with January = 1
minimum: 1
maximum: 12
example: 3
dayDimension:
type: number
description: the day index in the month.
minimum: 1
maximum: 31
example: 9
dayOfWeekDimension:
type: number
description: the day of week index. Sunday = 0, Monday = 1 etc
minimum: 0
maximum: 6
example: 1
weekDimension:
type: number
description: the week in the year index (https://en.wikipedia.org/wiki/ISO_week_date).
minimum: 1
maximum: 53
example: 11
hourDimension:
type: number
description: the hour of the measurements. All measurements should be grouped by starting hour.
minimum: 0
maximum: 23
example: 8
originDestinationData:
type: object
description: these objects contain all the information. Besides the dimensions described above, all measured data will be in these objects. Can be extended with custom measurements. The dimensions should be in the dimensions described above.
additionalProperties: true
properties:
type:
type: string
enum:
- Feature
geometry:
description: should be null
example: null
properties:
type: object
properties:
type:
type: string
enum: [TabularDatasetRow]
city:
type: string
origin:
type: number
destination:
type: number
mode:
type: string
year:
type: number
month:
type: number
day:
type: number
hour:
type: number
day_of_week:
type: number
week:
type: number
total_movements:
type: number
description: total amount of movements from origin to destination
unique_users:
type: number
description: unique amount of travellers booking an asset
total_km:
type: number
description: total amount of km of the trips started in this our
total_duration_minutes:
type: number
description: total amount of minutes of the trips started in this our
total_co2:
type: number
description: total amount of exhausted CO2 of the trips started in this our
total_pm10:
type: number
description: total amount of created PM10 of the trips started in this our
total_nox:
type: number
description: total amount of exhausted NOx of the trips started in this our
total_number_of_stops:
type: number
description: total amount of stops longer than 1 minute, starting in the specified hour
total_out_of_geofence:
type: number
description: total amount of assets that have been outside the geofence during the trip
total_non_moving_assets_0:
type: number
description: total amount of assets that are not used in this hour. This property is only applicable for areas. Therefore the destination property should be -1.
total_non_moving_assets_15:
type: number
description: total amount of assets that are not used for over 15 minutes in this hour. This property is only applicable for areas. Therefore the destination property should be -1.
total_non_moving_assets_30:
type: number
description: total amount of assets that are not used for over 30 minutes in this hour. This property is only applicable for areas. Therefore the destination property should be -1.
total_non_moving_assets_45:
type: number
description: total amount of assets that are not used for over 45 minutes in this hour. This property is only applicable for areas. Therefore the destination property should be -1.
total_parking_time:
type: number
description: total amount of minutes that assets are not used (included pauzed). This property is only applicable for areas. Therefore the destination property should be -1.
total_not_used_time:
type: number
description: total amount of minutes that assets are not used (excluded pauzed). This property is only applicable for areas. Therefore the destination property should be -1.
total_charging_minutes:
type: number
description: total duration in minutes that assets are being charged. This property is only applicable for areas. Therefore the destination property should be -1.
geometry:
type: object
description: GeoJSon geometry
required:
- type
discriminator:
propertyName: type
externalDocs:
url: http://geojson.org/geojson-spec.html#geometry-objects
properties:
type:
type: string
description: the geometry type
point:
type: object
description: GeoJSon geometry, WGS84
externalDocs:
url: http://geojson.org/geojson-spec.html#id2
allOf:
- $ref: "#/components/schemas/geometry"
properties:
type:
type: string
enum:
- Point
coordinates:
type: array
minItems: 2
maxItems: 2
example: [4.320554696391217,51.99267196727367]
items:
type: number
lineString:
type: object
description: GeoJSon geometry
externalDocs:
url: http://geojson.org/geojson-spec.html#id3
allOf:
- $ref: "#/components/schemas/geometry"
properties:
type:
type: string
enum:
- LineString
coordinates:
type: array
minItems: 2
items:
$ref: '#/components/schemas/point'
polygon:
type: object
description: GeoJSon geometry
externalDocs:
url: http://geojson.org/geojson-spec.html#id4
allOf:
- $ref: "#/components/schemas/geometry"
properties:
type:
type: string
enum:
- Polygon
coordinates:
type: array
items:
type: array
items:
$ref: '#/components/schemas/point'
multiPoint:
type: object
description: GeoJSon geometry
externalDocs:
url: http://geojson.org/geojson-spec.html#id5
allOf:
- $ref: "#/components/schemas/geometry"
properties:
type:
type: string
enum:
- MultiPoint
coordinates:
type: array
items:
$ref: '#/components/schemas/point'
multilineString:
type: object
description: GeoJSon geometry
externalDocs:
url: http://geojson.org/geojson-spec.html#id6
allOf:
- $ref: "#/components/schemas/geometry"
properties:
type:
type: string
enum:
- MultilineString
coordinates:
type: array
items:
type: array
items:
$ref: '#/components/schemas/point'
multiPolygon:
type: object
description: GeoJSon geometry
externalDocs:
url: http://geojson.org/geojson-spec.html#id6
allOf:
- $ref: "#/components/schemas/geometry"
properties:
type:
type: string
enum:
- Multipolygon
coordinates:
type: array
items:
type: array
items:
type: array
items:
$ref: '#/components/schemas/point'
parameters:
apiVersion:
in: header
name: Api-Version
required: true
schema:
type: string
description: Version of the API.
example: 0.1