dilutionrisk-data / schema /manifest-v1.schema.json
mzx's picture
Add manifest v1 JSON Schema
ad7851a verified
Raw History Blame Contribute Delete
4.11 kB
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://huggingface.co/datasets/mzx/dilutionrisk-data/raw/main/schema/manifest-v1.schema.json",
"title": "DilutionRisk publication manifest v1",
"type": "object",
"additionalProperties": false,
"required": [
"schema_version",
"dataset_revision",
"published_at",
"source_watermark",
"publisher",
"artifacts"
],
"properties": {
"schema_version": {
"const": 1
},
"dataset_revision": {
"description": "Exact immutable Hugging Face Dataset commit SHA selected by this manifest.",
"type": "string",
"pattern": "^[0-9a-f]{40}$"
},
"published_at": {
"type": "string",
"format": "date-time"
},
"source_watermark": {
"type": "object",
"additionalProperties": false,
"required": [
"provider",
"retrieved_through",
"max_source_document_id",
"document_count"
],
"properties": {
"provider": {
"const": "ASX"
},
"retrieved_through": {
"type": "string",
"format": "date-time"
},
"max_source_document_id": {
"type": "string",
"pattern": "^[A-Za-z0-9._-]+$"
},
"document_count": {
"type": "integer",
"minimum": 0
}
}
},
"publisher": {
"type": "object",
"additionalProperties": false,
"required": ["name", "version"],
"properties": {
"name": {
"type": "string",
"minLength": 1
},
"version": {
"type": "string",
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
}
}
},
"artifacts": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/artifact"
}
}
},
"definitions": {
"checksum": {
"type": "object",
"additionalProperties": false,
"required": ["algorithm", "value"],
"properties": {
"algorithm": {
"const": "sha256"
},
"value": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
}
}
},
"artifact": {
"type": "object",
"additionalProperties": false,
"required": [
"storage",
"path",
"content_type",
"size_bytes",
"checksum",
"row_count"
],
"properties": {
"storage": {
"enum": ["dataset", "bucket"]
},
"path": {
"type": "string",
"pattern": "^(data/v1/[a-z][a-z0-9_-]*/date=[0-9]{4}-[0-9]{2}-[0-9]{2}/part-[0-9a-f]{64}\\.parquet|indexes/v1/[0-9a-f]{40}/search-[0-9a-f]{64}\\.sqlite|artifacts/v1/asx/[A-Z0-9][A-Z0-9._-]*/[A-Za-z0-9._-]+/(raw/[0-9a-f]{64}\\.pdf|markdown/[a-z0-9][a-z0-9._-]*/[0-9a-f]{64}\\.md))$"
},
"document_id": {
"type": "string",
"pattern": "^ASX:[A-Z0-9][A-Z0-9._-]*:[A-Za-z0-9._-]+$"
},
"content_type": {
"type": "string",
"minLength": 1
},
"size_bytes": {
"type": "integer",
"minimum": 0
},
"checksum": {
"$ref": "#/definitions/checksum"
},
"row_count": {
"type": ["integer", "null"],
"minimum": 0
}
},
"allOf": [
{
"if": {
"properties": {
"storage": {
"const": "bucket"
}
}
},
"then": {
"required": ["document_id"],
"properties": {
"row_count": {
"type": "null"
}
}
}
},
{
"if": {
"properties": {
"storage": {
"const": "dataset"
}
}
},
"then": {
"properties": {
"row_count": {
"type": "integer",
"minimum": 0
}
}
}
}
]
}
}
}