Skip to content

Data Package

TIDES data must include a datapackage.json in the format specified by the tides-data-package json schema, which is an extension of the frictionless data package schema.

You may create your own datapackage.json based on the documentaiton or start with the provided template, but don’t forget to validate it to make sure it is in the correct format!

Data Package Format

name description type requirement
title A human-readable title.
Example:
Make Believe Trolley 1/1/2001-2/1/2001
string required
profile The json-schema profile used to validate this datapackage descriptor. Should be https://raw.githubusercontent.com/TIDES-transit/TIDES/<spec-version-or-reference>/spec/tides-datapackage-profile.json. Defaults to https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/tides-datapackage-profile.json
Example:
https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/tides-datapackage-profile.json
nan required
resources Array describing the data files included in your package, formated as a tabular-data-resource array required
name Short, unique sluggable identifier string.
Example:
trolley_2001_1
string recommended
description Short description of TIDES data package.
Example:
Raw and processed data from the Neighborhood of Make Believe Trolley recorded 1/1/2001-2/1/2001
string recommended
agency Transit agency name.
Example:
Make Believe Neighborhood Trolley
string recommended
ntd_id ID for the National Transit Database.
Example:
0R02-00307
string recommended
licenses The license(s) under which this package is published.
Example:
{'name':'CC-BY-4.0','path':'https://opendefinition.org/licenses/cc-by/','name':'Creative Commons Attribution 4.0'}
array recommended
contributors Array of data contributors.
Example:
{'name':'Daniel Tiger','email': 'daniel@makebelievetrolley.gov','organization':'Make Believe Neighborhood Trolley','role':'contributor'}
array recommended
maintainers Array of data maintainers
Example:
{'name':'Henrietta Pussycat','email': 'henrietta@makebelievetrolley.gov','organization':'Make Believe Neighborhood Trolley','role':'maintainer'}
array recommended

Tabular Data Resource

Required and recommended fields for each tabluar-data-resource are as follows:

name description type requirement
name Short, unique sluggable identifier string for a data table.
Example:
vehicle_locations_2001_01
string required
path A reference to the data for this resource, as a valid URI string.
Example:
event/2001/vehicle_locations_2001_01.csv
string required
schema Location of the table schema for this resource.
Example:
https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/fare_transactions.schema.json
string required
profile Must be tabular-data-resource
Example:
tabular-data-resource
string required
title A human-readable title for the data resource.
Example:
Neighborhood Trolley Vehicle Locations: 1/1/2001-2/1/2001
string recommended
description D
Example:
Vehicle location event data from the Neighborhood of Make Believe Trolley recorded 1/1/2001-2/1/2001
string recommended
sources The raw sources for this resource which describe where the data came from.
Example:
[ {'title':'Trolley CAD/AVL System','component':'CAD/AVL','product':'TrolleyMaster','product_version':'3.1.4'} ]
array recommended
licenses The license(s) under which this package is published.
Example:
{'name':'CC-BY-4.0','path':'https://opendefinition.org/licenses/cc-by/','name':'Creative Commons Attribution 4.0'}
array recommended

Template

The canonical datapackage.json template is available at /data/template/TIDES/datapackage.json.

Warning

This version of tides-data-package template is dependent on the version of the documentation you are viewing and only represents the canonical tides-data-package template if you are viewing the main documentation version.

