---
tableSchemaFieldName:
  title: Name
  description: A name for this field.
  type: string
tableSchema:
  title: Table Schema
  description: A Table Schema for this resource, compliant with the [Table Schema](/tableschema/) specification.
  type: object
  required:
  - fields
  properties:
    fields:
      type: array
      minItems: 1
      items:
        "$ref": "#/definitions/tableSchemaField"
      description: An `array` of Table Schema Field objects.
      examples:
      - |
          {
            "fields": [
              {
                "name": "my-field-name"
              }
            ]
          }
      - |
          {
            "fields": [
              {
                "name": "my-field-name",
                "type": "number"
              },
              {
                "name": "my-field-name-2",
                "type": "string",
                "format": "email"
              }
            ]
          }
    primaryKey:
      "$ref": "#/definitions/tableSchemaPrimaryKey"
    foreignKeys:
      type: array
      minItems: 1
      items:
        "$ref": "#/definitions/tableSchemaForeignKey"
      examples:
      - |
          {
            "foreignKeys": [
              {
                "fields": "state",
                "reference": {
                  "resource": "the-resource",
                  "fields": "state_id"
                }
              }
            ]
          }
      - |
          {
            "foreignKeys": [
              {
                "fields": "state",
                "reference": {
                  "resource": "",
                  "fields": "id"
                }
              }
            ]
          }
    missingValues:
      "$ref": "#/definitions/tableSchemaMissingValues"
  examples:
  - |
      {
        "schema": {
          "fields": [
            {
              "name": "first_name",
              "type": "string"
              "constraints": {
                "required": true
              }
            },
            {
              "name": "age",
              "type": "integer"
            },
          ],
          "primaryKey": [
            "name"
          ]
        }
      }
tableSchemaField:
  title: Table Schema Field
  type: object
  anyOf:
  - "$ref": "#/definitions/tableSchemaFieldString"
  - "$ref": "#/definitions/tableSchemaFieldNumber"
  - "$ref": "#/definitions/tableSchemaFieldInteger"
  - "$ref": "#/definitions/tableSchemaFieldDate"
  - "$ref": "#/definitions/tableSchemaFieldTime"
  - "$ref": "#/definitions/tableSchemaFieldDateTime"
  - "$ref": "#/definitions/tableSchemaFieldYear"
  - "$ref": "#/definitions/tableSchemaFieldYearMonth"
  - "$ref": "#/definitions/tableSchemaFieldBoolean"
  - "$ref": "#/definitions/tableSchemaFieldObject"
  - "$ref": "#/definitions/tableSchemaFieldGeoPoint"
  - "$ref": "#/definitions/tableSchemaFieldGeoJSON"
  - "$ref": "#/definitions/tableSchemaFieldArray"
  - "$ref": "#/definitions/tableSchemaFieldDuration"
  - "$ref": "#/definitions/tableSchemaFieldAny"
tableSchemaPrimaryKey:
  oneOf:
    -
      type: array
      minItems: 1
      uniqueItems: true
      items:
        type: string
    -
      type: string
  description: A primary key is a field name or an array of field names, whose values `MUST` uniquely identify each row in the table.
  context: Field name in the `primaryKey` `MUST` be unique, and `MUST` match
    a field name in the associated table. It is acceptable to have an array with
    a single value, indicating that the value of a single field is the primary key.
  examples:
  - |
      {
        "primaryKey": [
          "name"
        ]
      }
  - |
      {
        "primaryKey": [
          "first_name",
          "last_name"
        ]
      }
tableSchemaForeignKey:
  title: Table Schema Foreign Key
  description: Table Schema Foreign Key
  type: object
  required:
  - fields
  - reference
  oneOf:
    -
      properties:
        fields:
          type: array
          items:
            type: string
            minItems: 1
            uniqueItems: true
            description: Fields that make up the primary key.
        reference:
          type: object
          required:
          - resource
          - fields
          properties:
            resource:
              type: string
              default: ""
            fields:
              type: array
              items:
                type: string
              minItems: 1
              uniqueItems: true
    -
      properties:
        fields:
          type: string
          description: Fields that make up the primary key.
        reference:
          type: object
          required:
          - resource
          - fields
          properties:
            resource:
              type: string
              default: ""
            fields:
              type: string
