Skip to content

Commit d72659d

Browse files
authored
Merge pull request #763 from openmobilityfoundation/feature-modes-passenger-services
Feature: modes - passenger services. Merging back to main modes feature branch to allow consistent work on other modes.
2 parents c219154 + 4920f72 commit d72659d

13 files changed

Lines changed: 635 additions & 139 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
- [Versions](#versions)
1111
- [Technical Information](#technical-information)
1212
- [Get Involved](#get-involved)
13-
- [Membership](#membership)
13+
- [Membership](#membership)
1414
- [Cities Using MDS](#cities-using-mds)
1515
- [Providers Using MDS](#providers-using-mds)
1616
- [Software Companies Using MDS](#software-companies-using-mds)

agency/README.md

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ A vehicle record is as follows:
8484
| `vehicle_id` | String | Vehicle Identification Number (vehicle_id) visible on vehicle |
8585
| `vehicle_type` | Enum | [Vehicle Type][vehicle-types] |
8686
| `propulsion_types` | Enum[] | Array of [Propulsion Type][propulsion-types]; allows multiple values |
87-
| `vehicle_attributes` | Array of [vehicle attributes](/modes/#vehicle-attributes) | Vehicle attributes appropriate for the current mode |
87+
| `vehicle_attributes` | Array of [vehicle attributes](/modes/#vehicle-attributes) | Vehicle attributes appropriate for the current [mode][modes] |
8888
| `state` | Enum | Current vehicle state. See [Vehicle State][vehicle-states] |
8989
| `prev_events` | Enum[] | Last [Vehicle Event][vehicle-events] |
9090
| `updated` | [timestamp][ts] | Date of last event update |
@@ -111,7 +111,7 @@ Body Params:
111111
| `vehicle_type` | Enum | Required | [Vehicle Type][vehicle-types] |
112112
| `mode` | Enum | Required | [Mobility Mode][modes] |
113113
| `propulsion_types` | Enum[] | Required | Array of [Propulsion Type][propulsion-types]; allows multiple values |
114-
| `vehicle_attributes` | Array of [vehicle attributes](/modes/#vehicle-attributes) | Vehicle attributes appropriate for the current mode |
114+
| `vehicle_attributes` | Conditionally Required | Array of [vehicle attributes](/modes/#vehicle-attributes) | Vehicle attributes appropriate for the current [mode][modes] |
115115

116116
201 Success Response:
117117

@@ -143,7 +143,7 @@ Body Params:
143143

144144
| Field | Type | Required/Optional | Field Description |
145145
| ------------ | ------- | ----------------- | -------------------------------------------------------------------- |
146-
| `vehicle_id` | String | Required | Vehicle Identification Number (vehicle_id) visible on vehicle |
146+
| `vehicle_id` | String | Required | License Plate (if present) or VIN visible on a vehicle |
147147

148148
200 Success Response:
149149

@@ -164,7 +164,7 @@ _No content returned if no vehicle matching `device_id` is found._
164164

165165
## Vehicle - Event
166166

167-
The vehicle `/event` endpoint allows the Provider to control the state of the vehicle including deregister a vehicle from the fleet.
167+
The vehicle `/event` endpoint allows the Provider to control the state of the vehicle.
168168

169169
Endpoint: `/vehicles/{device_id}/event`
170170
Method: `POST`
@@ -177,14 +177,14 @@ Path Params:
177177

178178
Body Params:
179179

180-
| Field | Type | Required/Optional | Field Description |
181-
| ----------- | ----------------------------- | -------- | -------------------------------------------------------------------------------- |
182-
| `vehicle_state` | Enum | Required | see [Vehicle States][vehicle-states] |
183-
| `event_types` | Enum[] | Required | see [Vehicle Events][vehicle-events] |
184-
| `timestamp` | [timestamp][ts] | Required | Date of last event update |
185-
| `telemetry` | [Telemetry](#telemetry-data) | Required | Single point of telemetry. |
180+
| Field | Type | Required/Optional | Field Description |
181+
|-----------------|------------------------------|------------------------|------------------------------------------------------------------------------------------------------------|
182+
| `vehicle_state` | Enum | Required | see [Vehicle States][vehicle-states] |
183+
| `event_types` | Enum[] | Required | see [Vehicle Events][vehicle-events] |
184+
| `timestamp` | [timestamp][ts] | Required | Date of last event update |
185+
| `telemetry` | [Telemetry](#telemetry-data) | Required | Single point of telemetry |
186186
| `event_geographies` | UUID[] | Optional | **[Beta feature](/general-information.md#beta-features):** *Yes (as of 1.1.0)*. Array of Geography UUIDs consisting of every Geography that contains the location of the event. See [Geography Driven Events][geography-driven-events]. Required if `telemetry` is not present. |
187-
| `trip_id` | UUID | Optional | UUID provided by Operator to uniquely identify the trip. Required if `event_types` contains `trip_start`, `trip_end`, `trip_cancel`, `trip_enter_jurisdiction`, or `trip_leave_jurisdiction` |
187+
| `trip_id` | UUID | Conditionally required | UUID provided by Operator to uniquely identify the trip. See `trip_id` requirements for each [mode][modes]. |
188188

189189
201 Success Response:
190190

@@ -323,6 +323,8 @@ Path Params:
323323

324324
If `stop_id` is specified, `GET` will return an array with a single stop record, otherwise it will be a list of all stop records.
325325

326+
[Top][toc]
327+
326328
## Reservation Type
327329

328330
The reservation type enum expresses the urgency of a given reservation. This can be useful when attempting to quantify metrics around trips: for example, computing passenger wait-time. In the `on_demand` case, passenger wait-time may be quantified by the delta between the `reservation_time`, and the pick-up time; however, in the `scheduled` case, the wait time may be quantified based on the delta between the `scheduled_trip_start_time` found in the Trips payload, and the actual `trip_start_time`.
@@ -332,6 +334,8 @@ The reservation type enum expresses the urgency of a given reservation. This can
332334
| `on_demand` | The passenger requested the vehicle as soon as possible |
333335
| `scheduled` | The passenger requested the vehicle for a scheduled time in the future |
334336

337+
[Top][toc]
338+
335339
## Reservation Method
336340

337341
The reservation method enum describes the different ways in which a passenger can create their reservation.
@@ -342,6 +346,8 @@ The reservation method enum describes the different ways in which a passenger ca
342346
| `street_hail` | Reservation was made by the passenger hailing the vehicle |
343347
| `phone_dispatch` | Reservation was made by calling the dispatch operator |
344348

349+
[Top][toc]
350+
345351
## Fare
346352

347353
The Fare object describes a fare for a Trip.
@@ -354,6 +360,8 @@ The Fare object describes a fare for a Trip.
354360
| currency | string | Required | ISO 4217 currency code |
355361
| payment_methods | `string[]` | Optional | Breakdown of different payment methods used for a trip, e.g. cash, card, equity_program |
356362

363+
[Top][toc]
364+
357365
## Trip Metadata
358366

359367
The Trips endpoint serves two purposes:
@@ -394,9 +402,9 @@ Payload which was POST'd
394402
| `bad_param` | A validation error occurred. | Array of parameters with errors |
395403
| `missing_param` | A required parameter is missing. | Array of missing parameters |
396404

397-
398405
[Top][toc]
399406

407+
[accessibility-options]: /general-information.md#accessibility-options
400408
[beta]: /general-information.md#beta-features
401409
[general]: /general-information.md
402410
[geography-driven-events]: /general-information.md#geography-driven-events
@@ -409,6 +417,6 @@ Payload which was POST'd
409417
[toc]: #table-of-contents
410418
[ts]: /general-information.md#timestamps
411419
[vehicle-types]: /general-information.md#vehicle-types
412-
[vehicle-states]: /modes#vehicle-states
413-
[vehicle-events]: /modes#event-types
420+
[vehicle-states]: /modes/vehicle_states.md
421+
[vehicle-events]: /modes/event_types.md
414422
[versioning]: /general-information.md#versioning

general-information.md

Lines changed: 59 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,36 @@
11
# Mobility Data Specification: **General information**
22

3-
This document contains specifications that are shared between the various MDS APIs such as [`agency`][agency], [`policy`][policy], [`provider`][provider], etc.
3+
This document contains specifications that are shared between the various MDS [APIs and endpoints](/README.md#endpoints).
44

55
## Table of Contents
66

7-
* [Beta Features](#beta-features)
8-
* [Costs and Currencies](#costs-and-currencies)
9-
* [Definitions](#definitions)
10-
* [Devices](#devices)
11-
* [Geographic Data][geo]
12-
* [Geographic Telemetry Data](#geographic-telemetry-data)
13-
* [Stop-based Geographic Data](#stop-based-geographic-data)
14-
* [Intersection Operation](#intersection-operation)
15-
* [Geography-Driven Events](#geography-driven-events)
16-
* [Optional Authentication](#optional-authentication)
17-
* [Propulsion Types](#propulsion-types)
18-
* [Responses](#responses)
19-
* [Error Messages](#error-messages)
20-
* [Strings](#strings)
21-
* [Stops](#stops)
22-
* [Stop Status](#stop-status)
23-
* [GBFS Compatibility](#gbfs-compatibility)
24-
* [Timestamps](#timestamps)
25-
* [UUIDs](#uuids)
26-
* [Vehicle States](#vehicle-states)
27-
* [Event Types](#event-types)
28-
* [Vehicle State Events](#vehicle-state-events)
29-
* [State Machine Diagram](#state-machine-diagram)
30-
* [Vehicle Types](#vehicle-types)
31-
* [Versioning](#versioning)
7+
- [Beta Features](#beta-features)
8+
- [Costs and Currencies](#costs-and-currencies)
9+
- [Definitions](#definitions)
10+
- [Devices](#devices)
11+
- [Geographic Data](#geographic-data)
12+
- [Geographic Telemetry Data](#geographic-telemetry-data)
13+
- [Stop-based Geographic Data](#stop-based-geographic-data)
14+
- [Intersection Operation](#intersection-operation)
15+
- [Geography-Driven Events](#geography-driven-events)
16+
- [Optional Authentication](#optional-authentication)
17+
- [Responses](#responses)
18+
- [Error Messages](#error-messages)
19+
- [Strings](#strings)
20+
- [Stops](#stops)
21+
- [Stop Status](#stop-status)
22+
- [GBFS Compatibility](#gbfs-compatibility)
23+
- [Timestamps](#timestamps)
24+
- [UUIDs](#uuids)
25+
- [Vehicle Characteristics](#vehicle-characteristics)
26+
- [Accessibility Options](#accessibility-options)
27+
- [Propulsion Types](#propulsion-types)
28+
- [Vehicle Types](#vehicle-types)
29+
- [Vehicle States](#vehicle-states)
30+
- [Event Types](#event-types)
31+
- [Vehicle State Events](#vehicle-state-events)
32+
- [State Machine Diagram](#state-machine-diagram)
33+
- [Versioning](#versioning)
3234

3335
## Beta Features
3436

@@ -176,19 +178,6 @@ Note if implementing the beta feature [Geography Driven Events](/general-informa
176178

177179
[Top][toc]
178180

179-
## Propulsion Types
180-
181-
| `propulsion` | Description |
182-
| ----------------- | ------------------------------------------------------ |
183-
| `human` | Pedal or foot propulsion |
184-
| `electric_assist` | Provides power only alongside human propulsion |
185-
| `electric` | Contains throttle mode with a battery-powered motor |
186-
| `combustion` | Contains throttle mode with a gas engine-powered motor |
187-
188-
A vehicle may have one or more values from the `propulsion`, depending on the number of modes of operation. For example, a scooter that can be powered by foot or by electric motor would have the `propulsion` represented by the array `['human', 'electric']`. A bicycle with pedal-assist would have the `propulsion` represented by the array `['human', 'electric_assist']` if it can also be operated as a traditional bicycle.
189-
190-
[Top][toc]
191-
192181
## Responses
193182

194183
* **200:** OK: operation successful.
@@ -251,7 +240,6 @@ Stops describe vehicle trip start and end locations in a pre-designated physical
251240
| devices | UUID[] | Optional | List of device_ids for vehicles which are currently at this stop |
252241
| image_url | URL | Optional | Link to an image, photo, or diagram of the stop. Could be used by providers to help riders find or use the stop. |
253242

254-
255243
### Stop Status
256244

257245
**Stop Status** returns information about the current status of a **[Stop](#stops)**.
@@ -272,6 +260,8 @@ Example of the **Stop Status** object with properties listed:
272260
}
273261
```
274262

263+
[Top][toc]
264+
275265
### GBFS Compatibility
276266

277267
Some of the fields in the `Stops` definition are using notions which are currently not in MDS, such as `rental_methods`. These fields are included for compatibility with GBFS.
@@ -294,13 +284,13 @@ MDS uses Version 1 UUIDs by default. Version 4 UUIDs may be used where noted.
294284

295285
## Vehicle States
296286

297-
See new location in [vehicle states](/modes/vehicle_states.md) within [modes](/modes#vehicle-states).
287+
See new location within [vehicle states](/modes/vehicle_states.md) in [modes](/modes#vehicle-states).
298288

299289
[Top][toc]
300290

301291
### Event Types
302292

303-
See new location in [event types](/modes/event_types.md) within [modes](/modes#event-types).
293+
See new location within [event types](/modes/event_types.md) in [modes](/modes#event-types).
304294

305295
[Top][toc]
306296

@@ -316,7 +306,32 @@ See new location within [individual modes](/modes#list-of-supported-modes) in [m
316306

317307
[Top][toc]
318308

319-
## Vehicle Types
309+
## Vehicle Characteristics
310+
311+
Properties and characteristics of vehicles and devices.
312+
313+
[Top][toc]
314+
315+
### Accessibility Options
316+
317+
See new location within [individual modes](/modes#list-of-supported-modes) in [modes](/modes#accessibility-options).
318+
319+
[Top][toc]
320+
321+
### Propulsion Types
322+
323+
| `propulsion` | Description |
324+
| ----------------- | ------------------------------------------------------ |
325+
| `human` | Pedal or foot propulsion |
326+
| `electric_assist` | Provides power only alongside human propulsion |
327+
| `electric` | Contains throttle mode with a battery-powered motor |
328+
| `combustion` | Contains throttle mode with a gas engine-powered motor |
329+
330+
A vehicle may have one or more values from the `propulsion`, depending on the number of modes of operation. For example, a scooter that can be powered by foot or by electric motor would have the `propulsion` represented by the array `['human', 'electric']`. A bicycle with pedal-assist would have the `propulsion` represented by the array `['human', 'electric_assist']` if it can also be operated as a traditional bicycle.
331+
332+
[Top][toc]
333+
334+
### Vehicle Types
320335

321336
The list of allowed `vehicle_type` values in MDS. Aligning with [GBFS vehicle types form factors](https://github.com/NABSA/gbfs/blob/master/gbfs.md#vehicle_typesjson-added-in-v21-rc).
322337

@@ -364,6 +379,7 @@ If an unsupported or invalid version is requested, the API must respond with a s
364379
[geo]: #geographic-data
365380
[geojson-feature]: https://tools.ietf.org/html/rfc7946#section-3.2
366381
[geojson-point]: https://tools.ietf.org/html/rfc7946#section-3.1.2
382+
[modes]: /modes/README.md
367383
[policy]: /policy/README.md
368384
[provider]: /provider/README.md
369385
[st-intersects]: https://postgis.net/docs/ST_Intersects.html

modes/README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ All MDS APIs should be mode-agnostic.
66

77
## Table of Contents
88

9-
* [Modes](#modes)
10-
* [List of Supported Modes](#list-of-supported-modes)
11-
* [Mode Attributes](#mode-attributes)
12-
* [Unique Mode Properties](#unique-mode-properties)
9+
- [Modes](#modes)
10+
- [List of Supported Modes](#list-of-supported-modes)
11+
- [Mode Attributes](#mode-attributes)
12+
- [Unique Mode Properties](#unique-mode-properties)
1313

1414
## Modes
1515

16-
The `mode` value is used to specify the applicable mobility category in MDS Policy, MDS Jurisdictions, and other parts of the spec. The only currently supported mode is `micromobility`, but others such as taxi and delivery robots are planned.
16+
The `mode` value is used to specify the applicable mobility category in MDS Policy, MDS Jurisdictions, and many other parts of MDS.
1717

1818
A `mode` is defined as: A distinct regulatory framework for a type of mobility service, as distinguished by a combination of a) the data needed by regulators, b) the operating rules under which the service functions, c) the legal authority under which it is regulated, and the d) design and operating model of the service itself.
1919

20-
There will be some gray areas and some differences from one jurisdiction to another (e.g. taxis and ridehail may be regulated under the same rules on one place, but different rules in another). We do not need to pre-define a complete taxonomy of modes, or identify every modal boundary upfront, but would instead add modes on an as-needed basis, maintaining as much consistency of naming as possible.
20+
There will be some gray areas and some differences from one jurisdiction to another (e.g. taxis and ridehail may be regulated under the same rules on one place, but different rules in another). MDS will not pre-define a complete taxonomy of modes, or identify every modal boundary upfront, but will instead add modes on an as-needed basis, maintaining as much consistency of naming as possible.
2121

22-
We should err on the side of treating highly similar services as one mode, but should consult with our members and community to inform each decision about how to integrate a new service and whether it needs to be designated as its own mode. This is a policy implementation question as much as it is a technical one.
22+
We err on the side of treating highly similar services as one mode, but consult with our members and community to inform each decision about how to integrate a new service and whether it needs to be designated as its own mode. This is a policy implementation question as much as it is a technical one.
2323

2424
Each mode defined in MDS shall include key descriptive information, such as journey type (e.g. point-to-point, multi-segment, multi-segment overlapping), primary purpose (goods, single passenger, multi-passenger, etc.), and a description of the service being offered that aligns with terminology commonly understood by the public (e.g. “e-scooter” or “ridehailing”).
2525

@@ -62,6 +62,10 @@ The `trip_attributes` array allows additional mode-specific information about th
6262

6363
The `vehicle_attributes` array returns a list of JSON-formatted key/value pairs which correspond to the allowed attributes and values for the operative mode. For each mode, the allowed attributes and corresponding values are defined in the [mode definition](#list-of-supported-modes).
6464

65+
### Accessibility Options
66+
67+
The `accessibility_options` array returns a list of JSON-formatted key/value pairs which correspond to the allowed accessibility attributes and values for the operative mode. For each mode, the allowed attributes and corresponding values are defined in the [mode definition](#list-of-supported-modes).
68+
6569
[Top][toc]
6670

6771
## Unique Mode Properties

modes/event_types.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,18 @@ As with all MDS definitions, they should be described in a way that maximizes th
1414
| `comms_restored` | Communications restored |
1515
| `compliance_pick_up` | Pick up for compliance (rule violation) |
1616
| `decommissioned` | Decommissioned |
17+
| `driver_cancellation` | Driver cancelled a trip |
1718
| `located` | Located (opposite of Missing) |
1819
| `maintenance` | General maintenance |
1920
| `maintenance_pick_up` | Pick up for maintenance |
2021
| `missing` | Missing |
2122
| `off_hours` | Off hours - end of service |
2223
| `on_hours` | On hours - start of service |
24+
| `passenger_cancellation` | Passenger cancelled a trip |
25+
| `provider_cancellation` | Provider cancelled a trip |
2326
| `provider_drop_off` | Drop off by the provider |
2427
| `rebalance_pick_up` | Pick up for rebalancing |
25-
| `reservation_cancel` | Reservation canceled |
28+
| `reservation_cancel` | Reservation cancelled |
2629
| `reservation_start` | Reservation started |
2730
| `system_resume` | Resume system operations, e.g. start of day |
2831
| `system_suspend` | Suspend system operations, e.g. end of day |
File renamed without changes.

0 commit comments

Comments
 (0)