foi-process-event-logs / schemas /document-bundle.schema.json
edithatogo's picture
Publish reviewed foi-process fixture event logs
b7cd067 verified
Raw
History Blame Contribute Delete
8.74 kB
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://w3id.org/foi-process/schema/document-bundle.schema.json",
"title": "Document Bundle",
"type": "object",
"required": [
"schema_version",
"document_id",
"source_evidence_id",
"source_sha256",
"media_type",
"created_at",
"extractor",
"pages",
"privacy"
],
"properties": {
"schema_version": {
"type": "string"
},
"document_id": {
"type": "string",
"minLength": 3,
"maxLength": 512,
"pattern": "^\\S+:\\S+$"
},
"source_evidence_id": {
"type": "string",
"minLength": 3,
"maxLength": 512,
"pattern": "^\\S+:\\S+$"
},
"source_sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
},
"media_type": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"extractor": {
"type": "object",
"required": [
"name",
"version"
],
"properties": {
"name": {
"type": "string"
},
"version": {
"type": "string"
},
"runtime": {
"type": "string"
},
"model_sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
},
"license": {
"type": "string"
}
},
"additionalProperties": false
},
"pages": {
"type": "array",
"items": {
"type": "object",
"required": [
"page_number",
"page_sha256",
"width",
"height",
"extraction_method"
],
"properties": {
"page_number": {
"type": "integer",
"minimum": 1
},
"page_sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
},
"width": {
"type": "number",
"exclusiveMinimum": 0
},
"height": {
"type": "number",
"exclusiveMinimum": 0
},
"extraction_method": {
"enum": [
"born_digital",
"ocr",
"hybrid",
"manual"
]
},
"model": {
"type": "object",
"required": [
"name",
"version"
],
"properties": {
"name": {
"type": "string"
},
"version": {
"type": "string"
},
"runtime": {
"type": "string"
},
"model_sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
},
"license": {
"type": "string"
}
},
"additionalProperties": false
},
"quality_score": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"warnings": {
"type": "array",
"items": {
"type": "string"
}
},
"segments": {
"type": "array",
"items": {
"type": "object",
"required": [
"segment_id",
"reading_order",
"text_sha256",
"character_count",
"privacy"
],
"properties": {
"segment_id": {
"type": "string",
"minLength": 3,
"maxLength": 512,
"pattern": "^\\S+:\\S+$"
},
"reading_order": {
"type": "integer",
"minimum": 0
},
"text_sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
},
"character_count": {
"type": "integer",
"minimum": 0
},
"text_blob_id": {
"type": "string",
"minLength": 3,
"maxLength": 512,
"pattern": "^\\S+:\\S+$"
},
"inline_text": {
"type": "string"
},
"bbox": {
"type": "object",
"required": [
"page",
"x",
"y",
"width",
"height"
],
"properties": {
"page": {
"type": "integer",
"minimum": 1
},
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"width": {
"type": "number",
"minimum": 0
},
"height": {
"type": "number",
"minimum": 0
},
"coordinate_system": {
"type": "string"
}
},
"additionalProperties": false
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"language": {
"type": "string"
},
"privacy": {
"type": "object",
"required": [
"sensitivity",
"access_tier",
"disposition"
],
"properties": {
"sensitivity": {
"enum": [
"public",
"personal",
"sensitive_personal",
"restricted",
"unknown"
]
},
"access_tier": {
"enum": [
"public",
"research",
"restricted",
"embargoed"
]
},
"disposition": {
"enum": [
"publish",
"publish_metadata_only",
"withhold",
"needs_review"
]
},
"reason_codes": {
"type": "array",
"items": {
"type": "string"
}
},
"assessed_by": {
"type": "string",
"minLength": 3,
"maxLength": 512,
"pattern": "^\\S+:\\S+$"
},
"human_reviewed": {
"type": "boolean"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}
},
"privacy": {
"type": "object",
"required": [
"sensitivity",
"access_tier",
"disposition"
],
"properties": {
"sensitivity": {
"enum": [
"public",
"personal",
"sensitive_personal",
"restricted",
"unknown"
]
},
"access_tier": {
"enum": [
"public",
"research",
"restricted",
"embargoed"
]
},
"disposition": {
"enum": [
"publish",
"publish_metadata_only",
"withhold",
"needs_review"
]
},
"reason_codes": {
"type": "array",
"items": {
"type": "string"
}
},
"assessed_by": {
"type": "string",
"minLength": 3,
"maxLength": 512,
"pattern": "^\\S+:\\S+$"
},
"human_reviewed": {
"type": "boolean"
}
},
"additionalProperties": false
},
"attributes": {
"type": "object"
}
},
"additionalProperties": false
}