-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
The problem: The same enumerated categories fields appear in several parts of the schema. For example, the following appears in link, segment, link_tod, segment_tod:
{
"name": "bike_facility",
"type": "string",
"description": "Optional. Types of bicycle accommodation based on the National Bikeway Network Data Template (Table 1-A at https://nmtdev.ornl.gov/assets/templates/NBN_DataTemplates_final.pdf)",
"categories": [
"unseparated bike lane",
"buffered bike lane",
"separated bike lane",
"counter-flow bike lane",
"paved shoulder",
"shared lane",
"shared use path",
"off-road unpaved trail",
"other",
"none"
]
},
Solution: Implement subschemas to define these enumerations once. Something like :
{
"$id": "bike_facility_enum",
"type": "object",
"description": "Optional. Types of bicycle accommodation based on the National Bikeway Network Data Template (Table 1-A at https://nmtdev.ornl.gov/assets/templates/NBN_DataTemplates_final.pdf)",
"categories": [
"unseparated bike lane",
"buffered bike lane",
"separated bike lane",
"counter-flow bike lane",
"paved shoulder",
"shared lane",
"shared use path",
"off-road unpaved trail",
"other",
"none"
]
}
Then, in the link schema and others that reference the enumeration, include a reference to the relevant enumerated list:
"bike facility": {
"$ref: bike_facility_enum
}
For some examples, see:
https://specs.frictionlessdata.io/patterns/#implementations-13
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels