UNPKG

@dpkit/core

Version:

Fast TypeScript data management framework built on top of the Data Package standard and Polars DataFrames

1,719 lines (1,718 loc) 49.6 kB
{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Table Schema", "type": ["string", "object"], "required": ["fields"], "properties": { "$schema": { "default": "https://datapackage.org/profiles/1.0/tableschema.json", "propertyOrder": 10, "title": "Profile", "type": "string" }, "fields": { "type": "array", "minItems": 1, "items": { "title": "Table Schema Field", "type": "object", "oneOf": [ { "type": "object", "title": "String Field", "required": ["name"], "properties": { "name": { "title": "Name", "type": "string" }, "title": { "title": "Title", "type": "string" }, "description": { "title": "Description", "type": "string" }, "example": { "title": "Example", "type": "string" }, "missingValues": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "array", "items": { "type": "object", "required": ["value"], "properties": { "value": { "type": "string" }, "label": { "type": "string" } } } } ], "default": [""] }, "categories": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "array", "items": { "type": "object", "required": ["value"], "properties": { "value": { "type": "string" }, "label": { "type": "string" } } } } ] }, "categoriesOrdered": { "type": "boolean" }, "type": { "enum": ["string"] }, "format": { "enum": ["default", "email", "uri", "binary", "uuid"], "default": "default" }, "constraints": { "title": "Constraints", "type": "object", "properties": { "required": { "type": "boolean" }, "unique": { "type": "boolean" }, "pattern": { "type": "string" }, "enum": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string" } }, "minLength": { "type": "integer" }, "maxLength": { "type": "integer" } } }, "rdfType": { "type": "string" } } }, { "type": "object", "title": "Number Field", "required": ["name", "type"], "properties": { "name": { "title": "Name", "type": "string" }, "title": { "title": "Title", "type": "string" }, "description": { "title": "Description", "type": "string" }, "example": { "title": "Example", "type": "string" }, "missingValues": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "array", "items": { "type": "object", "required": ["value"], "properties": { "value": { "type": "string" }, "label": { "type": "string" } } } } ], "default": [""] }, "type": { "enum": ["number"] }, "format": { "enum": ["default"], "default": "default" }, "bareNumber": { "type": "boolean", "title": "bareNumber", "default": true }, "groupChar": { "type": "string", "title": "groupChar" }, "decimalChar": { "type": "string" }, "constraints": { "title": "Constraints", "type": "object", "properties": { "required": { "type": "boolean" }, "unique": { "type": "boolean" }, "enum": { "oneOf": [ { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string" } }, { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "number" } } ] }, "minimum": { "oneOf": [ { "type": "string" }, { "type": "number" } ] }, "maximum": { "oneOf": [ { "type": "string" }, { "type": "number" } ] }, "exclusiveMinimum": { "oneOf": [ { "type": "string" }, { "type": "number" } ] }, "exclusiveMaximum": { "oneOf": [ { "type": "string" }, { "type": "number" } ] } } }, "rdfType": { "type": "string" } } }, { "type": "object", "title": "Integer Field", "required": ["name", "type"], "properties": { "name": { "title": "Name", "type": "string" }, "title": { "title": "Title", "type": "string" }, "description": { "title": "Description", "type": "string" }, "example": { "title": "Example", "type": "string" }, "missingValues": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "array", "items": { "type": "object", "required": ["value"], "properties": { "value": { "type": "string" }, "label": { "type": "string" } } } } ], "default": [""] }, "categories": { "anyOf": [ { "type": "array", "items": { "type": "integer" } }, { "type": "array", "items": { "type": "object", "required": ["value"], "properties": { "value": { "type": "integer" }, "label": { "type": "string" } } } } ] }, "categoriesOrdered": { "type": "boolean" }, "type": { "enum": ["integer"] }, "format": { "enum": ["default"], "default": "default" }, "bareNumber": { "type": "boolean", "title": "bareNumber", "default": true }, "groupChar": { "type": "string", "title": "groupChar" }, "constraints": { "title": "Constraints", "type": "object", "properties": { "required": { "type": "boolean" }, "unique": { "type": "boolean" }, "enum": { "oneOf": [ { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string" } }, { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "integer" } } ] }, "minimum": { "oneOf": [ { "type": "string" }, { "type": "integer" } ] }, "maximum": { "oneOf": [ { "type": "string" }, { "type": "integer" } ] }, "exclusiveMinimum": { "oneOf": [ { "type": "string" }, { "type": "integer" } ] }, "exclusiveMaximum": { "oneOf": [ { "type": "string" }, { "type": "integer" } ] } } }, "rdfType": { "type": "string" } } }, { "type": "object", "title": "Date Field", "required": ["name", "type"], "properties": { "name": { "title": "Name", "type": "string" }, "title": { "title": "Title", "type": "string" }, "description": { "title": "Description", "type": "string" }, "example": { "title": "Example", "type": "string" }, "missingValues": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "array", "items": { "type": "object", "required": ["value"], "properties": { "value": { "type": "string" }, "label": { "type": "string" } } } } ], "default": [""] }, "type": { "enum": ["date"] }, "format": { "default": "default" }, "constraints": { "title": "Constraints", "type": "object", "properties": { "required": { "type": "boolean" }, "unique": { "type": "boolean" }, "enum": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string" } }, "minimum": { "type": "string" }, "maximum": { "type": "string" }, "exclusiveMinimum": { "type": "string" }, "exclusiveMaximum": { "type": "string" } } }, "rdfType": { "type": "string" } } }, { "type": "object", "title": "Time Field", "required": ["name", "type"], "properties": { "name": { "title": "Name", "type": "string" }, "title": { "title": "Title", "type": "string" }, "description": { "title": "Description", "type": "string" }, "example": { "title": "Example", "type": "string" }, "missingValues": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "array", "items": { "type": "object", "required": ["value"], "properties": { "value": { "type": "string" }, "label": { "type": "string" } } } } ], "default": [""] }, "type": { "enum": ["time"] }, "format": { "default": "default" }, "constraints": { "title": "Constraints", "type": "object", "properties": { "required": { "type": "boolean" }, "unique": { "type": "boolean" }, "enum": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string" } }, "minimum": { "type": "string" }, "maximum": { "type": "string" }, "exclusiveMinimum": { "type": "string" }, "exclusiveMaximum": { "type": "string" } } }, "rdfType": { "type": "string" } } }, { "type": "object", "title": "Date Time Field", "required": ["name", "type"], "properties": { "name": { "title": "Name", "type": "string" }, "title": { "title": "Title", "type": "string" }, "description": { "title": "Description", "type": "string" }, "example": { "title": "Example", "type": "string" }, "missingValues": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "array", "items": { "type": "object", "required": ["value"], "properties": { "value": { "type": "string" }, "label": { "type": "string" } } } } ], "default": [""] }, "type": { "enum": ["datetime"] }, "format": { "default": "default" }, "constraints": { "title": "Constraints", "type": "object", "properties": { "required": { "type": "boolean" }, "unique": { "type": "boolean" }, "enum": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string" } }, "minimum": { "type": "string" }, "maximum": { "type": "string" }, "exclusiveMinimum": { "type": "string" }, "exclusiveMaximum": { "type": "string" } } }, "rdfType": { "type": "string" } } }, { "type": "object", "title": "Year Field", "required": ["name", "type"], "properties": { "name": { "title": "Name", "type": "string" }, "title": { "title": "Title", "type": "string" }, "description": { "title": "Description", "type": "string" }, "example": { "title": "Example", "type": "string" }, "missingValues": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "array", "items": { "type": "object", "required": ["value"], "properties": { "value": { "type": "string" }, "label": { "type": "string" } } } } ], "default": [""] }, "type": { "enum": ["year"] }, "format": { "enum": ["default"], "default": "default" }, "constraints": { "title": "Constraints", "type": "object", "properties": { "required": { "type": "boolean" }, "unique": { "type": "boolean" }, "enum": { "oneOf": [ { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string" } }, { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "integer" } } ] }, "minimum": { "oneOf": [ { "type": "string" }, { "type": "integer" } ] }, "maximum": { "oneOf": [ { "type": "string" }, { "type": "integer" } ] }, "exclusiveMinimum": { "oneOf": [ { "type": "string" }, { "type": "integer" } ] }, "exclusiveMaximum": { "oneOf": [ { "type": "string" }, { "type": "integer" } ] } } }, "rdfType": { "type": "string" } } }, { "type": "object", "title": "Year Month Field", "required": ["name", "type"], "properties": { "name": { "title": "Name", "type": "string" }, "title": { "title": "Title", "type": "string" }, "description": { "title": "Description", "type": "string" }, "example": { "title": "Example", "type": "string" }, "missingValues": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "array", "items": { "type": "object", "required": ["value"], "properties": { "value": { "type": "string" }, "label": { "type": "string" } } } } ], "default": [""] }, "type": { "enum": ["yearmonth"] }, "format": { "enum": ["default"], "default": "default" }, "constraints": { "title": "Constraints", "type": "object", "properties": { "required": { "type": "boolean" }, "unique": { "type": "boolean" }, "enum": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string" } }, "minimum": { "type": "string" }, "maximum": { "type": "string" }, "exclusiveMinimum": { "type": "string" }, "exclusiveMaximum": { "type": "string" } } }, "rdfType": { "type": "string" } } }, { "type": "object", "title": "Boolean Field", "required": ["name", "type"], "properties": { "name": { "title": "Name", "type": "string" }, "title": { "title": "Title", "type": "string" }, "description": { "title": "Description", "type": "string" }, "example": { "title": "Example", "type": "string" }, "missingValues": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "array", "items": { "type": "object", "required": ["value"], "properties": { "value": { "type": "string" }, "label": { "type": "string" } } } } ], "default": [""] }, "type": { "enum": ["boolean"] }, "format": { "enum": ["default"], "default": "default" }, "trueValues": { "type": "array", "minItems": 1, "items": { "type": "string" }, "default": ["true", "True", "TRUE", "1"] }, "falseValues": { "type": "array", "minItems": 1, "items": { "type": "string" }, "default": ["false", "False", "FALSE", "0"] }, "constraints": { "title": "Constraints", "type": "object", "properties": { "required": { "type": "boolean" }, "enum": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "boolean" } } } }, "rdfType": { "type": "string" } } }, { "type": "object", "title": "Object Field", "required": ["name", "type"], "properties": { "name": { "title": "Name", "type": "string" }, "title": { "title": "Title", "type": "string" }, "description": { "title": "Description", "type": "string" }, "example": { "title": "Example", "type": "string" }, "missingValues": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "array", "items": { "type": "object", "required": ["value"], "properties": { "value": { "type": "string" }, "label": { "type": "string" } } } } ], "default": [""] }, "type": { "enum": ["object"] }, "format": { "enum": ["default"], "default": "default" }, "constraints": { "title": "Constraints", "type": "object", "properties": { "required": { "type": "boolean" }, "unique": { "type": "boolean" }, "enum": { "oneOf": [ { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string" } }, { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "object" } } ] }, "minLength": { "type": "integer" }, "maxLength": { "type": "integer" }, "jsonSchema": { "type": "object" } } }, "rdfType": { "type": "string" } } }, { "type": "object", "title": "GeoPoint Field", "required": ["name", "type"], "properties": { "name": { "title": "Name", "type": "string" }, "title": { "title": "Title", "type": "string" }, "description": { "title": "Description", "type": "string" }, "example": { "title": "Example", "type": "string" }, "missingValues": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "array", "items": { "type": "object", "required": ["value"], "properties": { "value": { "type": "string" }, "label": { "type": "string" } } } } ], "default": [""] }, "type": { "enum": ["geopoint"] }, "format": { "notes": [ "Implementations `MUST` strip all white space in the default format of `lon, lat`." ], "enum": ["default", "array", "object"], "default": "default" }, "constraints": { "title": "Constraints", "type": "object", "properties": { "required": { "type": "boolean" }, "unique": { "type": "boolean" }, "enum": { "oneOf": [ { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string" } }, { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "array" } }, { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "object" } } ] } } }, "rdfType": { "type": "string" } } }, { "type": "object", "title": "GeoJSON Field", "required": ["name", "type"], "properties": { "name": { "title": "Name", "type": "string" }, "title": { "title": "Title", "type": "string" }, "description": { "title": "Description", "type": "string" }, "example": { "title": "Example", "type": "string" }, "missingValues": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "array", "items": { "type": "object", "required": ["value"], "properties": { "value": { "type": "string" }, "label": { "type": "string" } } } } ], "default": [""] }, "type": { "enum": ["geojson"] }, "format": { "enum": ["default", "topojson"], "default": "default" }, "constraints": { "title": "Constraints", "type": "object", "properties": { "required": { "type": "boolean" }, "unique": { "type": "boolean" }, "enum": { "oneOf": [ { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string" } }, { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "object" } } ] }, "minLength": { "type": "integer" }, "maxLength": { "type": "integer" } } }, "rdfType": { "type": "string" } } }, { "type": "object", "title": "Array Field", "required": ["name", "type"], "properties": { "name": { "title": "Name", "type": "string" }, "title": { "title": "Title", "type": "string" }, "description": { "title": "Description", "type": "string" }, "example": { "title": "Example", "type": "string" }, "missingValues": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "array", "items": { "type": "object", "required": ["value"], "properties": { "value": { "type": "string" }, "label": { "type": "string" } } } } ], "default": [""] }, "type": { "enum": ["array"] }, "format": { "enum": ["default"], "default": "default" }, "constraints": { "title": "Constraints", "type": "object", "properties": { "required": { "type": "boolean" }, "unique": { "type": "boolean" }, "enum": { "oneOf": [ { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string" } }, { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "array" } } ] }, "minLength": { "type": "integer" }, "maxLength": { "type": "integer" }, "jsonSchema": { "type": "object" } } }, "rdfType": { "type": "string" } } }, { "type": "object", "title": "Duration Field", "required": ["name", "type"], "properties": { "name": { "title": "Name", "type": "string" }, "title": { "title": "Title", "type": "string" }, "description": { "title": "Description", "type": "string" }, "example": { "title": "Example", "type": "string" }, "missingValues": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "array", "items": { "type": "object", "required": ["value"], "properties": { "value": { "type": "string" }, "label": { "type": "string" } } } } ], "default": [""] }, "type": { "enum": ["duration"] }, "format": { "enum": ["default"], "default": "default" }, "constraints": { "title": "Constraints", "type": "object", "properties": { "required": { "type": "boolean" }, "unique": { "type": "boolean" }, "enum": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string" } }, "minimum": { "type": "string" }, "maximum": { "type": "string" }, "exclusiveMinimum": { "type": "string" }, "exclusiveMaximum": { "type": "string" } } }, "rdfType": { "type": "string" } } }, { "type": "object", "title": "Any Field", "required": ["name", "type"], "properties": { "name": { "title": "Name", "type": "string" }, "title": { "title": "Title", "type": "string" }, "description": { "title": "Description", "type": "string" }, "example": { "title": "Example", "type": "string" }, "missingValues": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "array", "items": { "type": "object", "required": ["value"], "properties": { "value": { "type": "string" }, "label": { "type": "string" } } } } ], "default": [""] }, "type": { "enum": ["any"] }, "constraints": { "title": "Constraints", "type": "object", "properties": { "required": { "type": "boolean" }, "unique": { "type": "boolean" }, "enum": { "type": "array", "minItems": 1, "uniqueItems": true } } }, "rdfType": { "type": "string" } } } ] } }, "fieldsMatch": { "type": "array", "item": { "type": "string", "enum": ["exact", "equal", "subset", "superset", "partial"], "default": "exact" } }, "primaryKey": { "oneOf": [ { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string" } }, { "type": "string" } ] }, "uniqueKeys": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string" } } }, "foreignKeys": { "type": "array", "minItems": 1, "items": { "title": "Table Schema Foreign Key", "type": "object", "required": ["fields", "reference"], "oneOf": [ { "properties": { "fields": { "type": "array", "items": { "type": "string", "minItems": 1, "uniqueItems": true } }, "reference": { "type": "object", "required": ["fields"], "properties": { "resource": { "type": "string" }, "fields": { "type": "array", "items": { "type": "string" }, "minItems": 1, "uniqueItems": true } } } } }, { "properties": { "fields": { "type": "string" }, "reference": { "type": "object", "required": ["fields"], "properties": { "resource": { "type": "string" }, "fields": { "type": "string" } } } } } ] } }, "missingValues": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "array", "items": { "type": "object", "required": ["value"], "properties": { "value": { "type": "string" }, "label": { "type": "string" } } } } ], "default": [""] } } }