366 lines
9.9 KiB
JSON
366 lines
9.9 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://paperspec.scient.ing/schemas/dataset.schema.json",
|
|
"title": "Dataset",
|
|
"description": "datapackage.json of scienting-dataset/1: a Frictionless Data Package with units, uncertainty and origin; spec/15-datasets.md.",
|
|
"type": "object",
|
|
"properties": {
|
|
"format": {
|
|
"const": "scienting-dataset/1"
|
|
},
|
|
"id": {
|
|
"$ref": "common.schema.json#/$defs/datasetId"
|
|
},
|
|
"name": {
|
|
"$ref": "common.schema.json#/$defs/key"
|
|
},
|
|
"title": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"licenses": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"path": {
|
|
"$ref": "common.schema.json#/$defs/url"
|
|
}
|
|
},
|
|
"required": [
|
|
"name"
|
|
],
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"resources": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"$ref": "common.schema.json#/$defs/key"
|
|
},
|
|
"path": {
|
|
"type": "string",
|
|
"pattern": "^[a-z0-9][a-z0-9._-]*\\.(csv|parquet)$"
|
|
},
|
|
"format": {
|
|
"enum": [
|
|
"csv",
|
|
"parquet"
|
|
]
|
|
},
|
|
"mediatype": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"encoding": {
|
|
"const": "utf-8"
|
|
},
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"fields": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z_][A-Za-z0-9_.-]*$"
|
|
},
|
|
"type": {
|
|
"enum": [
|
|
"string",
|
|
"number",
|
|
"integer",
|
|
"boolean",
|
|
"date",
|
|
"datetime",
|
|
"any"
|
|
]
|
|
},
|
|
"title": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"unit": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"uncertainty": {
|
|
"type": "object",
|
|
"properties": {
|
|
"field": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"kind": {
|
|
"enum": [
|
|
"sd",
|
|
"se",
|
|
"resolution",
|
|
"unknown"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"kind"
|
|
],
|
|
"additionalProperties": false
|
|
},
|
|
"constraints": {
|
|
"type": "object"
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"type"
|
|
],
|
|
"additionalProperties": false,
|
|
"allOf": [
|
|
{
|
|
"if": {
|
|
"properties": {
|
|
"type": {
|
|
"const": "number"
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"required": [
|
|
"unit"
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"minItems": 1
|
|
},
|
|
"primaryKey": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"minItems": 1
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"fields"
|
|
],
|
|
"additionalProperties": false
|
|
},
|
|
"origin": {
|
|
"oneOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"kind": {
|
|
"const": "reported"
|
|
},
|
|
"anchors": {
|
|
"const": "anchors.jsonl"
|
|
}
|
|
},
|
|
"required": [
|
|
"kind",
|
|
"anchors"
|
|
],
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"kind": {
|
|
"const": "digitized"
|
|
},
|
|
"digitization": {
|
|
"$ref": "common.schema.json#/$defs/recordId"
|
|
},
|
|
"anchors": {
|
|
"const": "anchors.jsonl"
|
|
}
|
|
},
|
|
"required": [
|
|
"kind",
|
|
"digitization"
|
|
],
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"kind": {
|
|
"const": "computed"
|
|
},
|
|
"claim": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"pin": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
}
|
|
},
|
|
"required": [
|
|
"kind",
|
|
"claim",
|
|
"pin"
|
|
],
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"kind": {
|
|
"const": "measured"
|
|
},
|
|
"provenance": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
}
|
|
},
|
|
"required": [
|
|
"kind",
|
|
"provenance"
|
|
],
|
|
"additionalProperties": false
|
|
}
|
|
]
|
|
},
|
|
"origin_field": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"origins": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"oneOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"kind": {
|
|
"const": "reported"
|
|
},
|
|
"anchors": {
|
|
"const": "anchors.jsonl"
|
|
}
|
|
},
|
|
"required": [
|
|
"kind",
|
|
"anchors"
|
|
],
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"kind": {
|
|
"const": "digitized"
|
|
},
|
|
"digitization": {
|
|
"$ref": "common.schema.json#/$defs/recordId"
|
|
},
|
|
"anchors": {
|
|
"const": "anchors.jsonl"
|
|
}
|
|
},
|
|
"required": [
|
|
"kind",
|
|
"digitization"
|
|
],
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"kind": {
|
|
"const": "computed"
|
|
},
|
|
"claim": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"pin": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
}
|
|
},
|
|
"required": [
|
|
"kind",
|
|
"claim",
|
|
"pin"
|
|
],
|
|
"additionalProperties": false
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"kind": {
|
|
"const": "measured"
|
|
},
|
|
"provenance": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
}
|
|
},
|
|
"required": [
|
|
"kind",
|
|
"provenance"
|
|
],
|
|
"additionalProperties": false
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"path",
|
|
"schema"
|
|
],
|
|
"additionalProperties": false,
|
|
"anyOf": [
|
|
{
|
|
"required": [
|
|
"origin"
|
|
]
|
|
},
|
|
{
|
|
"required": [
|
|
"origin_field",
|
|
"origins"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"minItems": 1
|
|
}
|
|
},
|
|
"required": [
|
|
"format",
|
|
"id",
|
|
"name",
|
|
"resources"
|
|
],
|
|
"additionalProperties": false
|
|
}
|