You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -57,7 +57,7 @@ The following information applies to all `policy` API endpoints.
57
57
58
58
### Background
59
59
60
-
The goal of the Policy API specification is to enable agencies to create, revise, and publish machine-readable policies (in real-time if needed), as sets of rules for individual and collective device behavior exhibited by both _mobility as a service_ providers and riders / users. [Examples](./examples/README.md) of policies include:
60
+
The goal of the Policy API specification is to enable public agencies to create, revise, and publish machine-readable policies (in near real-time if needed), as sets of rules for individual and collective device behavior exhibited by both _mobility as a service_ providers and riders / users. [Examples](./examples/README.md) of policies include:
61
61
62
62
- City-wide and localized caps (e.g. "Minimum 500 and maximum 3000 scooters within city boundaries")
63
63
- Exclusion zones (e.g. "No scooters are permitted in this district on weekends")
@@ -80,7 +80,7 @@ See the [Policy Examples](./examples/README.md) for ways Policy can be implement
80
80
81
81
### Authorization
82
82
83
-
The Policy endpoints should be made public. Authorization is not required.
83
+
The Policy endpoints should be made public. Authorization is not required. Agencies may make reasonable accommodations to manage their endpoints, for example, using an API key that has a clear, public way to obtain.
84
84
85
85
[Top][toc]
86
86
@@ -114,6 +114,8 @@ Policies shall be published by regulatory bodies or their authorized delegates a
114
114
115
115
Policies typically refer to one or more associated geographies. Geographic information is obtained from the MDS [Geography](/geography) API. Each policy and geography shall have a unique ID (UUID).
116
116
117
+
Policies must be unique. A Policy may not have the exact same [Policy](#policy) object field values with a different `policy_id`. For example if the `mode_id`, `provider_ids`, `start_date`, `end_date`, and `rules` fields have the same values, that is the same Policy and must not be duplicated as two different policies in the Policy payload.
118
+
117
119
Geographical data shall be represented as GeoJSON `Feature` objects. No part of the geographical data should be outside the [municipality boundary][muni-boundary].
118
120
119
121
Policies should be re-fetched whenever:
@@ -164,7 +166,7 @@ _Query Parameters:_
164
166
|`policy_id`| UUID | Optional | If provided, returns one policy object with the matching UUID; default is to return all policy objects. |
165
167
|`start_date`|[timestamp][ts]| Optional | Beginning date of the queried time range; the default value is the request time |
166
168
|`end_date`|[timestamp][ts]| Optional | Ending date of the queried time range; the default value is null, which captures all policies that are effective in the future|
167
-
|`last_updated`| Boolean | Optional | If true, the endpoint only returns three fields: `version`, `last_updated`, "end_date`. Useful to quickly check when any data in the file has last been changed, without downloading the entire Policy payload. |
169
+
|`last_updated`| Boolean | Optional | If true, the endpoint only returns two fields: `version`, `last_updated`. Useful to quickly check when any data in the file has last been changed, without downloading the entire Policy payload. |
168
170
|`active_only`| Boolean | Optional | If true, return only the current active and future policies, not the retired/previous policies. Any policy that is a prev_policies would not be returned. However, the array of prev_policies still will be returned for reference as part of any relevant active policy. Useful to reduce the Policy payload size for use cases where you do not need to know the previous policy details. |
169
171
170
172
`start_date` and `end_date` are only considered when no `id` parameter is provided. They should return any policy whose effectiveness overlaps with or is contained with this range. Suppose there's a policy with a `start_date` of 1/1/21 and `end_date` of 1/31/21. Assuming an `end_date` that is null, 12/1/20 and 1/5/21 `start_dates` will return the policy, but 2/10/21 wouldn't. Assuming a `start_date` parameter of say, 11/1/20, then an `end_date` of 12/1/20 wouldn't return the policy, but 1/5/21 and 2/10/21 would. Lastly, a `start_date` of 1/5/21 and `end_date` of 1/6/21 would also return the policy. Please note also that while dates in the format MM:DD:YY are being used here, `start_date` and `end_date` must be numbers representing milliseconds since the Unix epoch time.
@@ -465,6 +467,38 @@ The internal mechanics of ordering are up to the Policy editing and hosting soft
465
467
466
468
[Top][toc]
467
469
470
+
### Policy Relationship Diagram
471
+
472
+
```mermaid
473
+
---
474
+
title: MDS Policy relationships
475
+
---
476
+
classDiagram
477
+
Policy <|-- Rules
478
+
Policy <|-- Previous_Policies
479
+
Rules <|-- Rule_Type
480
+
Rules <|-- Rule_Units
481
+
Rules <|-- Geographies
482
+
class Policy{
483
+
Policy ID
484
+
Rule IDs
485
+
Mode ID
486
+
Provider ID
487
+
Start Date
488
+
End Date
489
+
...
490
+
}
491
+
class Rules{
492
+
Rule Type
493
+
Rule Units
494
+
Geographies
495
+
States
496
+
...
497
+
}
498
+
```
499
+
[Top][toc]
500
+
501
+
468
502
### Requirement
469
503
470
504
A public agency's Policy program Requirements endpoint enumerates all of the parts of MDS, [CDS](https://github.com/openmobilityfoundation/curb-data-specification), GBFS, and other specifications that an agency requires from providers for certain programs, including APIs, endpoints, and optional fields, as well as information for providers about the APIs the agency is hosting. The program requirements are specific to the needs and use cases of each agency, and ensure there is clarity on what data is being asked for in operating policy documents from providers, reducing the burden on both. This also allows additional public transparency and accountability around data requirements from agencies, and encourages privacy by allowing agencies to ask for only the data they need.
0 commit comments