tableSchemaTrueValues:
  type: array
  minItems: 1
  items:
    type: string
  default: [ "true", "True", "TRUE", "1" ]
tableSchemaFalseValues:
  type: array
  minItems: 1
  items:
    type: string
  default: [ "false", "False", "FALSE", "0" ]
tableSchemaMissingValues:
  type: array
  items:
    type: string
  default:
  - ''
  description: Values that when encountered in the source, should be considered
    as `null`, 'not present', or 'blank' values.
  context: |-
    Many datasets arrive with missing data values, either because a value was not collected or it never existed.
    Missing values may be indicated simply by the value being empty in other cases a special value may have been used e.g. `-`, `NaN`, `0`, `-9999` etc.
    The `missingValues` property provides a way to indicate that these values should be interpreted as equivalent to null.

    `missingValues` are strings rather than being the data type of the particular field. This allows for comparison prior to casting and for fields to have missing value which are not of their type, for example a `number` field to have missing values indicated by `-`.

    The default value of `missingValue` for a non-string type field is the empty string `''`. For string type fields there is no default for `missingValue` (for string fields the empty string `''` is a valid value and need not indicate null).
  examples:
  - |
      {
        "missingValues": [
          "-",
          "NaN",
          ""
        ]
      }
  - |
      {
        "missingValues": []
      }
tableSchemaFieldString:
  type: object
  title: String Field
  description: The field contains strings, that is, sequences of characters.
  required:
  - name
  properties:
    name:
      "$ref": "#/definitions/tableSchemaFieldName"
    title:
      "$ref": "#/definitions/title"
    description:
      "$ref": "#/definitions/description"
    type:
      description: The type keyword, which `MUST` be a value of `string`.
      enum:
      - string
    format:
      description: The format keyword options for `string` are `default`, `email`, `uri`, `binary`, and `uuid`.
      context: |-
        The following `format` options are supported:
          * **default**: any valid string.
          * **email**: A valid email address.
          * **uri**: A valid URI.
          * **binary**: A base64 encoded string representing binary data.
          * **uuid**: A string that is a uuid.
      enum:
      - default
      - email
      - uri
      - binary
      - uuid
      default: default
    constraints:
      title: Constraints
      description: The following constraints are supported for `string` fields.
      type: object
      properties:
        required:
          "$ref": "#/definitions/tableSchemaConstraintRequired"
        unique:
          "$ref": "#/definitions/tableSchemaConstraintUnique"
        pattern:
          "$ref": "#/definitions/tableSchemaConstraintPattern"
        enum:
          "$ref": "#/definitions/tableSchemaConstraintEnumString"
        minLength:
          "$ref": "#/definitions/tableSchemaConstraintMinLength"
        maxLength:
          "$ref": "#/definitions/tableSchemaConstraintMaxLength"
    rdfType:
      "$ref": "#/definitions/tableSchemaRdfType"
  examples:
  - |
      {
        "name": "name",
        "type": "string"
      }
  - |
      {
        "name": "name",
        "type": "string",
        "format": "email"
      }
  - |
      {
        "name": "name",
        "type": "string",
        "constraints": {
          "minLength": 3,
          "maxLength": 35
        }
      }

tableSchemaFieldBoolean:
  type: object
  title: Boolean Field
  description: The field contains boolean (true/false) data.
  required:
    - name
    - type
  properties:
    name:
      "$ref": "#/definitions/tableSchemaFieldName"
    title:
      "$ref": "#/definitions/title"
    description:
      "$ref": "#/definitions/description"
    type:
      description: The type keyword, which `MUST` be a value of `boolean`.
      enum:
      - boolean
    trueValues:
      "$ref": "#/definitions/tableSchemaTrueValues"
    falseValues:
      "$ref": "#/definitions/tableSchemaFalseValues"
    constraints:
      title: Constraints
      description: The following constraints are supported for `boolean` fields.
      type: object
      properties:
        required:
          "$ref": "#/definitions/tableSchemaConstraintRequired"
        enum:
          "$ref": "#/definitions/tableSchemaConstraintEnumBoolean"
    rdfType:
      "$ref": "#/definitions/tableSchemaRdfType"
  examples:
  - |
      {
        "name": "registered",
        "type": "boolean"
      }