samples/template/TIDES/datapackage.json
{
    "name": "template",
    "title": "Template TIDES Data Package Example",
    "agency": "Transit Agency Name",
    "ntd_id": "1234-56",
    "profile": "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/tides-datapackage-profile.json",
    "licenses": [
        {
            "name": "CC-BY-4.0"
        }
    ],
    "contributors": [
        {
            "title": "My Name",
            "email": "me@myself.com",
            "github": "myhandle"
        }
    ],
    "maintainers": [
        {
            "title": "Another Name",
            "email": "another@myself.com",
            "github": "myhandle"
        }
    ],
    "resources": [
        {
            "name": "devices",
            "profile": "tabular-data-resource",
            "path": "devices.csv",
            "schema": "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/devices.schema.json",
            "sources": [
                {
                    "title": "Where did data come from?",
                    "component": "Type of technology component, i.e. `AVL`",
                    "product": "Product used.",
                    "vendor": "Vendor selling product."
                }
            ]
        },
        {
            "name": "vehicle_locations",
            "profile": "tabular-data-resource",
            "path": "vehicle_locations.csv",
            "schema": "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/vehicle_locations.schema.json",
            "sources": [
                {
                    "title": "Where did data come from?",
                    "component": "Type of technology component, i.e. `AVL`",
                    "product": "Product used.",
                    "vendor": "Vendor selling product."
                }
            ]
        },
        {
            "name": "fare_transactions",
            "profile": "tabular-data-resource",
            "path": "fare_transactions.csv",
            "schema":"https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/fare_transactions.schema.json",
            "sources": [
                {
                    "title": "Where did data come from?",
                    "component": "Type of technology component, i.e. `AVL`",
                    "product": "Product used.",
                    "vendor": "Vendor selling product."
                }
            ]
        },
        {
            "name": "train_cars",
            "profile": "tabular-data-resource",
            "path": "train_cars.csv",
            "schema": "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/train_cars.schema.json",
            "sources": [
                {
                    "title": "Where did data come from?",
                    "component": "Type of technology component, i.e. `AVL`",
                    "product": "Product used.",
                    "vendor": "Vendor selling product."
                }
            ]
        },
        {
            "name": "operators",
            "profile": "tabular-data-resource",
            "path": "operators.csv",
            "schema": "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/operators.schema.json",
            "sources": [
                {
                    "title": "Where did data come from?",
                    "component": "Type of technology component, i.e. `AVL`",
                    "product": "Product used.",
                    "vendor": "Vendor selling product."
                }
            ]
        },
        {
            "name": "stop_visits",
            "profile": "tabular-data-resource",
            "path": "stop_visits.csv",
            "schema": "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/stop_visits.schema.json",
            "sources": [
                {
                    "title": "Where did data come from?",
                    "component": "Type of technology component, i.e. `AVL`",
                    "product": "Product used.",
                    "vendor": "Vendor selling product."
                }
            ]
        },
        {
            "name": "vehicle_train_cars",
            "profile": "tabular-data-resource",
            "path": "vehicle_train_cars.csv",
            "schema": "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/vehicle_train_cars.schema.json",
            "sources": [
                {
                    "title": "Where did data come from?",
                    "component": "Type of technology component, i.e. `AVL`",
                    "product": "Product used.",
                    "vendor": "Vendor selling product."
                }
            ]
        },
        {
            "name": "vehicles",
            "profile": "tabular-data-resource",
            "path": "vehicles.csv",
            "schema": "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/vehicles.schema.json",
            "sources": [
                {
                    "title": "Where did data come from?",
                    "component": "Type of technology component, i.e. `AVL`",
                    "product": "Product used.",
                    "vendor": "Vendor selling product."
                }
            ]
        },
        {
            "name": "trips_performed",
            "profile": "tabular-data-resource",
            "path": "trips_performed.csv",
            "schema": "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/trips_performed.schema.json",
            "sources": [
                {
                    "title": "Where did data come from?",
                    "component": "Type of technology component, i.e. `AVL`",
                    "product": "Product used.",
                    "vendor": "Vendor selling product."
                }
            ]
        },
        {
            "name": "station_activities",
            "profile": "tabular-data-resource",
            "path": "station_activities.csv",
            "schema": "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/station_activities.schema.json",
            "sources": [
                {
                    "title": "Where did data come from?",
                    "component": "Type of technology component, i.e. `AVL`",
                    "product": "Product used.",
                    "vendor": "Vendor selling product."
                }
            ]
        },
        {
            "name": "passenger_events",
            "profile": "tabular-data-resource",
            "path": "passenger_events.csv",
            "schema": "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/passenger_events.schema.json",
            "sources": [
                {
                    "title": "Where did data come from?",
                    "component": "Type of technology component, i.e. `AVL`",
                    "product": "Product used.",
                    "vendor": "Vendor selling product."
                }
            ]
        }
    ]
}

