@dpkit/core
Version:
Fast TypeScript data management framework built on top of the Data Package standard and Polars DataFrames
1,390 lines (1,389 loc) • 53.6 kB
JSON
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Data Package",
"type": "object",
"required": ["resources"],
"properties": {
"profile": {
"propertyOrder": 10,
"title": "Profile",
"type": "string"
},
"name": {
"propertyOrder": 20,
"title": "Name",
"type": "string",
"pattern": "^([-a-z0-9._/])+$"
},
"id": {
"propertyOrder": 30,
"title": "ID",
"type": "string"
},
"title": {
"propertyOrder": 40,
"title": "Title",
"type": "string"
},
"description": {
"propertyOrder": 50,
"format": "textarea",
"title": "Description",
"type": "string"
},
"homepage": {
"propertyOrder": 60,
"title": "Home Page",
"type": "string",
"format": "uri"
},
"created": {
"propertyOrder": 70,
"title": "Created",
"type": "string",
"format": "date-time"
},
"contributors": {
"propertyOrder": 80,
"title": "Contributors",
"type": "array",
"minItems": 1,
"items": {
"title": "Contributor",
"properties": {
"title": {
"title": "Title",
"type": "string"
},
"path": {
"title": "Path",
"type": "string",
"pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$"
},
"email": {
"title": "Email",
"type": "string",
"format": "email"
},
"organization": {
"title": "Organization",
"type": "string"
},
"role": {
"type": "string",
"default": "contributor"
}
},
"required": ["title"]
}
},
"keywords": {
"propertyOrder": 90,
"title": "Keywords",
"type": "array",
"minItems": 1,
"items": {
"type": "string"
}
},
"image": {
"propertyOrder": 100,
"title": "Image",
"type": "string"
},
"licenses": {
"propertyOrder": 110,
"title": "Licenses",
"type": "array",
"minItems": 1,
"items": {
"title": "License",
"type": "object",
"anyOf": [
{
"required": ["name"]
},
{
"required": ["path"]
}
],
"properties": {
"name": {
"title": "Open Definition license identifier",
"type": "string",
"pattern": "^([-a-zA-Z0-9._])+$"
},
"path": {
"title": "Path",
"type": "string",
"pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$"
},
"title": {
"title": "Title",
"type": "string"
}
}
}
},
"resources": {
"propertyOrder": 120,
"title": "Data Resources",
"type": "array",
"minItems": 1,
"items": {
"title": "Data Resource",
"type": "object",
"oneOf": [
{
"required": ["name", "data"]
},
{
"required": ["name", "path"]
}
],
"properties": {
"profile": {
"propertyOrder": 10,
"title": "Profile",
"type": "string"
},
"name": {
"propertyOrder": 20,
"title": "Name",
"type": "string",
"pattern": "^([-a-z0-9._/])+$"
},
"path": {
"propertyOrder": 30,
"title": "Path",
"oneOf": [
{
"title": "Path",
"type": "string",
"pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$"
},
{
"type": "array",
"minItems": 1,
"items": {
"title": "Path",
"type": "string",
"pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$"
}
}
]
},
"data": {
"propertyOrder": 230,
"title": "Data"
},
"schema": {
"propertyOrder": 40,
"title": "Table Schema",
"type": ["string", "object"],
"required": ["fields"],
"properties": {
"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"
},
"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"
},
"type": {
"enum": ["number"]
},
"format": {
"enum": ["default"],
"default": "default"
},
"bareNumber": {
"type": "boolean",
"title": "bareNumber",
"default": true
},
"decimalChar": {
"type": "string"
},
"groupChar": {
"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"
}
]
}
}
},
"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"
},
"type": {
"enum": ["integer"]
},
"format": {
"enum": ["default"],
"default": "default"
},
"bareNumber": {
"type": "boolean",
"title": "bareNumber",
"default": true
},
"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"
}
]
}
}
},
"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"
},
"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"
}
}
},
"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"
},
"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"
}
}
},
"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"
},
"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"
}
}
},
"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"
},
"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"
}
]
}
}
},
"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"
},
"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"
}
}
},
"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"
},
"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"
},
"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"
}
}
},
"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"
},
"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"
},
"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"
},
"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"
}
}
},
"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"
},
"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"
}
}
},
"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"
},
"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"
}
}
}
]
}
},
"primaryKey": {
"oneOf": [
{
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "string"
}
},
{
"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": ["resource", "fields"],
"properties": {
"resource": {
"type": "string",
"default": ""
},
"fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1,
"uniqueItems": true
}
}
}
}
},
{
"properties": {
"fields": {
"type": "string"
},
"reference": {
"type": "object",
"required": ["resource", "fields"],
"properties": {
"resource": {
"type": "string",
"default": ""
},
"fields": {
"type": "string"
}
}
}
}
}
]
}
},
"missingValues": {
"type": "array",
"items": {
"type": "string"
},
"default": [""]
}
}
},
"title": {
"title": "Title",
"type": "string",
"propertyOrder": 50
},
"description": {
"title": "Description",
"type": "string",
"propertyOrder": 60,
"format": "textarea"
},
"homepage": {
"propertyOrder": 70,
"title": "Home Page",
"type": "string",
"format": "uri"
},
"sources": {
"propertyOrder": 140,
"options": {
"hidden": true
},
"title": "Sources",
"type": "array",
"minItems": 0,
"items": {
"title": "Source",
"type": "object",
"required": ["title"],
"properties": {
"title": {
"title": "Title",
"type": "string"
},
"path": {
"title": "Path",
"type": "string",
"pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$"
},
"email": {
"title": "Email",
"type": "string",
"format": "email"
}
}
}
},
"licenses": {
"propertyOrder": 150,
"options": {
"hidden": true
},
"title": "Licenses",
"type": "array",
"minItems": 1,
"items": {
"title": "License",
"type": "object",
"anyOf": [
{
"required": ["name"]
},
{
"required": ["path"]
}
],
"properties": {
"name": {
"title": "Open Definition license identifier",
"type": "string",
"pattern": "^([-a-zA-Z0-9._])+$"
},
"path": {
"title": "Path",
"type": "string",
"pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$"
},
"title": {
"title": "Title",
"type": "string"
}
}
}