{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://paperspec.scient.ing/schemas/common.schema.json", "title": "Shared definitions", "description": "Definitions every scienting schema shares; spec/01-conventions.md.", "$defs": { "hash": { "type": "string", "pattern": "^[0-9a-f]{64}$", "description": "SHA-256 or HMAC-SHA-256, 64 lowercase hex digits." }, "hash6": { "type": "string", "pattern": "^[0-9a-f]{6}$" }, "nodeId": { "type": "string", "pattern": "^[a-hjkmnp-tv-z][0-9a-hjkmnp-tv-z]{6}$", "description": "Seven lowercase Crockford base32 characters, the first a letter." }, "recordId": { "type": "string", "pattern": "^[a-hjkmnp-tv-z][0-9a-hjkmnp-tv-z]{6,25}$" }, "key": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]*$", "maxLength": 128 }, "alias": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]*[._-][a-z0-9._-]*$", "maxLength": 128, "description": "A legacy ID; it always contains a separator, so it never looks like a node ID." }, "nodeRef": { "anyOf": [ { "$ref": "#/$defs/nodeId" }, { "$ref": "#/$defs/alias" } ] }, "qualifiedKey": { "type": "string", "pattern": "^([a-z0-9][a-z0-9._-]*/)?[a-z0-9][a-z0-9._-]*$", "maxLength": 257 }, "datasetId": { "type": "string", "pattern": "^ds-[a-z0-9][a-z0-9._-]*$", "maxLength": 128 }, "address": { "type": "string", "pattern": "^([a-z0-9][a-z0-9._-]*/)?[a-z0-9][a-z0-9._-]*#[a-z0-9][a-z0-9._-]*(@[0-9a-f]{6})?(\\[(0|[1-9][0-9]*):(0|[1-9][0-9]*)\\])?$" }, "time": { "type": "string", "pattern": "^[0-9]{4}-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]:[0-5][0-9]:[0-6][0-9]Z$" }, "date": { "type": "string", "pattern": "^[0-9]{4}(-[0-1][0-9](-[0-3][0-9])?)?$" }, "decimal": { "type": "string", "pattern": "^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$", "description": "A decimal that carries meaning, as a string." }, "level": { "enum": [ "F0", "F1", "F2", "F3" ] }, "receiptLevel": { "enum": [ "F1", "F2", "F3" ] }, "nodeKind": { "enum": [ "document", "front", "title", "authors", "abstract", "keywords", "notes", "section", "heading", "paragraph", "sentence", "equation", "equation-line", "figure", "panel", "caption", "figure-note", "table", "table-head", "table-body", "table-note", "row", "cell", "list", "item", "quote", "code", "algorithm", "theorem", "footnote", "back", "acknowledgments", "references", "reference", "appendix" ] }, "box": { "type": "array", "items": { "type": "number" }, "minItems": 4, "maxItems": 4, "description": "[x0, y0, x1, y1] in PDF points, origin top left after rotation." }, "size": { "type": "array", "items": { "type": "number", "exclusiveMinimum": 0 }, "minItems": 2, "maxItems": 2 }, "url": { "type": "string", "pattern": "^[a-z][a-z0-9+.-]*:[^ ]+$" }, "language": { "type": "string", "pattern": "^[A-Za-z]{2,3}(-[A-Za-z0-9]{1,8})*$" }, "spdx": { "type": "string", "pattern": "^[A-Za-z0-9.+-]+( (AND|OR|WITH) [A-Za-z0-9.+-]+)*$" }, "license": { "type": "object", "properties": { "spdx": { "$ref": "#/$defs/spdx" }, "text": { "type": "string", "minLength": 1 }, "url": { "$ref": "#/$defs/url" } }, "additionalProperties": false, "minProperties": 1 }, "tri": { "enum": [ true, false, "unknown" ] }, "base64": { "type": "string", "pattern": "^[A-Za-z0-9+/]+={0,2}$" }, "processor": { "enum": [ "local", "tenancy", "outside-no-retention", "outside" ] }, "basis": { "enum": [ "open-license", "publisher-tdm", "collective-license", "subscription", "own-work", "permission", "unknown" ] }, "signature": { "type": "object", "properties": { "scheme": { "enum": [ "ed25519", "ssh", "gpg", "sigstore" ] }, "key": { "$ref": "#/$defs/key" }, "value": { "type": "string", "minLength": 1 } }, "required": [ "scheme", "key", "value" ], "additionalProperties": false }, "evidence": { "type": "object", "properties": { "kind": { "enum": [ "crop", "witness", "source-file", "person" ] }, "sha256": { "$ref": "#/$defs/hash" }, "node": { "$ref": "#/$defs/nodeId" }, "page_fp": { "$ref": "#/$defs/hash" }, "box": { "$ref": "#/$defs/box" }, "by": { "$ref": "#/$defs/key" }, "note": { "type": "string", "minLength": 1 } }, "required": [ "kind" ], "additionalProperties": false, "allOf": [ { "if": { "properties": { "kind": { "const": "person" } } }, "then": { "required": [ "by" ] }, "else": { "required": [ "sha256" ] } } ] }, "author": { "oneOf": [ { "type": "object", "properties": { "key": { "$ref": "#/$defs/key" } }, "required": [ "key" ], "additionalProperties": false }, { "type": "object", "properties": { "model": { "type": "string", "minLength": 1 }, "run": { "type": "string", "minLength": 1 } }, "required": [ "model", "run" ], "additionalProperties": false } ] }, "hashing": { "oneOf": [ { "type": "object", "properties": { "scheme": { "const": "plain" } }, "required": [ "scheme" ], "additionalProperties": false }, { "type": "object", "properties": { "scheme": { "const": "hmac-team" }, "key_id": { "type": "string", "pattern": "^[0-9a-f]{16}$" } }, "required": [ "scheme", "key_id" ], "additionalProperties": false }, { "type": "object", "properties": { "scheme": { "const": "hkdf-pages" }, "context": { "type": "string", "minLength": 1 }, "pages": { "type": "array", "items": { "$ref": "#/$defs/hash" }, "minItems": 1 } }, "required": [ "scheme", "context", "pages" ], "additionalProperties": false } ] }, "quote": { "type": "object", "properties": { "exact": { "type": "string", "maxLength": 200 }, "exact_hash": { "$ref": "#/$defs/hash" }, "length": { "type": "integer", "minimum": 201 }, "prefix": { "type": "string", "minLength": 1, "maxLength": 32 }, "suffix": { "type": "string", "minLength": 1, "maxLength": 32 } }, "required": [], "additionalProperties": false, "oneOf": [ { "required": [ "exact" ], "not": { "anyOf": [ { "required": [ "exact_hash" ] }, { "required": [ "length" ] } ] } }, { "required": [ "exact_hash", "length" ], "not": { "required": [ "exact" ] } } ] }, "keyedQuote": { "type": "object", "properties": { "mac": { "$ref": "#/$defs/hash" }, "length": { "type": "integer", "minimum": 0 }, "prefix_mac": { "$ref": "#/$defs/hash" }, "suffix_mac": { "$ref": "#/$defs/hash" } }, "required": [ "mac", "length" ], "additionalProperties": false }, "cellContext": { "type": "object", "properties": { "table_label": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "row_path": { "type": "array", "items": { "type": "string" } }, "column_path": { "type": "array", "items": { "type": "string" } } }, "required": [ "table_label", "row_path", "column_path" ], "additionalProperties": false }, "keyedContext": { "type": "object", "properties": { "table_label_mac": { "anyOf": [ { "$ref": "#/$defs/hash" }, { "type": "null" } ] }, "row_path_mac": { "type": "array", "items": { "$ref": "#/$defs/hash" } }, "column_path_mac": { "type": "array", "items": { "$ref": "#/$defs/hash" } } }, "required": [ "table_label_mac", "row_path_mac", "column_path_mac" ], "additionalProperties": false }, "agent": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^urn:scienting:(key|person|software):[^ ]+$" }, "type": { "enum": [ "Person", "Software" ] }, "name": { "type": "string", "minLength": 1 } }, "required": [ "id", "type" ], "additionalProperties": false } } }