-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapc-from-vehicle.schema.json
106 lines (106 loc) · 4.56 KB
/
apc-from-vehicle.schema.json
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
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://waltti.fi/schema/bundle/1-2-0/apc-from-vehicle.schema.json",
"title": "APC data from a vehicle",
"description": "A single message of automatic passenger counting (APC) data sent from a vehicle to a centralized server. Inspired by the Helsinki Regional Transport Authority (HSL) APC interface and the ITxPT APC specification.",
"type": "object",
"properties": {
"APC": {
"description": "A wrapper object for the APC message",
"type": "object",
"properties": {
"schemaVersion": {
"description": "The SchemaVer version number of this JSON schema that this message follows. It must match a published SchemaVer version number from the '$id' key of this JSON schema. A valid value is for example '1-2-0'.",
"type": "string"
},
"countingSystemId": {
"description": "An ID for the onboard APC system in one vehicle. Used to differentiate between different sensor systems from different vendors in different vehicles. E.g. 'vendor1-client2-apc-device3' or possibly a UUIDv4 string. Needs to be universally unique.",
"type": "string"
},
"messageId": {
"description": "UUIDv4 for each unique message",
"type": "string",
"format": "uuid"
},
"tst": {
"description": "A timestamp for when the data was generated. An ISO 8601 UTC timestamp in the strftime format '%Y-%m-%dT%H:%M:%S.%fZ' where '%f' means milliseconds zero-padded on the left. A valid value would be e.g. '2021-11-22T10:57:08.647Z'. Use 24-hour linear smear from noon to noon UTC for leap seconds, like Google: https://developers.google.com/time/smear .",
"type": "string",
"format": "date-time"
},
"vehiclecounts": {
"description": "A JSON version of combining ITxPT PassengerDoorCount with PassengerVehicleCount. The format originates from HSL.",
"type": "object",
"properties": {
"countquality": {
"description": "Information on the quality of counting",
"enum": ["regular", "defect", "other"]
},
"doorcounts": {
"description": "JSON version of ITxPT PassengerDoorCount",
"type": "array",
"items": {
"type": "object",
"properties": {
"door": {
"description": "Identification of the door. For example, the door closest to the front of a bus is '1'. The next door is '2' etc. Trains might have a different naming structure.",
"type": "string",
"minLength": 1
},
"count": {
"description": "JSON version of ITxPT PassengerCounting",
"type": "array",
"items": {
"type": "object",
"properties": {
"class": {
"description": "Information on the passenger type",
"enum": [
"adult",
"child",
"pram",
"bike",
"wheelchair",
"other"
]
},
"in": {
"description": "Number of passengers having boarded",
"type": "integer",
"minimum": 0
},
"out": {
"description": "Number of passengers having alighted",
"type": "integer",
"minimum": 0
}
},
"required": ["class", "in", "out"],
"additionalProperties": true
},
"minItems": 1
}
},
"required": ["door", "count"],
"additionalProperties": true
},
"minItems": 1,
"uniqueItems": true
}
},
"required": ["countquality", "doorcounts"],
"additionalProperties": true
}
},
"required": [
"schemaVersion",
"countingSystemId",
"messageId",
"tst",
"vehiclecounts"
],
"additionalProperties": true
}
},
"required": ["APC"],
"additionalProperties": false
}