Validation

There are lots of options for validating your datapackage.json file including:

CLI

You can easily validate your data package file with the script provided in /bin/validate-data-package-to-profile

installation requirements

Make sure you have jsonschema-cli installed. You can install it specifically or with all of the other suggested tools using one of the commands below:

brew install jq # mac
pip install -r requirements.txt
curl -L -o /usr/bin/jq.exe https://github.com/stedolan/jq/releases/latest/download/jq-win64.exe #windows
pip install -r requirements.txt
sudo apt-get install jq # linux
pip install -r requirements.txt
usage
validate-data-package-json -f my-datapackage.json
bin/validate-datapackage-to-profile
#!/usr/bin/env bash

description="Script to validate a local JSON file against a profile for tides-data-package specified in 
profile field or optionally against a remote or local profile."

usage="
Usage: validate-datapackage-to-profile [-r remote_spec_ref | -l local_spec_path] [-f datapackage_file]
   -r remote_spec_ref: Optional. Specify the ref name of the GitHub repository for validating agianst
             a remote profile where the profile is in the sub-path /spec/tides-data-package.json. 
             Should not be used with -l option. Example: -r main
   -l local_spec_path: Optional. Specify the location of the local tides-data-package-json to use.
             Should not be used with -r option. Example: -l spec
   -d dataset_path: Optional. Specify the path of the datapackage.json file. 
             Default is datapackage.json. Example: -d samples/template/TIDES/datapackage.json
"

example_usage="Example Usage: bin/validate-datapackage-to-profile -d samples/template/TIDES/datapackage.tmp.json"

################################################################################
## Help                                                                         #
################################################################################

## Display help message
function display_help() {
  echo "$description"
  echo "$usage"
  echo "$example_usage"
}

## Check for help flag
if [ "$1" == "--help" ]; then
  display_help
  exit 0
fi

################################################################################
## MAIN                                                                         #
################################################################################

echo "$description"

################################################################################
## Source utility functions                                                     #
################################################################################
source "$(dirname "${BASH_SOURCE[0]}")/utils"
script_dir=$(dirname "$0")

################################################################################
## Check Requirements                                                           #
################################################################################
check_jsonschema-cli
check_jq

################################################################################
## Process the input options.                                                   #
################################################################################
## Set default values
remote_spec_ref=""
local_spec_path=""
dataset_path="datapackage.json"

## Parse command-line arguments
while getopts ":r:l:d:" opt; do
  case $opt in
    r)
      remote_spec_ref=$OPTARG
      ;;
    l)
      local_spec_path=$OPTARG
      ;;
    d)
      dataset_path=$OPTARG
      ;;
    \?)
      echo "Invalid option: -$OPTARG" >&2
      display_help
      exit 1
      ;;
  esac
done

echo "validate-datapackage-to-profile configs:"
echo "  remote_spec_ref: $remote_profile_ref"
echo "  local_spec_path: $local_profile_path"
echo "  dataset_path: $dataset_path"

if [ "$local_spec_path" != "" ] && [ "$remote_spec_path" != "" ]; then
  echo "Cannot specify both local spec location (-l) and remote spec reference (-r)" >&2
  exit 1
fi

################################################################################
## Specify datapackage and update if necessary                                  #
################################################################################

## Set appropriate datapackage_file vs dataset_path
if [ -f "$dataset_path" ]; then
  datapackage_file="$dataset_path"
  dataset_path=$(dirname "$dataset_path")
else 
  datapackage_file="$dataset_path/datapackage.json"
fi
check_valid_path "$datapackage_file"

################################################################################
## Find and download if necessary the profile file                              #
################################################################################

[ -n "$local_spec_path" ] && spec_prefix="$local_spec_path"
[ -n "$remote_spec_ref" ] && spec_prefix="https://raw.githubusercontent.com/TIDES-transit/TIDES/$remote_spec_ref/spec"

if [ "$spec_prefix" != "" ]; then
  profile_file="$spec_prefix/tides-datapackage-profile.json"