tableSchemaFieldInteger:
  type: object
  title: Integer Field
  description: The field contains integers - that is whole numbers.
  context: Integer values are indicated in the standard way for any valid integer.
  required:
    - name
    - type
  properties:
    name:
      "$ref": "#/definitions/tableSchemaFieldName"
    title:
      "$ref": "#/definitions/title"
    description:
      "$ref": "#/definitions/description"
    type:
      description: The type keyword, which `MUST` be a value of `integer`.
      enum:
      - integer
    format:
      description: "There are no format keyword options for `integer`: only `default` is allowed."
      enum:
      - default
      default: default
    bareNumber:
      "$ref": "#/definitions/tableSchemaBareNumber"
    constraints:
      title: Constraints
      description: The following constraints are supported for `integer` fields.
      type: object
      properties:
        required:
          "$ref": "#/definitions/tableSchemaConstraintRequired"
        unique:
          "$ref": "#/definitions/tableSchemaConstraintUnique"
        pattern:
          "$ref": "#/definitions/tableSchemaConstraintPattern"
        enum:
          oneOf:
            - "$ref": "#/definitions/tableSchemaConstraintEnumString"
            - "$ref": "#/definitions/tableSchemaConstraintEnumInteger"
        minimum:
          oneOf:
            - "$ref": "#/definitions/tableSchemaConstraintMinimumString"
            - "$ref": "#/definitions/tableSchemaConstraintMinimumInteger"
        maximum:
          oneOf:
            - "$ref": "#/definitions/tableSchemaConstraintMaximumString"
            - "$ref": "#/definitions/tableSchemaConstraintMaximumInteger"
    rdfType:
      "$ref": "#/definitions/tableSchemaRdfType"
  examples:
  - |
      {
        "name": "age",
        "type": "integer",
        "constraints": {
          "unique": true,
          "minimum": 100,
          "maximum": 9999
        }
      }
