Skip to content

Commit 87f8ec1

Browse files
authored
Merge pull request #813 from openmobilityfoundation/feature-requirements-3
Policy Requirements - Use Case Support and move out of beta
2 parents 47fe606 + e1dd234 commit 87f8ec1

2 files changed

Lines changed: 29 additions & 19 deletions

File tree

policy/README.md

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Policies will be returned in order of effective date (see schema below), with pa
149149

150150
### Geographies
151151

152-
**Deprecated:** see the new [Geography API](/geography#transition-from-policy) to understand the transistion away from this endpoint, and how to support both in MDS 1.x.0 releases.
152+
**Deprecated:** see the new [Geography API](/geography#transition-from-policy) to understand the transition away from this endpoint, and how to support both in MDS 1.x.0 releases.
153153

154154
**Endpoint**: `/geographies/{id}`
155155
**Method**: `GET`
@@ -168,8 +168,8 @@ Policies will be returned in order of effective date (see schema below), with pa
168168

169169
**Endpoint**: `/requirements/`
170170
**Method**: `GET`
171-
**[Beta feature](/general-information.md#beta-features)**: *Yes (as of 1.2.0)*. [Leave feedback](https://github.com/openmobilityfoundation/mobility-data-specification/issues/682)
172-
**Schema:** TBD when out of beta
171+
**[Beta feature](/general-information.md#beta-features)**: *No (as of 2.0.0)*.
172+
**Schema:** TBD
173173
**`data` Payload**: `{ requirements: [] }`, JSON objects that follow the schema [outlined here](#requirement).
174174

175175
See [Policy Requirements Examples](/policy/examples/requirements.md) for how this can be implemented.
@@ -337,7 +337,7 @@ An individual `Rule` object is defined by the following fields:
337337

338338
### Geography
339339

340-
**Deprecated:** see the new [Geography API](/geography#transition-from-policy) to understand the transistion away from this endpoint, and how to support both in a MDS 1.x.0 release.
340+
**Deprecated:** see the new [Geography API](/geography#transition-from-policy) to understand the transition away from this endpoint, and how to support both in a MDS 1.x.0 release.
341341

342342
| Name | Type | Required / Optional | Description |
343343
| ---------------- | --------- | --- | ----------------------------------------------------------------------------------- |
@@ -434,7 +434,7 @@ The internal mechanics of ordering are up to the Policy editing and hosting soft
434434

435435
### Requirement
436436

437-
A public agency's Policy program Requirements endpoint enumerates all of the parts of MDS, 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.
437+
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.
438438

439439
Requirements can also be used to define a scaled-down MDS implementation in situations where an agency has more limited regulatory goals, has legal limitations on the types of data they can collect, or wants to use a lightweight version of MDS for a pilot project or other experiment where aspects of a full MDS implementation would be irrelevant or unnecessary.
440440

@@ -454,10 +454,6 @@ If you are upgrading to a new MDS version, it is recommended to create a new req
454454

455455
When requirements are updated within the same MDS version, in the [metadata](#requirement-metadata) section, increment the `file_version` value by one and update the `last_updated` timestamp. Though not required, you may choose to use the `start_date` and `end_date` fields in the [programs](#requirement-programs) section to keep retired requirements accessible. We also recommend hosting your requirements file in a location that has a publicly-accessible version history, like GitHub or Bitbucket, or keeping previous versions accessible with a versioned URL, e.g. "https://mds.cityname.gov/requirements/1.2.0/v3".
456456

457-
#### Beta Limitations
458-
459-
Note that while Requirements is in [beta](#Requirements) in this **minor**, non-breaking MDS 1.2.0 release, items listed as "required" or "disallowed" will be treated as a _request_ only by default (precluding intentional formal agency communications with providers) to prevent an _unintentional_ burden on providers. For the next **major**, breaking MDS 2.0.0 release, these items will be required or disallowed as documented.
460-
461457
#### Requirement Format
462458

463459
An agency's program [Requirements](#requirements) endpoint contains a number of distinct parts, namely [metadata](#requirement-metadata), [program definitions](#requirement-programs), and [data specs](#requirement-data-specs) (with sub sections on relevant [required APIs](#requirement-apis)).
@@ -493,7 +489,7 @@ An agency's program [Requirements](#requirements) endpoint contains a number of
493489
// other data specs per the "Requirement Data Specs" section
494490
]
495491
},
496-
// other MDS versions per the "Requriement MDS Version" section
492+
// other MDS versions per the "Requirement MDS Version" section
497493
}
498494
}
499495
```
@@ -622,7 +618,7 @@ For each combination of items in a program, you can specify the data specs, APIs
622618

623619
| Name | Type | Required / Optional | Description |
624620
| -------------------- | ------ | -------- | ----------------------------------- |
625-
| `data_spec_name` | Enum | Required | Name of the data spec required. Supported values are: '[MDS](https://github.com/openmobilityfoundation/mobility-data-specification/tree/ms-requirements)', '[GBFS](https://github.com/NABSA/gbfs/tree/v2.2)'. Others like GOFS, GTFS, TOMP-API, etc can be tested by agencies and officially standardized here in the future -- leave your feedback on [this issue](https://github.com/openmobilityfoundation/mobility-data-specification/issues/682). |
621+
| `data_spec_name` | Enum | Required | Name of the data spec required. Supported values are: '[MDS](https://github.com/openmobilityfoundation/mobility-data-specification/tree/ms-requirements)', '[CDS](https://github.com/openmobilityfoundation/curb-data-specification)' '[GBFS](https://github.com/NABSA/gbfs/tree/v2.2)'. Others like GOFS, GTFS, TOMP-API, etc may also be referenced now by agencies and officially standardized here in the future -- leave your feedback on [this issue](https://github.com/openmobilityfoundation/mobility-data-specification/issues/682). |
626622
| `version` | Text | Required | Version number of the data spec required. E.g. '1.2.0' |
627623
| `mode` | Text | Optional | The [mode list][modes] shortname for MDS. E.g. 'passenger-services' |
628624
| `required_apis` | Array | Conditionally Required | Name of the [Requirement APIs](#requirement-apis) that need to be served by providers. At least one API is required. APIs not listed will not be available to the agency. |
@@ -632,7 +628,7 @@ For each combination of items in a program, you can specify the data specs, APIs
632628

633629
#### Requirement APIs
634630

635-
For each data specification, you can specify which APIs, endpoints, and fields are required from providers, and which are available from your agency.
631+
For each data specification, you can specify which APIs, endpoints, and fields are required from providers, and which are available from your agency, and the use cases you need the data for.
636632

637633
An agency may require providers to serve optional APIs, endpoints, and fields that are needed for your agency's program. This is a `required_apis` array within the [Requirement Data Specs](#requirement-data-specs) section in the [Requirement](#requirement) data feed.
638634

@@ -659,8 +655,7 @@ You may also show which APIs, endpoints, and fields your agency is serving to pr
659655
},
660656
// other endpoints
661657
]
662-
},
663-
// other APIs in same data spec
658+
}
664659
],
665660
"available_apis": [
666661
{
@@ -677,6 +672,14 @@ You may also show which APIs, endpoints, and fields your agency is serving to pr
677672
// other endpoints
678673
]
679674
}
675+
],
676+
// other APIs in same data spec
677+
"use_cases": [
678+
{
679+
"external_url": "[REFERENCE URL]",
680+
"ids": ["1","2","3"]
681+
},
682+
// next external use case source
680683
]
681684
// ...
682685
```
@@ -685,6 +688,7 @@ You may also show which APIs, endpoints, and fields your agency is serving to pr
685688
| -------------------- | ----- | -------- | ----------------------------------- |
686689
| `api_name` | Text | Required | Name of the applicable API required. At least one API is required. APIs not listed will not be available to the agency. E.g. for MDS: 'provider', or 'agency'. For GBFS, this field is omitted since GBFS starts at the `endpoint` level. |
687690
| `endpoint_name` | Text | Required | Name of the required endpoint under the API. At least one endpoint is required. E.g. for MDS 'provider': 'trips' |
691+
| `use_cases` | Object with Array | Optional | The list of policy uses cases that this data standard's information covers for your program. Includes an `external_url` to a HTTP reference list or database (e.g. to the [OMF Use Case Database](https://airtable.com/shrPf4QvORkjZmHIs/tblzFfU6fxQm5Sdhm)), **and** an array of `ids` of each applicable use case (e.g. "OMF-MDS-31"). You may enumerate multiple external use case sources and ids. |
688692

689693
**Provider Endpoints** - Specific to the `required_apis` array
690694

@@ -707,9 +711,8 @@ You may also show which APIs, endpoints, and fields your agency is serving to pr
707711
- All fields marked 'Required' in MDS are still included by default and should not be enumerated in `required_fields`. They are not affected by the Requirements endpoint, unless explicitly listed in `disallowed_fields`.
708712
- Fields in MDS marked 'Required if available' are still returned if available, and are not affected by the Requirements endpoint, unless explicitly listed in `disallowed_fields`.
709713
- If a 'Required' or 'Required if available' or 'Optional' field in MDS is listed in `disallowed_fields`, those fields should not be returned by the provider in the endpoint. The field (and therefore its value) must be completely removed from the response. If used, [schema](/schema) validation may fail on missing required fields.
710-
- To reference fields that are lower in a heirarchy, use [dot separated notation](https://docs.oracle.com/en/database/oracle/oracle-database/18/adjsn/simple-dot-notation-access-to-json-data.html#GUID-7249417B-A337-4854-8040-192D5CEFD576), where a dot between field names represents one nested level deeper into the data structure. E.g. 'gps.heading' or 'features.properties.rules.vehicle_type_id'.
711-
- To require [Greography Driven Events](/general-information.md#geography-driven-events), simply include the `event_geographies` field for either the Agency or Provider API `api_name`. Per how GDEs work, `event_location` will then not be returned, and the `changed_geographies` vehicle state `event_type` will be used.
712-
- [While in beta](#beta-limitations), items marked as required or disallowed will only be considered a 'request' by providers, unless agencies have communicated with providers outside of MDS.
714+
- To reference fields that are lower in a hierarchy, use [dot separated notation](https://docs.oracle.com/en/database/oracle/oracle-database/18/adjsn/simple-dot-notation-access-to-json-data.html#GUID-7249417B-A337-4854-8040-192D5CEFD576), where a dot between field names represents one nested level deeper into the data structure. E.g. 'gps.heading' or 'features.properties.rules.vehicle_type_id'.
715+
- To require [Geography Driven Events](/general-information.md#geography-driven-events), simply include the `event_geographies` field for either the Agency or Provider API `api_name`. Per how GDEs work, `event_location` will then not be returned, and the `changed_geographies` vehicle state `event_type` will be used.
713716

714717
[Top][toc]
715718

policy/examples/requirements.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ Version 1.1.0 for 2 providers asking for only historic [Provider `/trips`](/prov
318318

319319
## Provider and Other APIs
320320

321-
Version 1.1.0 or 0.4.1 for 3 providers with many APIs and endpoints.
321+
Version 1.1.0 or 0.4.1 for 3 providers with many APIs and endpoints, for two programs: shared dockless and city docked bikes. With use cases added.
322322

323323
Note: by specifying geography, policy, and jurisdiction here with a URL, the agency is in effect saying that they have created and are hosting these, and they are available for use if public.
324324

@@ -431,6 +431,14 @@ Note: by specifying geography, policy, and jurisdiction here with a URL, the age
431431
{
432432
"api_name": "metrics"
433433
}
434+
],
435+
"use_cases": [
436+
{
437+
"external_url": "https://airtable.com/shrPf4QvORkjZmHIs/tblzFfU6fxQm5Sdhm",
438+
"ids": ["OMF-MDS-2","OMF-MDS-8","OMF-MDS-12","OMF-MDS-13","OMF-MDS-14","OMF-MDS-20","OMF-MDS-29","OMF-MDS-31","OMF-MDS-44"]
439+
},
440+
"external_url": "https://github.com/CDSM-WG/CDS-M/tree/main/use-cases",
441+
"ids": ["open-data","most-used-routes","vehicle-cap","impact-on-transit","origins","vehicle-rotation","distribution-requirements-availability","distribution-requirements-availability","publish-speed-regulations"]
434442
]
435443
},
436444
{
@@ -699,7 +707,6 @@ Since Requirements allows the GBFS versions and optional endpoints and fields to
699707
{
700708
"endpoint_name": "system_pricing_plans.json",
701709
"required_fields": [
702-
"per_km_pricing",
703710
"per_km_pricing",
704711
"surge_pricing"
705712
]

0 commit comments

Comments
 (0)