else
  profile_file=$(jq -r '.profile' "$datapackage_file")
fi
echo "...using profile: $profile_file"
check_valid_path "$profile_file"

if [[ "$profile_file" =~ ^http ]]; then
  temp_dir=$(mktemp -d)
  profile_file="$temp_dir/$(basename $profile_file)"
  echo "...downloading profile to: $profile_file"
  curl -L "$profile_file" -o "$profile_file"
fi

################################################################################
## Validate Datapackage to Profile                                              #
################################################################################
echo "...validating $datapackage_file to $profile_file"
jsonschema-cli validate "$profile_file" "$datapackage_file"

################################################################################
## Cleanup                                                                      #
################################################################################
if [ -d "$temp_dir" ]; then
  rm -r "$temp_dir"
fi

Point-and-Drool

Because a tides-datapackage-profile is just a json-schema, you can use the myriad of different json-schema validator out there on the web. Use the canonical tides-datapackage-profile or copy and paste the version from below.

Warning

This version of tides-datapackage-profile is dependent on the version of the documentation you are viewing and only represents the canonical tides-datapackage-profile if you are viewing the main documentation version.

spec/tides-datapackage-profile.json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "TIDES Data Package",
  "description": "TIDES Data Package is a simple specification for data access and delivery of tabular TIDES transit data.",
  "type": "object",
  "required": [
    "title",
    "profile",
    "resources"

  ],
  "recommended":[
    "name",
    "description",
    "agency",
    "ntd_id",
    "licenses",
    "contributors",
    "maintainers"
  ],
  "properties": {
    "profile": {
      "default":  "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/tides-datapackage-profile.json",
      "propertyOrder": 10,
      "title": "Profile",
      "description": "The json-schema profile used to validate this datapackage descriptor. Should be `https://raw.githubusercontent.com/TIDES-transit/TIDES/<spec-version-or-reference>/spec/tides-datapackage-profile.json`. Defaults to `https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/tides-datapackage-profile.json`",
      "format": "uri",
      "examples": [
        "`https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/tides-datapackage-profile.json`"
      ]
    },
    "title": {
      "propertyOrder": 20,
      "title": "Title",
      "description": "A human-readable title.",
      "type": "string",
      "examples": [
        "Make Believe Trolley 1/1/2001-2/1/2001"
      ]
    },
    "name": {
      "propertyOrder": 30,
      "title": "Name",
      "description": "Short, unique [sluggable](https://en.wikipedia.org/wiki/Clean_URL#Slug) identifier string.",
      "type": "string",
      "pattern": "^([-a-z0-9._/])+$",
      "context": "This is ideally a url-usable and human-readable name. Name `SHOULD` be invariant, meaning it `SHOULD NOT` change when its parent descriptor is updated.",
      "examples": [
        "trolley_2001_1"
      ]
    },
    "description": {
      "propertyOrder": 40,
      "format": "textarea",
      "title": "Description",
      "description": "Short description of TIDES data package.",
      "type": "string",
      "examples": [
        "Raw and processed data from the Neighborhood of Make Believe Trolley recorded 1/1/2001-2/1/2001"
      ]
    },
    "agency": {
      "propertyOrder": 50,
      "format": "textarea",
      "title": "Agency",
      "description": "Transit agency name.",
      "type": "string",
      "examples": [
        "Make Believe Neighborhood Trolley"
      ]
    },
    "ntd_id": {
      "propertyOrder": 60,
      "title": "NTD ID",
      "description": "ID for the National Transit Database.",
      "type": "string",
      "pattern": "^([-a-z0-9._/])+$",
      "context": "Background on NTD available at https://www.transit.dot.gov/ntd",
      "examples": [
        "0R02-00307"
      ]
    },
    "contributors": {
      "propertyOrder": 70,
      "title": "Contributors",
      "description": "Array of data contributors.",
      "type": "array",
      "minItems": 1,
      "items": {
        "title": "Contributor",
        "description": "A contributor to this descriptor.",
        "type": "object",
        "properties": {
          "name": {
            "title": "Name",
            "description": "A human-readable name.",
            "type": "string",
            "examples": [
              "Daniel Tiger"
            ]
          },
          "email": {
            "title": "Email",
            "description": "An email address.",
            "type": "string",
            "format": "email",
            "examples": [
              "daniel@makebelievetrolley.gov"
            ]
          },
          "organization": {
            "title": "Organization",
            "description": "An organizational affiliation for this contributor.",
            "type": "string",
            "example": "Make Believe Neighborhood Trolley"
          },
          "role": {
            "title": "Role",
            "description": "The contributor's role in the project",
            "type": "string",
            "default": "contributor"
          }
        },
        "required": [
          "title"
        ],
        "context": "Use of this property does not imply that the person was the original creator of, or a contributor to, the data in the descriptor, but refers to the composition of the descriptor itself."
      },
      "examples": [
       "{'name':'Daniel Tiger','email': 'daniel@makebelievetrolley.gov','organization':'Make Believe Neighborhood Trolley','role':'contributor'}"
      ]
    },
    "maintainers": {
      "propertyOrder": 80,
      "title": "Maintainers",
      "description": "Array of data maintainers",
      "type": "array",
      "minItems": 1,
      "items": {
        "title": "Maintainer",
        "description": "A maintainer of this descriptor.",
        "type": "object",
        "properties": {
          "name": {
            "title": "Name",
            "description": "A human-readable name.",
            "type": "string",
            "examples": [
              "Henrietta Pussycat"
            ]
          },
          "email": {
            "title": "Email",
            "description": "An email address.",
            "type": "string",
            "format": "email",
            "examples": [
              "henrietta@makebelievetrolley.gov"
            ]
          },
          "organization": {
            "title": "Organization",
            "description": "An organizational affiliation for this maintainer.",
            "type": "string"
          },
          "role": {
            "title": "Role",
            "description": "The maintainer's role in the project",
            "type": "string",
            "default": "maintainer"
          }
        },
        "required": [
          "title"
        ],
        "context": "Use of this property does not imply that the person was the original creator of, or a contributor to, the data in the descriptor, but refers to the composition of the descriptor itself."
      },
      "examples": [
        "{'name':'Henrietta Pussycat','email': 'henrietta@makebelievetrolley.gov','organization':'Make Believe Neighborhood Trolley','role':'maintainer'}"

      ]
    },
    "licenses": {
      "propertyOrder": 90,
      "title": "Licenses",
      "description": "The license(s) under which this package is published.",
      "type": "array",
      "minItems": 1,
      "items": {
        "title": "License",
        "description": "An array of license objects which apply to this data package.  Must include at least a `name` or `path`",
        "type": "object",
        "anyOf": [
          {
            "required": [
              "name"
            ]
          },
          {
            "required": [
              "path"
            ]
          }
        ],
        "properties": {
          "name": {
            "title": "Open Definition license identifier",
            "description": "MUST be an Open Definition license identifier, see http://licenses.opendefinition.org/",
            "type": "string",
            "pattern": "^([-a-zA-Z0-9._])+$",
            "examples": ["odc-by","CC-BY-4.0"]
          },
          "path": {
            "title": "Path",
            "description": "A fully qualified public URL, or a Unix-style relative file path.",
            "type": "string",
            "pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$",
            "examples": [
              "https://opendefinition.org/licenses/odc-by/",
              "license.md"
            ],
            "context": "Implementations need to negotiate the type of path provided, and dereference the data accordingly."
          },
          "title": {
            "title": "Title",
            "description": "A human-readable title of the license.",
            "type": "string",
            "examples": [
              "Creative Commons Attribution 4.0"
            ]
          }
        }
      },
      "context": "This property is not legally binding and does not guarantee that the package is licensed under the terms defined herein.",
      "examples": [
        "{'name':'CC-BY-4.0','path':'https://opendefinition.org/licenses/cc-by/','name':'Creative Commons Attribution 4.0'}"
      ]
    },
    "resources": {
      "propertyOrder": 100,
      "title": "Tabular Data Resources",
      "description": "Array describing the data files included in your package, formated as a [`tabular-data-resource`](#tabular-data-resource)",
      "type": "array",
      "minItems": 1,
      "items": {
        "title": "Tabular Data Resource",
        "description": "A Tabular Data Resource.",
        "type": "object",
        "required": [
            "name",
            "path",
            "schema",
            "profile"
        ],
        "recommended": [
          "title",
          "description",
          "sources",
          "licenses"
      ],
        "properties": {
          "profile": {
            "default": "tabular-data-resource",
            "propertyOrder": 10,
            "title": "Profile",
            "description": "Must be `tabular-data-resource`",
            "type": "string",
            "examples": [
              "tabular-data-resource"
            ]
          },
          "name": {
            "propertyOrder": 20,
            "title": "Name",
            "description": "Short, unique [sluggable](https://en.wikipedia.org/wiki/Clean_URL#Slug) identifier string for a data table.",
            "type": "string",
            "pattern": "^([-a-z0-9._/])+$",
            "context": "This is ideally a url-usable and human-readable name. Name `SHOULD` be invariant, meaning it `SHOULD NOT` change when its parent descriptor is updated.",
            "examples": [
              "vehicle_locations_2001_01"
            ]
          },
          "path": {
            "propertyOrder": 30,
            "title": "Path",
            "description": "A reference to the data for this resource, as a valid URI string.",
            "type": "string",
            "pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$",
            "examples": [
              "event/2001/vehicle_locations_2001_01.csv"
            ],
            "context": "Implementations need to negotiate the type of path provided, and dereference the data accordingly."
          },
          "tides-table": {
            "enum": [
              "devices",
              "fare_transactions",
              "operators",
              "station_activities",
              "passenger_events",
              "stop_visits",
              "train_cars",
              "trips_performed",
              "vehicle_locations",
              "vehicle_train_cars",
              "vehicles"
            ],
            "description": "An identifier string corresponding to the name of one of the table specs in the TIDES data package",
            "type": "string",
            "examples": [
              "fare_transactions",
              "train_cars"
            ]
          },
          "schema": {
            "title": "Table Schema",
            "description": "Location of the table schema for this resource.",
            "type": "string",
            "examples": [
              "https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/fare_transactions.schema.json"
            ]
          },
          "title": {
            "title": "Title",
            "description": "A human-readable title for the data resource.",
            "type": "string",
            "examples": [
              "Neighborhood Trolley Vehicle Locations: 1/1/2001-2/1/2001"
            ],
            "propertyOrder": 50
          },
          "description": {
            "title": "Description",
            "description": "D",
            "type": "string",
            "examples": [
              "Vehicle location event data from the Neighborhood of Make Believe Trolley recorded 1/1/2001-2/1/2001"
            ],
            "propertyOrder": 60,
            "format": "textarea"
          },
          "homepage": {
            "propertyOrder": 70,
            "title": "Home Page",
            "description": "The home on the web that is related to this data package.",
            "type": "string",
            "format": "uri",
            "examples": [
              "http://example.com"
            ]
          },
          "sources": {
            "propertyOrder": 140,
            "options": {
              "hidden": true
            },
            "title": "Sources",
            "description": "The raw sources for this resource which describe where the data came from.",
            "type": "array",
            "minItems": 0,
            "examples": [
              "[ {'title':'Trolley CAD/AVL System','component':'CAD/AVL','product':'TrolleyMaster','product_version':'3.1.4'} ]"
            ],
            "items": {
              "title": "Source",
              "type": "object",
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "title": "Title",
                  "description": "Human-readable title of the data source.",
                  "type": "string",
                  "examples": [
                    "Trolley CAD/AVL System"
                  ]
                },
                "component": {
                  "title": "Component",
                  "description": "The technology component used to generate this data (directly or indirectly)",
                  "type": "string",
                  "examples": [
                    "CAD/AVL",
                    "AFC",
                    "APC"
                  ]
                },
                "product": {
                  "title": "Product",
                  "description": "What product was used to generate this data (directly or indirectly)?",
                  "type": "string",
                  "examples": [
                    "TrolleyMaster"
                  ]
                },
                "product_version": {
                  "title": "Product Version",
                  "description": "Describe the version of the product was used.",
                  "type": "string"
                },
                "vendor": {
                  "title": "Vendor",
                  "description": "What company makes this product?",
                  "type": "string"
                }
              }
            }
          },
          "licenses": {
            "propertyOrder": 90,
            "title": "Licenses",
            "description": "The license(s) under which this package is published.",
            "type": "array",
            "minItems": 1,
            "items": {
              "title": "License",
              "description": "An array of license objects which apply to this data package.  Must include at least a `name` or `path`",
              "type": "object",
              "anyOf": [
                {
                  "required": [
                    "name"
                  ]
                },
                {
                  "required": [
                    "path"
                  ]
                }
              ],
              "properties": {
                "name": {
                  "title": "Open Definition license identifier",
                  "description": "MUST be an Open Definition license identifier, see http://licenses.opendefinition.org/",
                  "type": "string",
                  "pattern": "^([-a-zA-Z0-9._])+$",
                  "examples": ["odc-by","CC-BY-4.0"]
                },
                "path": {
                  "title": "Path",
                  "description": "A fully qualified public URL, or a Unix-style relative file path.",
                  "type": "string",
                  "pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$",
                  "examples": [
                    "https://opendefinition.org/licenses/odc-by/",
                    "license.md"
                  ],
                  "context": "Implementations need to negotiate the type of path provided, and dereference the data accordingly."
                },
                "title": {
                  "title": "Title",
                  "description": "A human-readable title of the license.",
                  "type": "string",
                  "examples": [
                    "Creative Commons Attribution 4.0"
                  ]
                }
              }
            },
            "context": "This property is not legally binding and does not guarantee that the package is licensed under the terms defined herein.",
            "examples": [
              "{'name':'CC-BY-4.0','path':'https://opendefinition.org/licenses/cc-by/','name':'Creative Commons Attribution 4.0'}"
            ]
          },
          "dialect": {
            "propertyOrder": 50,
            "title": "CSV Dialect",
            "description": "The CSV dialect descriptor.",
            "type": [
              "string",
              "object"
            ],
            "required": [
              "delimiter",
              "doubleQuote"
            ],
            "properties": {
              "csvddfVersion": {
                "title": "CSV Dialect schema version",
                "description": "A number to indicate the schema version of CSV Dialect. Version 1.0 was named CSV Dialect Description Format and used different field names.",
                "type": "number",
                "default": 1.2,
                "examples:": [
                  "1.2"
                ]
              },
              "delimiter": {
                "title": "Delimiter",
                "description": "A character sequence to use as the field separator.",
                "type": "string",
                "default": ",",
                "examples": [
                  "`;`",
                  "`|`"
                ]
              },
              "doubleQuote": {
                "title": "Double Quote",
                "description": "Specifies the handling of quotes inside fields.",
                "context": "If Double Quote is set to true, two consecutive quotes must be interpreted as one.",
                "type": "boolean",
                "default": true
              },
              "lineTerminator": {
                "title": "Line Terminator",
                "description": "Specifies the character sequence that must be used to terminate rows.",
                "type": "string",
                "default": "\r\n",
                "examples": [
                  "`\r`",
                  "`\n`"
                ]
              },
              "nullSequence": {
                "title": "Null Sequence",
                "description": "Specifies the null sequence, for example, `\\N`.",
                "type": "string",
                "examples": [
                  "`\\N`"
                ]
              },
              "quoteChar": {
                "title": "Quote Character",
                "description": "Specifies a one-character string to use as the quoting character.",
                "type": "string",
                "default": "\"",
                "examples": [
                  "`'`"
                ]
              },
              "escapeChar": {
                "title": "Escape Character",
                "description": "Specifies a one-character string to use as the escape character.",
                "type": "string",
                "examples": [
                  "`\\`"
                ]
              },
              "skipInitialSpace": {
                "title": "Skip Initial Space",
                "description": "Specifies the interpretation of whitespace immediately following a delimiter. If false, whitespace immediately after a delimiter should be treated as part of the subsequent field.",
                "type": "boolean",
                "default": false
              },
              "header": {
                "title": "Header",
                "description": "Specifies if the file includes a header row, always as the first row in the file.",
                "type": "boolean",
                "default": true
              },
              "commentChar": {
                "title": "Comment Character",
                "description": "Specifies that any row beginning with this one-character string, without preceeding whitespace, causes the entire line to be ignored.",
                "type": "string",
                "examples": [
                  "`#`"
                ]
              },
              "caseSensitiveHeader": {
                "title": "Case Sensitive Header",
                "description": "Specifies if the case of headers is meaningful.",
                "context": "Use of case in source CSV files is not always an intentional decision. For example, should \"CAT\" and \"Cat\" be considered to have the same meaning.",
                "type": "boolean",
                "default": false
              }
            },
            "examples": [
              "{'delimiter': ';' }"
       ]
          },
          "format": {
            "propertyOrder": 80,
            "title": "Format",
            "description": "The file format of this resource.",
            "context": "`csv`, `xls`, `json` are examples of common formats.",
            "type": "string",
            "examples": [
              "`xls`"
            ]
          },
          "mediatype": {
            "propertyOrder": 90,
            "title": "Media Type",
            "description": "The media type of this resource. Can be any valid media type listed with [IANA](https://www.iana.org/assignments/media-types/media-types.xhtml).",
            "type": "string",
            "pattern": "^(.+)/(.+)$",
            "examples": [
              "`text/csv`"
            ]
          },
          "encoding": {
            "propertyOrder": 100,
            "title": "Encoding",
            "description": "The file encoding of this resource.",
            "type": "string",
            "default": "utf-8",
            "examples": [
              "`utf-8`"
            ]
          },
          "bytes": {
            "propertyOrder": 110,
            "options": {
              "hidden": true
            },
            "title": "Bytes",
            "description": "The size of this resource in bytes.",
            "type": "integer",
            "examples": [
              "2082"
            ]
          },
          "hash": {
            "propertyOrder": 120,
            "options": {
              "hidden": true
            },
            "title": "Hash",
            "type": "string",
            "description": "The MD5 hash of this resource. Indicate other hashing algorithms with the {algorithm}:{hash} format.",
            "pattern": "^([^:]+:[a-fA-F0-9]+|[a-fA-F0-9]{32}|)$",
            "examples": [
              "d25c9c77f588f5dc32059d2da1136c02",
              "SHA256:5262f12512590031bbcc9a430452bfd75c2791ad6771320bb4b5728bfb78c4d0"
            ]
          }
        }
      }
    },
    "sources": {
      "propertyOrder": 140,
      "options": {
        "hidden": true
      },
      "title": "Sources",
      "description": "The raw sources for this data package which describe where the data came from. Can be alternatively specified at the individual resource-level.",
      "type": "array",
      "minItems": 0,
      "examples": [
        "[ {'title':'Trolley CAD/AVL System','component':'CAD/AVL','product':'TrolleyMaster','product_version':'3.1.4'} ]"
      ],
      "items": {
        "title": "Source",
        "type": "object",
        "required": [
          "title"
        ],
        "properties": {
          "title": {
            "title": "Title",
            "description": "Human-readable title of the data source.",
            "type": "string",
            "examples": [
              "Trolley CAD/AVL System"
            ]
          },
          "component": {
            "title": "Component",
            "description": "What technology component was used to generate this data (directly or indirectly)? Examples include `AVL`, `APC`, `AFC`, etc.",
            "type": "string",
            "examples": [
              "CAD/AVL",
              "AFC",
              "APC"
            ]
          },
          "product": {
            "title": "Product",
            "description": "What product was used to generate this data (directly or indirectly)?",
            "type": "string",
            "examples": [
              "TrolleyMaster"
            ]
          },
          "product_version": {
            "title": "Product Version",
            "description": "Describe the version of the product was used.",
            "type": "string"
          },
          "vendor": {
            "title": "Vendor",
            "description": "What company makes this product?",
            "type": "string"
          }
        }
      }
    }
  }
}