tableSchemaFieldNumber:
  type: object
  title: Number Field
  description: The field contains numbers of any kind including decimals.
  context: |-
    The lexical formatting follows that of decimal in [XMLSchema](https://www.w3.org/TR/xmlschema-2/#decimal): a non-empty finite-length sequence of decimal digits separated by a period as a decimal indicator. An optional leading sign is allowed. If the sign is omitted, '+' is assumed. Leading and trailing zeroes are optional. If the fractional part is zero, the period and following zero(es) can be omitted. For example: '-1.23', '12678967.543233', '+100000.00', '210'.

    The following special string values are permitted (case does not need to be respected):
      - NaN: not a number
      - INF: positive infinity
      - -INF: negative infinity

    A number `MAY` also have a trailing:
      - exponent: this `MUST` consist of an E followed by an optional + or - sign followed by one or more decimal digits (0-9)
      - percentage: the percentage sign: `%`. In conversion percentages should be divided by 100.

    If both exponent and percentages are present the percentage `MUST` follow the exponent e.g. '53E10%' (equals 5.3).
  required:
  - name
  properties:
    name:
      "$ref": "#/definitions/tableSchemaFieldName"
    title:
      "$ref": "#/definitions/title"
    description:
      "$ref": "#/definitions/description"
    type:
      description: The type keyword, which `MUST` be a value of `number`.
      enum:
      - number
    format:
      description: "There are no format keyword options for `number`: only `default` is allowed."
      enum:
      - default
      default: default
    bareNumber:
      "$ref": "#/definitions/tableSchemaBareNumber"
    decimalChar:
      type: string
      description: A string whose value is used to represent a decimal point within the number. The default value is `.`.
    groupChar:
      type: string
      description: A string whose value is used to group digits within the number. The default value is `null`. A common value is `,` e.g. '100,000'.
    constraints:
      title: Constraints
      description: The following constraints are supported for `number` fields.
      type: object
      properties:
        required:
          "$ref": "#/definitions/tableSchemaConstraintRequired"
        unique:
          "$ref": "#/definitions/tableSchemaConstraintUnique"
        pattern:
          "$ref": "#/definitions/tableSchemaConstraintPattern"
        enum:
          oneOf:
            - "$ref": "#/definitions/tableSchemaConstraintEnumString"
            - "$ref": "#/definitions/tableSchemaConstraintEnumNumber"
        minimum:
          oneOf:
            - "$ref": "#/definitions/tableSchemaConstraintMinimumString"
            - "$ref": "#/definitions/tableSchemaConstraintMinimumNumber"
        maximum:
          oneOf:
            - "$ref": "#/definitions/tableSchemaConstraintMaximumString"
            - "$ref": "#/definitions/tableSchemaConstraintMaximumNumber"
    rdfType:
      "$ref": "#/definitions/tableSchemaRdfType"
  examples:
  - |
      {
        "name": "field-name",
        "type": "number"
      }
  - |
      {
        "name": "field-name",
        "type": "number",
        "constraints": {
          "enum": [ "1.00", "1.50", "2.00" ]
        }
      }
tableSchemaFieldDate:
  type: object
  title: Date Field
  description: The field contains temporal date values.
  required:
    - name
    - type
  properties:
    name:
      "$ref": "#/definitions/tableSchemaFieldName"
    title:
      "$ref": "#/definitions/title"
    description:
      "$ref": "#/definitions/description"
    type:
      description: The type keyword, which `MUST` be a value of `date`.
      enum:
      - date
    format:
      description: The format keyword options for `date` are `default`, `any`, and `{PATTERN}`.
      context: |-
        The following `format` options are supported:
          * **default**: An ISO8601 format string of YYYY-MM-DD.
          * **any**: Any parsable representation of a date. The implementing library can attempt to parse the datetime via a range of strategies.
          * **{PATTERN}**: The value can be parsed according to `{PATTERN}`, which `MUST` follow the date formatting syntax of C / Python [strftime](http://strftime.org/).
      default: default
    constraints:
      title: Constraints
      description: The following constraints are supported for `date` fields.
      type: object
      properties:
        required:
          "$ref": "#/definitions/tableSchemaConstraintRequired"
        unique:
          "$ref": "#/definitions/tableSchemaConstraintUnique"
        enum:
          "$ref": "#/definitions/tableSchemaConstraintEnumString"
        minimum:
          "$ref": "#/definitions/tableSchemaConstraintMinimumString"
        maximum:
          "$ref": "#/definitions/tableSchemaConstraintMaximumString"
    rdfType:
      "$ref": "#/definitions/tableSchemaRdfType"
  examples:
  - |
      {
        "name": "date_of_birth",
        "type": "date"
      }
  - |
      {
        "name": "date_of_birth",
        "type": "date",
        "constraints": {
          "minimum": "01-01-1900"
        }
      }
  - |
      {
        "name": "date_of_birth",
        "type": "date",
        "format": "MM-DD-YYYY"
      }
tableSchemaFieldTime:
  type: object
  title: Time Field
  description: The field contains temporal time values.
  required:
    - name
    - type
  properties:
    name:
      "$ref": "#/definitions/tableSchemaFieldName"
    title:
      "$ref": "#/definitions/title"
    description:
      "$ref": "#/definitions/description"
    type:
      description: The type keyword, which `MUST` be a value of `time`.
      enum:
      - time
    format:
      description: The format keyword options for `time` are `default`, `any`, and `{PATTERN}`.
      context: |-
        The following `format` options are supported:
          * **default**: An ISO8601 format string for time.
          * **any**: Any parsable representation of a date. The implementing library can attempt to parse the datetime via a range of strategies.
          * **{PATTERN}**: The value can be parsed according to `{PATTERN}`, which `MUST` follow the date formatting syntax of C / Python [strftime](http://strftime.org/).
      default: default
    constraints:
      title: Constraints
      description: The following constraints are supported for `time` fields.
      type: object
      properties:
        required:
          "$ref": "#/definitions/tableSchemaConstraintRequired"
        unique:
          "$ref": "#/definitions/tableSchemaConstraintUnique"
        enum:
          "$ref": "#/definitions/tableSchemaConstraintEnumString"
        minimum:
          "$ref": "#/definitions/tableSchemaConstraintMinimumString"
        maximum:
          "$ref": "#/definitions/tableSchemaConstraintMaximumString"
    rdfType:
      "$ref": "#/definitions/tableSchemaRdfType"
  examples:
  - |
      {
        "name": "appointment_start",
        "type": "time"
      }
  - |
      {
        "name": "appointment_start",
        "type": "time",
        "format": "any"
      }
tableSchemaFieldDateTime:
  type: object
  title: Date Time Field
  description: The field contains temporal datetime values.
  required:
    - name
    - type
  properties:
    name:
      "$ref": "#/definitions/tableSchemaFieldName"
    title:
      "$ref": "#/definitions/title"
    description:
      "$ref": "#/definitions/description"
    type:
      description: The type keyword, which `MUST` be a value of `datetime`.
      enum:
      - datetime
    format:
      description: The format keyword options for `datetime` are `default`, `any`, and `{PATTERN}`.
      context: |-
        The following `format` options are supported:
          * **default**: An ISO8601 format string for datetime.
          * **any**: Any parsable representation of a date. The implementing library can attempt to parse the datetime via a range of strategies.
          * **{PATTERN}**: The value can be parsed according to `{PATTERN}`, which `MUST` follow the date formatting syntax of C / Python [strftime](http://strftime.org/).
      default: default
    constraints:
      title: Constraints
      description: The following constraints are supported for `datetime` fields.
      type: object
      properties:
        required:
          "$ref": "#/definitions/tableSchemaConstraintRequired"
        unique:
          "$ref": "#/definitions/tableSchemaConstraintUnique"
        enum:
          "$ref": "#/definitions/tableSchemaConstraintEnumString"
        minimum:
          "$ref": "#/definitions/tableSchemaConstraintMinimumString"
        maximum:
          "$ref": "#/definitions/tableSchemaConstraintMaximumString"
    rdfType:
      "$ref": "#/definitions/tableSchemaRdfType"
  examples:
  - |
      {
        "name": "timestamp",
        "type": "datetime"
      }
  - |
      {
        "name": "timestamp",
        "type": "datetime",
        "format": "default"
      }
tableSchemaFieldYear:
  type: object
  title: Year Field
  description: A calendar year, being an integer with 4 digits. Equivalent to [gYear
    in XML Schema](https://www.w3.org/TR/xmlschema-2/#gYear)
  required:
    - name
    - type
  properties:
    name:
      "$ref": "#/definitions/tableSchemaFieldName"
    title:
      "$ref": "#/definitions/title"
    description:
      "$ref": "#/definitions/description"
    type:
      description: The type keyword, which `MUST` be a value of `year`.
      enum:
      - year
    format:
      description: "There are no format keyword options for `year`: only `default` is allowed."
      enum:
      - default
      default: default
    constraints:
      title: Constraints
      description: The following constraints are supported for `year` fields.
      type: object
      properties:
        required:
          "$ref": "#/definitions/tableSchemaConstraintRequired"
        unique:
          "$ref": "#/definitions/tableSchemaConstraintUnique"
        enum:
          oneOf:
            - "$ref": "#/definitions/tableSchemaConstraintEnumString"
            - "$ref": "#/definitions/tableSchemaConstraintEnumInteger"
        minimum:
          oneOf:
            - "$ref": "#/definitions/tableSchemaConstraintMinimumString"
            - "$ref": "#/definitions/tableSchemaConstraintMinimumInteger"
        maximum:
          oneOf:
            - "$ref": "#/definitions/tableSchemaConstraintMaximumString"
            - "$ref": "#/definitions/tableSchemaConstraintMaximumInteger"
    rdfType:
      "$ref": "#/definitions/tableSchemaRdfType"
  examples:
  - |
      {
        "name": "year",
        "type": "year"
      }
  - |
      {
        "name": "year",
        "type": "year",
        "constraints": {
          "minimum": 1970,
          "maximum": 2003
        }
      }
tableSchemaFieldYearMonth:
  type: object
  title: Year Month Field
  description: A calendar year month, being an integer with 1 or 2 digits. Equivalent
    to [gYearMonth in XML Schema](https://www.w3.org/TR/xmlschema-2/#gYearMonth)
  required:
    - name
    - type
  properties:
    name:
      "$ref": "#/definitions/tableSchemaFieldName"
    title:
      "$ref": "#/definitions/title"
    description:
      "$ref": "#/definitions/description"
    type:
      description: The type keyword, which `MUST` be a value of `yearmonth`.
      enum:
      - yearmonth
    format:
      description: "There are no format keyword options for `yearmonth`: only `default` is allowed."
      enum:
      - default
      default: default
    constraints:
      title: Constraints
      description: The following constraints are supported for `yearmonth` fields.
      type: object
      properties:
        required:
          "$ref": "#/definitions/tableSchemaConstraintRequired"
        unique:
          "$ref": "#/definitions/tableSchemaConstraintUnique"
        pattern:
          "$ref": "#/definitions/tableSchemaConstraintPattern"
        enum:
          "$ref": "#/definitions/tableSchemaConstraintEnumString"
        minimum:
          "$ref": "#/definitions/tableSchemaConstraintMinimumString"
        maximum:
          "$ref": "#/definitions/tableSchemaConstraintMaximumString"
    rdfType:
      "$ref": "#/definitions/tableSchemaRdfType"
  examples:
  - |
      {
        "name": "month",
        "type": "yearmonth"
      }
  - |
      {
        "name": "month",
        "type": "yearmonth",
        "constraints": {
          "minimum": 1,
          "maximum": 6
        }
      }
tableSchemaFieldDuration:
  type: object
  title: Duration Field
  description: The field contains a duration of time.
  context: |-
    The lexical representation for duration is the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) extended format `PnYnMnDTnHnMnS`, where `nY` represents the number of years, `nM` the number of months, `nD` the number of days, 'T' is the date/time separator, `nH` the number of hours, `nM` the number of minutes and `nS` the number of seconds. The number of seconds can include decimal digits to arbitrary precision. Date and time elements including their designator may be omitted if their value is zero, and lower order elements may also be omitted for reduced precision. Here we follow the definition of [XML Schema duration datatype](http://www.w3.org/TR/xmlschema-2/#duration) directly and that definition is implicitly inlined here.
  required:
    - name
    - type
  properties:
    name:
      "$ref": "#/definitions/tableSchemaFieldName"
    title:
      "$ref": "#/definitions/title"
    description:
      "$ref": "#/definitions/description"
    type:
      description: The type keyword, which `MUST` be a value of `duration`.
      enum:
      - duration
    format:
      description: "There are no format keyword options for `duration`: only `default` is allowed."
      enum:
      - default
      default: default
    constraints:
      title: Constraints
      description: The following constraints are supported for `duration` fields.
      type: object
      properties:
        required:
          "$ref": "#/definitions/tableSchemaConstraintRequired"
        unique:
          "$ref": "#/definitions/tableSchemaConstraintUnique"
        enum:
          "$ref": "#/definitions/tableSchemaConstraintEnumString"
        minimum:
          "$ref": "#/definitions/tableSchemaConstraintMinimumString"
        maximum:
          "$ref": "#/definitions/tableSchemaConstraintMaximumString"
    rdfType:
      "$ref": "#/definitions/tableSchemaRdfType"
  examples:
  - |
      {
        "name": "period"
        "type": "duration"
      }
tableSchemaFieldObject:
  type: object
  title: Object Field
  description: The field contains data which can be parsed as a valid JSON object.
  required:
    - name
    - type
  properties:
    name:
      "$ref": "#/definitions/tableSchemaFieldName"
    title:
      "$ref": "#/definitions/title"
    description:
      "$ref": "#/definitions/description"
    type:
      description: The type keyword, which `MUST` be a value of `object`.
      enum:
      - object
    format:
      description: "There are no format keyword options for `object`: only `default` is allowed."
      enum:
      - default
      default: default
    constraints:
      title: Constraints
      description: The following constraints apply for `object` fields.
      type: object
      properties:
        required:
          "$ref": "#/definitions/tableSchemaConstraintRequired"
        unique:
          "$ref": "#/definitions/tableSchemaConstraintUnique"
        enum:
          oneOf:
            - "$ref": "#/definitions/tableSchemaConstraintEnumString"
            - "$ref": "#/definitions/tableSchemaConstraintEnumObject"
        minLength:
          "$ref": "#/definitions/tableSchemaConstraintMinLength"
        maxLength:
          "$ref": "#/definitions/tableSchemaConstraintMaxLength"
    rdfType:
      "$ref": "#/definitions/tableSchemaRdfType"
  examples:
  - |
      {
        "name": "extra"
        "type": "object"
      }
tableSchemaFieldArray:
  type: object
  title: Array Field
  description: The field contains data which can be parsed as a valid JSON array.
  required:
    - name
    - type
  properties:
    name:
      "$ref": "#/definitions/tableSchemaFieldName"
    title:
      "$ref": "#/definitions/title"
    description:
      "$ref": "#/definitions/description"
    type:
      description: The type keyword, which `MUST` be a value of `array`.
      enum:
      - array
    format:
      description: "There are no format keyword options for `array`: only `default` is allowed."
      enum:
      - default
      default: default
    constraints:
      title: Constraints
      description: The following constraints apply for `array` fields.
      type: object
      properties:
        required:
          "$ref": "#/definitions/tableSchemaConstraintRequired"
        unique:
          "$ref": "#/definitions/tableSchemaConstraintUnique"
        enum:
          oneOf:
            - "$ref": "#/definitions/tableSchemaConstraintEnumString"
            - "$ref": "#/definitions/tableSchemaConstraintEnumArray"
        minLength:
          "$ref": "#/definitions/tableSchemaConstraintMinLength"
        maxLength:
          "$ref": "#/definitions/tableSchemaConstraintMaxLength"
    rdfType:
      "$ref": "#/definitions/tableSchemaRdfType"
  examples:
  - |
      {
        "name": "options"
        "type": "array"
      }
tableSchemaFieldGeoJSON:
  type: object
  title: GeoJSON Field
  description: The field contains a JSON object according to GeoJSON or TopoJSON
  required:
    - name
    - type
  properties:
    name:
      "$ref": "#/definitions/tableSchemaFieldName"
    title:
      "$ref": "#/definitions/title"
    description:
      "$ref": "#/definitions/description"
    type:
      description: The type keyword, which `MUST` be a value of `geojson`.
      enum:
      - geojson
    format:
      description: The format keyword options for `geojson` are `default` and `topojson`.
      context: |-
        The following `format` options are supported:
          * **default**: A geojson object as per the [GeoJSON spec](http://geojson.org/).
          * **topojson**: A topojson object as per the [TopoJSON spec](https://github.com/topojson/topojson-specification/blob/master/README.md)
      enum:
      - default
      - topojson
      default: default
    constraints:
      title: Constraints
      description: The following constraints are supported for `geojson` fields.
      type: object
      properties:
        required:
          "$ref": "#/definitions/tableSchemaConstraintRequired"
        unique:
          "$ref": "#/definitions/tableSchemaConstraintUnique"
        enum:
          oneOf:
            - "$ref": "#/definitions/tableSchemaConstraintEnumString"
            - "$ref": "#/definitions/tableSchemaConstraintEnumObject"
        minLength:
          "$ref": "#/definitions/tableSchemaConstraintMinLength"
        maxLength:
          "$ref": "#/definitions/tableSchemaConstraintMaxLength"
    rdfType:
      "$ref": "#/definitions/tableSchemaRdfType"
  examples:
  - |
      {
        "name": "city_limits",
        "type": "geojson"
      }
  - |
      {
        "name": "city_limits",
        "type": "geojson",
        "format": "topojson"
      }
tableSchemaFieldGeoPoint:
  type: object
  title: GeoPoint Field
  description: The field contains data describing a geographic point.
  required:
    - name
    - type
  properties:
    name:
      "$ref": "#/definitions/tableSchemaFieldName"
    title:
      "$ref": "#/definitions/title"
    description:
      "$ref": "#/definitions/description"
    type:
      description: The type keyword, which `MUST` be a value of `geopoint`.
      enum:
      - geopoint
    format:
      description: The format keyword options for `geopoint` are `default`,`array`, and `object`.
      context: |-
        The following `format` options are supported:
          * **default**: A string of the pattern 'lon, lat', where `lon` is the longitude and `lat` is the latitude.
          * **array**: An array of exactly two items, where each item is either a number, or a string parsable as a number, and the first item is `lon` and the second item is `lat`.
          * **object**: A JSON object with exactly two keys, `lat` and `lon`
      notes:
      - Implementations `MUST` strip all white space in the default format of `lon, lat`.
      enum:
      - default
      - array
      - object
      default: default
    constraints:
      title: Constraints
      description: The following constraints are supported for `geopoint` fields.
      type: object
      properties:
        required:
          "$ref": "#/definitions/tableSchemaConstraintRequired"
        unique:
          "$ref": "#/definitions/tableSchemaConstraintUnique"
        enum:
          oneOf:
            - "$ref": "#/definitions/tableSchemaConstraintEnumString"
            - "$ref": "#/definitions/tableSchemaConstraintEnumArray"
            - "$ref": "#/definitions/tableSchemaConstraintEnumObject"
    rdfType:
      "$ref": "#/definitions/tableSchemaRdfType"
  examples:
  - |
      {
        "name": "post_office",
        "type": "geopoint"
      }
  - |
      {
        "name": "post_office",
        "type": "geopoint",
        "format": "array"
      }
tableSchemaFieldAny:
  type: object
  title: Any Field
  description: Any value is accepted, including values that are not captured by
    the type/format/constraint requirements of the specification.
  required:
    - name
    - type
  properties:
    name:
      "$ref": "#/definitions/tableSchemaFieldName"
    title:
      "$ref": "#/definitions/title"
    description:
      "$ref": "#/definitions/description"
    type:
      description: The type keyword, which `MUST` be a value of `any`.
      enum:
      - any
    constraints:
      title: Constraints
      description: The following constraints apply to `any` fields.
      type: object
      properties:
        required:
          "$ref": "#/definitions/tableSchemaConstraintRequired"
        unique:
          "$ref": "#/definitions/tableSchemaConstraintUnique"
        enum:
          "$ref": "#/definitions/tableSchemaConstraintEnumAny"
    rdfType:
      "$ref": "#/definitions/tableSchemaRdfType"
  examples:
  - |
      {
        "name": "notes",
        "type": "any"
tableSchemaConstraintRequired:
  type: boolean
  description: Indicates whether a property must have a value for each instance.
  context: An empty string is considered to be a missing value.
tableSchemaConstraintUnique:
  type: boolean
  description: When `true`, each value for the property `MUST` be unique.
tableSchemaConstraintPattern:
  type: string
  description: A regular expression pattern to test each value of the property against, where a truthy response indicates validity.
  context: "Regular expressions `SHOULD` conform to the [XML Schema regular expression syntax](http://www.w3.org/TR/xmlschema-2/#regexs)."
tableSchemaConstraintEnumString:
  type: array
  minItems: 1
  uniqueItems: true
  items:
    type: string
tableSchemaConstraintEnumBoolean:
  type: array
  minItems: 1
  uniqueItems: true
  items:
    type: boolean
tableSchemaConstraintEnumInteger:
  type: array
  minItems: 1
  uniqueItems: true
  items:
    type: integer
tableSchemaConstraintEnumNumber:
  type: array
  minItems: 1
  uniqueItems: true
  items:
    type: number
tableSchemaConstraintEnumArray:
  type: array
  minItems: 1
  uniqueItems: true
  items:
    type: array
tableSchemaConstraintEnumObject:
  type: array
  minItems: 1
  uniqueItems: true
  items:
    type: object
tableSchemaConstraintEnumAny:
  type: array
  minItems: 1
  uniqueItems: true
tableSchemaConstraintMinLength:
  type: integer
  description: An integer that specifies the minimum length of a value.
tableSchemaConstraintMaxLength:
  type: integer
  description: An integer that specifies the maximum length of a value.
tableSchemaConstraintMinimumString:
  type: string
tableSchemaConstraintMinimumInteger:
  type: integer
tableSchemaConstraintMinimumNumber:
  type: number
tableSchemaConstraintMinimumArray:
  type: array
tableSchemaConstraintMinimumObject:
  type: object
tableSchemaConstraintMaximumString:
  type: string
tableSchemaConstraintMaximumInteger:
  type: integer
tableSchemaConstraintMaximumNumber:
  type: number
tableSchemaConstraintMaximumArray:
  type: array
tableSchemaConstraintMaximumObject:
  type: object
tableSchemaRdfType:
  type: string
  description: The RDF type for this field.
tableSchemaBareNumber:
  type: boolean
  title: bareNumber
  description: a boolean field with a default of `true`. If `true` the physical contents of this field must follow the formatting constraints already set out. If `false` the contents of this field may contain leading and/or trailing non-numeric characters (which implementors MUST therefore strip). The purpose of `bareNumber` is to allow publishers to publish numeric data that contains trailing characters such as percentages e.g. `95%` or leading characters such as currencies e.g. `€95` or `EUR 95`. Note that it is entirely up to implementors what, if anything, they do with stripped text.
  default: true
