{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://w3id.org/materica/schema/0.1/record.writer.json",
  "$comment": "Hand-edited: the one source of a record's structure. record.reader.json and the package's typed shapes are generated from it. A member marked x-materica-write-only is one a read does not check (read_side_contract.md section 3, step 8), so a fault in it never refuses a field at read, although a read may return it (a review, as found); a rule that tests such a member, or requires only such members, is the record checks' alone, and the reader's $defs leave it out. Tokens come from vocabulary/, a token condition's own list included, and so does what binds a name to its row: a section's field names and each field's forms, unit and label (vocabulary/fields.json), and a numeric condition's unit (vocabulary/conditions.json), each applied by an allOf that the reader schema and the typed shapes leave out: a read checks a field against its row in its own steps, a unit at step 9 alone. The power-law, parameter-set and reference-data forms, the fit record, extensions and the provenance members not yet named are placeholders until their shapes are written.",
  "title": "Record",
  "description": "A record as a writer writes it (record_format.md, provenance.md and uncertainty.md): closed in its structure, with no member it does not define, and every token list the vocabulary's, but for what is not yet written. Each section's field names, an overlay's replaced fields, each field's forms, unit and label, and a numeric condition's unit are bound to the specification's rows through the vocabulary. Open until written: the parameter names of `per_parameter`; the namespaces in `extensions`, which a reader never checks; an interface record's `body`; and the placeholders, any object until their members are named: the `power_law`, `parameter_set` and `reference_data` forms' members, the `fit` record, and in provenance `assistance`, `formulation`, `import`, `recipe`, `search` beside its weighting and inputs, and extraction's `digitisation`. The status-object tokens are written here, by hand, and checked against provenance.md section 1.",
  "type": "object",
  "required": ["schema_version", "record_type", "id", "version", "name", "licence", "content_hash", "body"],
  "properties": {
    "schema_version": {"$ref": "#/$defs/version"},
    "record_type": {"$ref": "#/$defs/record_type"},
    "id": {"$ref": "#/$defs/record_id"},
    "version": {"$ref": "#/$defs/version"},
    "name": {"type": "string"},
    "licence": {"$ref": "#/$defs/licence"},
    "content_hash": {"$ref": "#/$defs/content_hash"},
    "card": {"type": "string"},
    "body": {"$ref": "#/$defs/json_object"}
  },
  "additionalProperties": false,
  "allOf": [
    {
      "if": {"required": ["record_type"], "properties": {"record_type": {"const": "material"}}},
      "then": {"properties": {"body": {"$ref": "#/$defs/material_body"}}}
    },
    {
      "if": {"required": ["record_type"], "properties": {"record_type": {"const": "overlay"}}},
      "then": {"properties": {"body": {"$ref": "#/$defs/overlay_body"}}}
    }
  ],
  "$defs": {
    "record_type": {
      "description": "record_format.md section 3. An interface record's body is specified in a later minor version.",
      "enum": ["material", "interface", "overlay"]
    },
    "record_id": {
      "description": "<namespace>/<local id> (record_format.md section 7 item 2).",
      "type": "string",
      "pattern": "^[a-z0-9_]+/[A-Za-z0-9_.-]+(?![\\s\\S])"
    },
    "version": {
      "description": "MAJOR.MINOR.PATCH (record_format.md section 8).",
      "type": "string",
      "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?![\\s\\S])"
    },
    "content_hash": {
      "description": "record_format.md section 9.",
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}(?![\\s\\S])"
    },
    "licence": {
      "description": "The licence of the values, an SPDX expression; quoted evidence is never covered by it (record_format.md section 2).",
      "type": "object",
      "required": ["values", "evidence"],
      "properties": {
        "values": {"type": "string"},
        "evidence": {"enum": ["excluded"]}
      },
      "additionalProperties": false
    },
    "material_body": {
      "description": "record_format.md section 4.",
      "type": "object",
      "required": ["sections"],
      "properties": {
        "sections": {"$ref": "#/$defs/sections"},
        "extensions": {"$ref": "#/$defs/extensions"}
      },
      "additionalProperties": false
    },
    "sections": {
      "description": "The sections of schema 0.1, every one optional (record_format.md section 4.1).",
      "type": "object",
      "allOf": [{"$ref": "vocabulary/fields.json#/$defs/sections"}],
      "properties": {
        "bulk": {"$ref": "#/$defs/section"},
        "fluid": {"$ref": "#/$defs/section"},
        "magnetic": {"$ref": "#/$defs/section"},
        "biocompatibility": {"$ref": "#/$defs/section"}
      },
      "additionalProperties": false
    },
    "section": {
      "description": "record_format.md section 4 item 2.",
      "type": "object",
      "required": ["fields"],
      "properties": {
        "specimen": {"$ref": "#/$defs/specimen"},
        "fields": {"$ref": "#/$defs/fields"}
      },
      "additionalProperties": false
    },
    "fields": {
      "description": "A field's name to its value field.",
      "type": "object",
      "additionalProperties": {"$ref": "#/$defs/value_field"}
    },
    "extensions": {
      "description": "A registered namespace to its sections; a reader ignores what it holds (record_format.md section 4 item 4).",
      "type": "object",
      "propertyNames": {"pattern": "^[a-z0-9_]+(?![\\s\\S])"},
      "additionalProperties": {"$ref": "#/$defs/extension"}
    },
    "overlay_body": {
      "description": "record_format.md section 4.4.",
      "type": "object",
      "required": ["purpose", "base", "scope", "replaces"],
      "properties": {
        "purpose": {"enum": ["fit", "fill_in", "measurement", "scene_override"]},
        "base": {"$ref": "#/$defs/overlay_base"},
        "scope": {"$ref": "#/$defs/overlay_scope"},
        "replaces": {"$ref": "#/$defs/replaces"}
      },
      "additionalProperties": false
    },
    "overlay_base": {
      "description": "The one material an overlay replaces fields of (record_format.md section 4.4 item 2).",
      "type": "object",
      "required": ["id", "version", "content_hash"],
      "properties": {
        "id": {"$ref": "#/$defs/record_id"},
        "version": {"$ref": "#/$defs/version"},
        "content_hash": {"$ref": "#/$defs/content_hash"}
      },
      "additionalProperties": false
    },
    "overlay_scope": {
      "description": "record_format.md section 4.4 item 3.",
      "type": "object",
      "required": ["consumer"],
      "properties": {
        "consumer": {"type": "string"},
        "model": {"$ref": "#/$defs/scope_model"},
        "model_configuration_hash": {"type": "string"},
        "run": {"type": "string"}
      },
      "additionalProperties": false
    },
    "scope_model": {
      "description": "A consumer's model, by name and version; the version is the consumer's, not bound by record_format.md section 8.",
      "type": "object",
      "required": ["name", "version"],
      "properties": {
        "name": {"type": "string"},
        "version": {"type": "string"}
      },
      "additionalProperties": false
    },
    "replaces": {
      "description": "<section>.<field> to the whole value field that replaces the base's (record_format.md section 4.4 item 2).",
      "type": "object",
      "allOf": [{"$ref": "vocabulary/fields.json#/$defs/replaces"}],
      "propertyNames": {"pattern": "^[a-z0-9_]+\\.[a-z0-9_]+(?![\\s\\S])"},
      "additionalProperties": {"$ref": "#/$defs/value_field"}
    },
    "value_field": {
      "description": "A value field of one form, or the alternatives of one (record_format.md section 5). A reader checks it only when it reads the field.",
      "oneOf": [{"$ref": "#/$defs/form_field"}, {"$ref": "#/$defs/alternatives"}]
    },
    "form_field": {
      "description": "A value field of one form; the form token decides which (record_format.md sections 5 and 6).",
      "oneOf": [
        {"$ref": "#/$defs/constant_field"},
        {"$ref": "#/$defs/table_field"},
        {"$ref": "#/$defs/power_law_field"},
        {"$ref": "#/$defs/interval_field"},
        {"$ref": "#/$defs/composition_field"},
        {"$ref": "#/$defs/parameter_set_field"},
        {"$ref": "#/$defs/reference_data_field"},
        {"$ref": "#/$defs/evidence_field"}
      ]
    },
    "alternatives": {
      "description": "Every alternative found, each complete, in stored order and none the default; nothing beside them (record_format.md section 5).",
      "type": "object",
      "required": ["alternatives"],
      "properties": {
        "alternatives": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/form_field"}}
      },
      "additionalProperties": false,
      "not": {
        "anyOf": [
          {"required": ["form"]},
          {"required": ["unit"]},
          {"required": ["value"]},
          {"required": ["table"]},
          {"required": ["power_law"]},
          {"required": ["interval"]},
          {"required": ["composition"]},
          {"required": ["parameter_set"]},
          {"required": ["reference_data"]},
          {"required": ["evidence"]},
          {"required": ["conditions"]},
          {"required": ["specimen"]},
          {"required": ["statistics"]},
          {"required": ["provenance"]},
          {"required": ["label"]},
          {"required": ["label_basis"]},
          {"required": ["fit"]}
        ]
      }
    },
    "field_members": {
      "description": "The members of a value field that do not depend on its form (record_format.md section 5), with the rules that join them to the form: a fit record where the origin is fitted or the extraction a fit (provenance.md section 3), a search where the statistics represent a spread across sources, and a recipe where the form's member is withheld (provenance.md sections 2 and 7).",
      "type": "object",
      "required": ["unit", "provenance"],
      "properties": {
        "unit": {"$ref": "#/$defs/unit"},
        "specimen": {"$ref": "#/$defs/specimen"},
        "provenance": {"$ref": "#/$defs/provenance"},
        "label": {"$ref": "vocabulary/fields.json#/$defs/label"},
        "label_basis": {"x-materica-write-only": true, "$ref": "#/$defs/label_basis"},
        "fit": {
          "description": "The fit record (fits_and_reference_data.md section 2), where the origin is fitted. A placeholder until its shape is written.",
          "x-materica-write-only": true,
          "$ref": "#/$defs/json_object"
        }
      },
      "allOf": [
        {
          "if": {
            "required": ["provenance"],
            "properties": {"provenance": {"required": ["origin"], "properties": {"origin": {"const": "fitted"}}}}
          },
          "then": {"required": ["fit"]}
        },
        {
          "if": {
            "required": ["provenance"],
            "properties": {
              "provenance": {
                "required": ["extraction"],
                "properties": {"extraction": {"required": ["method"], "properties": {"method": {"const": "fit"}}}}
              }
            }
          },
          "then": {"required": ["fit"]}
        },
        {
          "if": {
            "required": ["statistics"],
            "properties": {
              "statistics": {"required": ["represents"], "properties": {"represents": {"const": "across_sources"}}}
            }
          },
          "then": {"properties": {"provenance": {"required": ["search"]}}}
        },
        {
          "if": {
            "anyOf": [
              {"required": ["value"], "properties": {"value": {"type": "object", "required": ["status"], "properties": {"status": {"const": "withheld"}}}}},
              {"required": ["table"], "properties": {"table": {"type": "object", "required": ["status"], "properties": {"status": {"const": "withheld"}}}}},
              {"required": ["power_law"], "properties": {"power_law": {"type": "object", "required": ["status"], "properties": {"status": {"const": "withheld"}}}}},
              {"required": ["interval"], "properties": {"interval": {"type": "object", "required": ["status"], "properties": {"status": {"const": "withheld"}}}}},
              {"required": ["composition"], "properties": {"composition": {"type": "object", "required": ["status"], "properties": {"status": {"const": "withheld"}}}}},
              {"required": ["parameter_set"], "properties": {"parameter_set": {"type": "object", "required": ["status"], "properties": {"status": {"const": "withheld"}}}}},
              {"required": ["reference_data"], "properties": {"reference_data": {"type": "object", "required": ["status"], "properties": {"status": {"const": "withheld"}}}}}
            ]
          },
          "then": {"properties": {"provenance": {"required": ["recipe"]}}}
        }
      ]
    },
    "constant_field": {
      "description": "A constant: one number, whose range is its conditions (record_format.md section 6).",
      "type": "object",
      "allOf": [{"$ref": "#/$defs/field_members"}],
      "required": ["form", "value", "conditions", "statistics"],
      "properties": {
        "form": {"const": "constant"},
        "value": {"anyOf": [{"type": "number"}, {"$ref": "#/$defs/status_withheld"}]},
        "conditions": {"$ref": "#/$defs/conditions"},
        "statistics": {"$ref": "#/$defs/field_statistics"}
      },
      "unevaluatedProperties": false
    },
    "table_field": {
      "description": "A table: values against a numeric condition, its axis, which the field's conditions hold as not_applicable (record_format.md section 6).",
      "type": "object",
      "allOf": [{"$ref": "#/$defs/field_members"}, {"$ref": "vocabulary/conditions.json#/$defs/axes"}],
      "required": ["form", "table", "conditions", "statistics"],
      "properties": {
        "form": {"const": "table"},
        "table": {"anyOf": [{"$ref": "#/$defs/table"}, {"$ref": "#/$defs/status_withheld"}]},
        "conditions": {"$ref": "#/$defs/conditions"},
        "statistics": {"$ref": "#/$defs/field_statistics"}
      },
      "unevaluatedProperties": false
    },
    "power_law_field": {
      "description": "A power law (record_format.md section 6). Its member is a placeholder until its shape is written.",
      "type": "object",
      "allOf": [{"$ref": "#/$defs/field_members"}],
      "required": ["form", "power_law", "conditions", "statistics"],
      "properties": {
        "form": {"const": "power_law"},
        "power_law": {"anyOf": [{"$ref": "#/$defs/placeholder"}, {"$ref": "#/$defs/status_withheld"}]},
        "conditions": {"$ref": "#/$defs/conditions"},
        "statistics": {"$ref": "#/$defs/field_statistics"}
      },
      "unevaluatedProperties": false
    },
    "interval_field": {
      "description": "An interval: bounds with their basis, known only as bounds (record_format.md section 6).",
      "type": "object",
      "allOf": [{"$ref": "#/$defs/field_members"}],
      "required": ["form", "interval", "conditions", "statistics"],
      "properties": {
        "form": {"const": "interval"},
        "interval": {"anyOf": [{"$ref": "#/$defs/interval"}, {"$ref": "#/$defs/status_withheld"}]},
        "conditions": {"$ref": "#/$defs/conditions"},
        "statistics": {"$ref": "#/$defs/field_statistics"}
      },
      "unevaluatedProperties": false
    },
    "composition_field": {
      "description": "A composition (record_format.md section 6).",
      "type": "object",
      "allOf": [{"$ref": "#/$defs/field_members"}],
      "required": ["form", "composition", "conditions", "statistics"],
      "properties": {
        "form": {"const": "composition"},
        "composition": {"anyOf": [{"$ref": "#/$defs/composition"}, {"$ref": "#/$defs/status_withheld"}]},
        "conditions": {"$ref": "#/$defs/conditions"},
        "statistics": {"$ref": "#/$defs/field_statistics"}
      },
      "unevaluatedProperties": false
    },
    "parameter_set_field": {
      "description": "A model parameter set (model_families.md). Its member is a placeholder until its shape is written.",
      "type": "object",
      "allOf": [{"$ref": "#/$defs/field_members"}],
      "required": ["form", "parameter_set", "conditions", "statistics"],
      "properties": {
        "form": {"const": "parameter_set"},
        "parameter_set": {"anyOf": [{"$ref": "#/$defs/placeholder"}, {"$ref": "#/$defs/status_withheld"}]},
        "conditions": {"$ref": "#/$defs/conditions"},
        "statistics": {"$ref": "#/$defs/field_statistics"}
      },
      "unevaluatedProperties": false
    },
    "reference_data_field": {
      "description": "Reference data (fits_and_reference_data.md section 1), whose statistics may not apply. Its member is a placeholder until its shape is written.",
      "type": "object",
      "allOf": [{"$ref": "#/$defs/field_members"}],
      "required": ["form", "reference_data", "conditions", "statistics"],
      "properties": {
        "form": {"const": "reference_data"},
        "reference_data": {"anyOf": [{"$ref": "#/$defs/placeholder"}, {"$ref": "#/$defs/status_withheld"}]},
        "conditions": {"$ref": "#/$defs/conditions"},
        "statistics": {
          "anyOf": [{"$ref": "#/$defs/statistics_block"}, {"$ref": "#/$defs/status_withheld_or_not_applicable"}]
        }
      },
      "unevaluatedProperties": false
    },
    "evidence_field": {
      "description": "Biocompatibility evidence: a list of test reports, never a status, under no condition and with no statistics (record_format.md section 4.3).",
      "type": "object",
      "allOf": [{"$ref": "#/$defs/field_members"}],
      "required": ["form", "evidence", "conditions"],
      "properties": {
        "form": {"const": "evidence"},
        "evidence": {
          "type": "array",
          "minItems": 1,
          "items": {"anyOf": [{"$ref": "#/$defs/evidence_entry"}, {"$ref": "#/$defs/withheld_evidence_entry"}]}
        },
        "conditions": {
          "description": "No condition: a registered one here breaks the field's shape.",
          "type": "object",
          "propertyNames": false,
          "additionalProperties": {"$ref": "#/$defs/json_value"}
        }
      },
      "unevaluatedProperties": false
    },
    "unit": {
      "description": "A unit code, compared with the registered unit at step 9 alone (record_format.md section 4.2), or a status object.",
      "anyOf": [{"type": "string"}, {"$ref": "#/$defs/status_object"}]
    },
    "table": {
      "description": "A table's members (record_format.md section 6, table items 1 to 5): y holds one number for each value of x, at least two of them distinct, in an order that never decreases, each edge lying strictly inside x's range and in x exactly twice, consecutively, and no other value of x twice; and source_range is two numbers, the first not greater than the second, sharing with x's range a value that is no edge. A schema states none of these rules across members, which step 8 of a read checks. points, a name item 5 reserves, is no member of this shape: a 0.1.0 writer does not write it, and a reader refuses a table that holds it at step 8 (points_unsupported).",
      "type": "object",
      "required": ["axis", "axis_unit", "x", "y", "scheme", "edges"],
      "properties": {
        "axis": {"$ref": "vocabulary/conditions.json#/$defs/axis"},
        "axis_unit": {"$ref": "#/$defs/unit"},
        "x": {"type": "array", "minItems": 2, "items": {"type": "number"}},
        "y": {"type": "array", "minItems": 2, "items": {"type": "number"}},
        "scheme": {"$ref": "vocabulary/forms.json#/$defs/table_scheme"},
        "edges": {"type": "array", "uniqueItems": true, "items": {"type": "number"}},
        "source_range": {"$ref": "#/$defs/range"}
      },
      "additionalProperties": false,
      "if": {"required": ["scheme"], "properties": {"scheme": {"const": "loglog"}}},
      "then": {"properties": {"x": {"items": {"exclusiveMinimum": 0}}, "y": {"items": {"exclusiveMinimum": 0}}}}
    },
    "interval": {
      "description": "lower <= upper where both are numbers, and at most one holds none (record_format.md section 6).",
      "type": "object",
      "required": ["lower", "upper", "basis"],
      "properties": {
        "lower": {"anyOf": [{"type": "number"}, {"$ref": "#/$defs/status_none"}]},
        "upper": {"anyOf": [{"type": "number"}, {"$ref": "#/$defs/status_none"}]},
        "basis": {"$ref": "vocabulary/forms.json#/$defs/interval_basis"}
      },
      "additionalProperties": false,
      "not": {"properties": {"lower": {"type": "object"}, "upper": {"type": "object"}}}
    },
    "composition": {
      "description": "At least one component, none twice; stated_sum is the sum the source gives, never normalised (record_format.md section 6).",
      "type": "object",
      "required": ["basis", "sum_rule", "components"],
      "properties": {
        "basis": {"$ref": "vocabulary/forms.json#/$defs/composition_basis"},
        "sum_rule": {"$ref": "vocabulary/forms.json#/$defs/sum_rule"},
        "stated_sum": {"type": "number"},
        "components": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/composition_component"}}
      },
      "additionalProperties": false
    },
    "composition_component": {
      "description": "A component, element:<symbol>, its fraction from 0 to 1, and optionally its own statistics block.",
      "type": "object",
      "required": ["component", "fraction"],
      "properties": {
        "component": {"$ref": "vocabulary/forms.json#/$defs/component"},
        "fraction": {"type": "number", "minimum": 0, "maximum": 1},
        "statistics": {"$ref": "#/$defs/field_statistics"}
      },
      "additionalProperties": false
    },
    "evidence_entry": {
      "description": "A test report (record_format.md section 4.3). Each member but provenance may hold a status object other than withheld.",
      "type": "object",
      "required": [
        "endpoint",
        "standard",
        "contact_category",
        "contact_duration",
        "material_form",
        "processing",
        "reported_result",
        "provenance"
      ],
      "properties": {
        "endpoint": {"$ref": "#/$defs/report_text"},
        "standard": {"anyOf": [{"$ref": "#/$defs/standard"}, {"$ref": "#/$defs/status_not_withheld"}]},
        "contact_category": {"$ref": "#/$defs/report_text"},
        "contact_duration": {"$ref": "#/$defs/report_text"},
        "material_form": {"$ref": "#/$defs/report_text"},
        "processing": {"$ref": "#/$defs/report_text"},
        "reported_result": {"$ref": "#/$defs/report_text"},
        "provenance": {"$ref": "#/$defs/provenance"}
      },
      "additionalProperties": false
    },
    "withheld_evidence_entry": {
      "description": "A test report from a reference-only source: withheld whole, its provenance kept and carrying the recipe (record_format.md section 4.3 item 2, provenance.md section 7 item 2).",
      "type": "object",
      "required": [
        "endpoint",
        "standard",
        "contact_category",
        "contact_duration",
        "material_form",
        "processing",
        "reported_result",
        "provenance"
      ],
      "properties": {
        "endpoint": {"$ref": "#/$defs/status_withheld"},
        "standard": {"$ref": "#/$defs/status_withheld"},
        "contact_category": {"$ref": "#/$defs/status_withheld"},
        "contact_duration": {"$ref": "#/$defs/status_withheld"},
        "material_form": {"$ref": "#/$defs/status_withheld"},
        "processing": {"$ref": "#/$defs/status_withheld"},
        "reported_result": {"$ref": "#/$defs/status_withheld"},
        "provenance": {"$ref": "#/$defs/provenance"}
      },
      "additionalProperties": false,
      "if": {"required": ["provenance"]},
      "then": {"properties": {"provenance": {"required": ["recipe"]}}}
    },
    "report_text": {
      "description": "The source's words, until the member's tokens are listed (record_format.md section 4.3).",
      "anyOf": [{"type": "string"}, {"$ref": "#/$defs/status_not_withheld"}]
    },
    "standard": {
      "description": "The standard and part a test followed, and its year, a whole number.",
      "type": "object",
      "required": ["designation", "year"],
      "properties": {"designation": {"type": "string"}, "year": {"type": "integer"}},
      "additionalProperties": false
    },
    "conditions": {
      "description": "The conditions the value was measured at, by name (provenance.md section 6.1): a token condition holds a token of its own row's list, and a numeric one's registered unit is compared at step 9.",
      "type": "object",
      "allOf": [{"$ref": "vocabulary/conditions.json#/$defs/units"}],
      "properties": {
        "temperature": {"anyOf": [{"$ref": "#/$defs/numeric_condition"}, {"$ref": "#/$defs/status_object"}]},
        "shear_rate": {"anyOf": [{"$ref": "#/$defs/numeric_condition"}, {"$ref": "#/$defs/status_object"}]},
        "magnetic_flux_density": {"anyOf": [{"$ref": "#/$defs/numeric_condition"}, {"$ref": "#/$defs/status_object"}]},
        "density_kind": {"anyOf": [{"$ref": "#/$defs/condition_density_kind"}, {"$ref": "#/$defs/status_object"}]},
        "specimen_shape": {"anyOf": [{"$ref": "#/$defs/condition_specimen_shape"}, {"$ref": "#/$defs/status_object"}]},
        "specimen_size": {"anyOf": [{"$ref": "#/$defs/numeric_condition"}, {"$ref": "#/$defs/status_object"}]},
        "measurement_geometry": {"anyOf": [{"$ref": "#/$defs/condition_measurement_geometry"}, {"$ref": "#/$defs/status_object"}]},
        "measurement_dimension": {"anyOf": [{"$ref": "#/$defs/numeric_condition"}, {"$ref": "#/$defs/status_object"}]},
        "test_method": {"anyOf": [{"$ref": "#/$defs/condition_test_method"}, {"$ref": "#/$defs/status_object"}]}
      },
      "additionalProperties": false
    },
    "based": {
      "description": "Where a condition or a specimen fact comes from: stated, or inferred with the text it was inferred from (provenance.md section 6).",
      "type": "object",
      "required": ["basis"],
      "properties": {
        "basis": {"$ref": "vocabulary/provenance.json#/$defs/basis"},
        "inferred_from": {"type": "string"}
      },
      "if": {"required": ["basis"], "properties": {"basis": {"const": "inferred"}}},
      "then": {"required": ["inferred_from"]}
    },
    "label_basis": {
      "description": "Where a field's label comes from (record_format.md section 4.1): stated by the source, or inferred by a curator with the text it was inferred from, in a condition's basis shape (provenance.md section 6). A reader checks only its name, for slips and beside `alternatives`, and neither checks its shape nor returns it.",
      "type": "object",
      "allOf": [{"$ref": "#/$defs/based"}],
      "unevaluatedProperties": false
    },
    "numeric_condition": {
      "description": "A value or a range [lo, hi], lo not above hi, in the condition's registered unit; optionally the source's plus or minus and whether it was set or measured (provenance.md section 6.1 items 1, 6 and 7).",
      "type": "object",
      "allOf": [{"$ref": "#/$defs/based"}],
      "required": ["unit"],
      "properties": {
        "value": {"type": "number"},
        "range": {"$ref": "#/$defs/range"},
        "unit": {"$ref": "#/$defs/unit"},
        "plus_minus": {"$ref": "#/$defs/plus_minus"},
        "set_or_measured": {"$ref": "vocabulary/provenance.json#/$defs/set_or_measured"}
      },
      "if": {"required": ["value"]},
      "then": {"not": {"required": ["range"]}},
      "else": {"required": ["range"]},
      "unevaluatedProperties": false
    },
    "condition_density_kind": {
      "description": "The token condition density_kind: a token of its row (provenance.md section 6.1 item 1); it registers no unit.",
      "type": "object",
      "allOf": [{"$ref": "#/$defs/based"}],
      "required": ["token"],
      "properties": {"token": {"$ref": "vocabulary/conditions.json#/$defs/density_kind_token"}},
      "unevaluatedProperties": false
    },
    "condition_specimen_shape": {
      "description": "The token condition specimen_shape: a token of its row (provenance.md section 6.1 item 1); it registers no unit.",
      "type": "object",
      "allOf": [{"$ref": "#/$defs/based"}],
      "required": ["token"],
      "properties": {"token": {"$ref": "vocabulary/conditions.json#/$defs/specimen_shape_token"}},
      "unevaluatedProperties": false
    },
    "condition_measurement_geometry": {
      "description": "The token condition measurement_geometry: a token of its row (provenance.md section 6.1 item 1); it registers no unit.",
      "type": "object",
      "allOf": [{"$ref": "#/$defs/based"}],
      "required": ["token"],
      "properties": {"token": {"$ref": "vocabulary/conditions.json#/$defs/measurement_geometry_token"}},
      "unevaluatedProperties": false
    },
    "condition_test_method": {
      "description": "The token condition test_method: a token of its row (provenance.md section 6.1 item 1); it registers no unit.",
      "type": "object",
      "allOf": [{"$ref": "#/$defs/based"}],
      "required": ["token"],
      "properties": {"token": {"$ref": "vocabulary/conditions.json#/$defs/test_method_token"}},
      "unevaluatedProperties": false
    },
    "range": {
      "description": "[lo, hi], lo not above hi.",
      "type": "array",
      "prefixItems": [{"type": "number"}, {"type": "number"}],
      "minItems": 2,
      "maxItems": 2
    },
    "plus_minus": {
      "description": "The plus or minus a source states (provenance.md section 6.1 item 6): at most one entry of each kind, and one of unstated kind alone.",
      "type": "array",
      "minItems": 1,
      "maxItems": 2,
      "items": {"$ref": "#/$defs/plus_minus_entry"},
      "if": {"minItems": 2},
      "then": {
        "allOf": [
          {"contains": {"required": ["stated_as"], "properties": {"stated_as": {"const": "bound"}}}},
          {"contains": {"required": ["stated_as"], "properties": {"stated_as": {"const": "sd"}}}}
        ]
      }
    },
    "plus_minus_entry": {
      "type": "object",
      "required": ["stated_as", "value", "unit"],
      "properties": {
        "stated_as": {"anyOf": [{"$ref": "vocabulary/provenance.json#/$defs/stated_as"}, {"$ref": "#/$defs/status_unstated"}]},
        "value": {"type": "number", "minimum": 0},
        "unit": {"$ref": "#/$defs/unit"}
      },
      "additionalProperties": false
    },
    "specimen": {
      "description": "Specimen facts, by name (provenance.md section 6.2); a field's override its section's, fact by fact. Where a fact's row fixes its unit, step 9 compares the unit with it and the writer binds the unit to it: a fact whose unit the source does not give is written as a status object.",
      "type": "object",
      "allOf": [{"$ref": "vocabulary/specimen_facts.json#/$defs/units"}],
      "properties": {
        "species": {"anyOf": [{"$ref": "#/$defs/species"}, {"$ref": "#/$defs/status_object"}]},
        "anatomical_site": {"anyOf": [{"$ref": "#/$defs/anatomical_site"}, {"$ref": "#/$defs/status_object"}]},
        "tissue_state": {"anyOf": [{"$ref": "#/$defs/tissue_state"}, {"$ref": "#/$defs/status_object"}]},
        "disease_and_treatment_state": {
          "anyOf": [{"$ref": "#/$defs/disease_and_treatment_state"}, {"$ref": "#/$defs/status_object"}]
        },
        "preparation": {"anyOf": [{"$ref": "#/$defs/preparation"}, {"$ref": "#/$defs/status_object"}]},
        "preservation": {"anyOf": [{"$ref": "#/$defs/preservation"}, {"$ref": "#/$defs/status_object"}]},
        "post_mortem_interval": {"anyOf": [{"$ref": "#/$defs/post_mortem_interval"}, {"$ref": "#/$defs/status_object"}]},
        "donor_age": {"anyOf": [{"$ref": "#/$defs/donor_age"}, {"$ref": "#/$defs/status_object"}]},
        "mimics": {"anyOf": [{"$ref": "#/$defs/mimics"}, {"$ref": "#/$defs/status_object"}]},
        "supply_form": {"anyOf": [{"$ref": "#/$defs/supply_form"}, {"$ref": "#/$defs/status_object"}]},
        "lot": {"anyOf": [{"$ref": "#/$defs/lot"}, {"$ref": "#/$defs/status_object"}]}
      },
      "additionalProperties": false
    },
    "species": {
      "description": "An NCBI Taxonomy identifier.",
      "type": "object",
      "allOf": [{"$ref": "#/$defs/based"}],
      "required": ["ncbi_taxon", "label"],
      "properties": {"ncbi_taxon": {"type": "integer"}, "label": {"type": "string"}},
      "unevaluatedProperties": false
    },
    "anatomical_site": {
      "description": "A UBERON identifier.",
      "type": "object",
      "allOf": [{"$ref": "#/$defs/based"}],
      "required": ["uberon", "label"],
      "properties": {
        "uberon": {"$ref": "vocabulary/specimen_facts.json#/$defs/anatomical_site_uberon"},
        "label": {"type": "string"}
      },
      "unevaluatedProperties": false
    },
    "tissue_state": {
      "type": "object",
      "allOf": [{"$ref": "#/$defs/based"}],
      "required": ["token"],
      "properties": {"token": {"$ref": "vocabulary/specimen_facts.json#/$defs/tissue_state_token"}},
      "unevaluatedProperties": false
    },
    "disease_and_treatment_state": {
      "description": "The state, and which disease or treatment: a text exactly where the state is diseased or treated, none where it is normal (provenance.md section 6.2).",
      "type": "object",
      "allOf": [{"$ref": "#/$defs/based"}],
      "required": ["token"],
      "properties": {
        "token": {"$ref": "vocabulary/specimen_facts.json#/$defs/disease_and_treatment_state_token"},
        "text": {"type": "string"}
      },
      "if": {"required": ["token"], "properties": {"token": {"anyOf": [{"const": "diseased"}, {"const": "treated"}]}}},
      "then": {"required": ["text"]},
      "else": {"not": {"required": ["text"]}},
      "unevaluatedProperties": false
    },
    "preparation": {
      "type": "object",
      "allOf": [{"$ref": "#/$defs/based"}],
      "required": ["text"],
      "properties": {"text": {"type": "string"}},
      "unevaluatedProperties": false
    },
    "preservation": {
      "description": "The preservation, with a text required for other.",
      "type": "object",
      "allOf": [{"$ref": "#/$defs/based"}],
      "required": ["token"],
      "properties": {
        "token": {"$ref": "vocabulary/specimen_facts.json#/$defs/preservation_token"},
        "text": {"type": "string"}
      },
      "if": {"required": ["token"], "properties": {"token": {"const": "other"}}},
      "then": {"required": ["text"]},
      "unevaluatedProperties": false
    },
    "post_mortem_interval": {
      "type": "object",
      "allOf": [{"$ref": "#/$defs/based"}],
      "required": ["value", "unit"],
      "properties": {
        "value": {"type": "number"},
        "unit": {"$ref": "#/$defs/unit"}
      },
      "unevaluatedProperties": false
    },
    "donor_age": {
      "description": "A value or a range [lo, hi], in seconds.",
      "type": "object",
      "allOf": [{"$ref": "#/$defs/based"}],
      "required": ["unit"],
      "properties": {
        "value": {"type": "number"},
        "range": {"$ref": "#/$defs/range"},
        "unit": {"$ref": "#/$defs/unit"}
      },
      "if": {"required": ["value"]},
      "then": {"not": {"required": ["range"]}},
      "else": {"required": ["range"]},
      "unevaluatedProperties": false
    },
    "mimics": {
      "description": "What a phantom or a substitute was made to mimic, as its maker states it: its basis is stated, never inferred, so it has no inferred_from.",
      "type": "object",
      "required": ["text", "basis"],
      "properties": {
        "text": {"type": "string"},
        "basis": {"$ref": "vocabulary/specimen_facts.json#/$defs/mimics_basis"}
      },
      "additionalProperties": false
    },
    "supply_form": {
      "description": "A manufactured material as supplied, a coupon made or cut for the test, or a finished component tested as a specimen of its material.",
      "type": "object",
      "allOf": [{"$ref": "#/$defs/based"}],
      "required": ["token"],
      "properties": {"token": {"$ref": "vocabulary/specimen_facts.json#/$defs/supply_form_token"}},
      "unevaluatedProperties": false
    },
    "lot": {
      "description": "The lot or batch, as the source names it.",
      "type": "object",
      "allOf": [{"$ref": "#/$defs/based"}],
      "required": ["text"],
      "properties": {"text": {"type": "string"}},
      "unevaluatedProperties": false
    },
    "field_statistics": {
      "description": "A statistics block, withheld in a reference-only value (uncertainty.md section 1).",
      "anyOf": [{"$ref": "#/$defs/statistics_block"}, {"$ref": "#/$defs/status_withheld"}]
    },
    "statistics_block": {
      "description": "uncertainty.md section 1: every member present, population_level, n_sources and precision_conditions exactly where represents calls for them.",
      "type": "object",
      "required": [
        "central",
        "n_specimens",
        "n_donors",
        "mean",
        "sd",
        "min",
        "max",
        "distribution",
        "basis",
        "represents",
        "dispersion",
        "relative_uncertainty",
        "expanded_uncertainty"
      ],
      "properties": {
        "central": {"anyOf": [{"$ref": "vocabulary/statistics.json#/$defs/central"}, {"$ref": "#/$defs/status_not_applicable"}]},
        "n_specimens": {"$ref": "#/$defs/count"},
        "n_donors": {"$ref": "#/$defs/count"},
        "mean": {"anyOf": [{"type": "number"}, {"$ref": "#/$defs/status_object"}]},
        "sd": {"anyOf": [{"type": "number", "minimum": 0}, {"$ref": "#/$defs/status_object"}]},
        "min": {"anyOf": [{"type": "number"}, {"$ref": "#/$defs/status_object"}]},
        "max": {"anyOf": [{"type": "number"}, {"$ref": "#/$defs/status_object"}]},
        "distribution": {
          "anyOf": [{"$ref": "vocabulary/statistics.json#/$defs/statistics_distribution"}, {"$ref": "#/$defs/status_unstated"}]
        },
        "basis": {
          "anyOf": [{"$ref": "vocabulary/statistics.json#/$defs/statistics_basis"}, {"$ref": "#/$defs/status_not_applicable"}]
        },
        "represents": {
          "anyOf": [{"$ref": "vocabulary/statistics.json#/$defs/represents"}, {"$ref": "#/$defs/status_unstated_or_not_applicable"}]
        },
        "population_level": {"anyOf": [{"$ref": "#/$defs/population_level"}, {"$ref": "#/$defs/status_unstated"}]},
        "n_sources": {"$ref": "#/$defs/count"},
        "precision_conditions": {
          "anyOf": [{"$ref": "vocabulary/statistics.json#/$defs/precision_conditions"}, {"$ref": "#/$defs/status_unstated"}]
        },
        "dispersion": {"$ref": "vocabulary/statistics.json#/$defs/dispersion"},
        "relative_uncertainty": {"anyOf": [{"$ref": "#/$defs/uncertainty"}, {"$ref": "#/$defs/status_object"}]},
        "expanded_uncertainty": {"anyOf": [{"$ref": "#/$defs/uncertainty"}, {"$ref": "#/$defs/status_object"}]}
      },
      "additionalProperties": false,
      "allOf": [
        {
          "if": {"required": ["represents"], "properties": {"represents": {"const": "population"}}},
          "then": {"required": ["population_level"]},
          "else": {"not": {"required": ["population_level"]}}
        },
        {
          "if": {"required": ["represents"], "properties": {"represents": {"const": "across_sources"}}},
          "then": {"required": ["n_sources"]},
          "else": {"not": {"required": ["n_sources"]}}
        },
        {
          "if": {"required": ["represents"], "properties": {"represents": {"const": "measurement"}}},
          "then": {"required": ["precision_conditions"]},
          "else": {"not": {"required": ["precision_conditions"]}}
        }
      ]
    },
    "count": {
      "description": "A whole number, not negative, or a status object.",
      "anyOf": [{"type": "integer", "minimum": 0}, {"$ref": "#/$defs/status_object"}]
    },
    "population_level": {
      "description": "The level a population spread is taken over, and the level it is taken within (uncertainty.md section 1 rule 10).",
      "type": "object",
      "required": ["level", "within"],
      "properties": {
        "level": {"$ref": "vocabulary/statistics.json#/$defs/level"},
        "within": {"anyOf": [{"$ref": "vocabulary/statistics.json#/$defs/level"}, {"$ref": "#/$defs/status_none"}]}
      },
      "additionalProperties": false
    },
    "uncertainty": {
      "description": "A relative or expanded uncertainty, as stored (uncertainty.md section 1): at least one of coverage_factor and coverage_probability a number, dof a number exactly where distribution is student_t, and precision_conditions exactly where represents is measurement. value is in unit 1 in a relative one, and in the field's unit in an expanded one.",
      "type": "object",
      "required": ["value", "coverage_factor", "coverage_probability", "distribution", "dof", "basis", "represents"],
      "properties": {
        "value": {"type": "number", "minimum": 0},
        "coverage_factor": {"anyOf": [{"type": "number", "exclusiveMinimum": 0}, {"$ref": "#/$defs/status_object"}]},
        "coverage_probability": {
          "anyOf": [{"type": "number", "exclusiveMinimum": 0, "maximum": 1}, {"$ref": "#/$defs/status_object"}]
        },
        "distribution": {
          "anyOf": [{"$ref": "vocabulary/statistics.json#/$defs/uncertainty_distribution"}, {"$ref": "#/$defs/status_unstated"}]
        },
        "dof": {"anyOf": [{"type": "number", "exclusiveMinimum": 0}, {"$ref": "#/$defs/status_object"}]},
        "basis": {"$ref": "vocabulary/statistics.json#/$defs/uncertainty_basis"},
        "represents": {
          "anyOf": [{"$ref": "vocabulary/statistics.json#/$defs/uncertainty_represents"}, {"$ref": "#/$defs/status_unstated"}]
        },
        "precision_conditions": {
          "anyOf": [{"$ref": "vocabulary/statistics.json#/$defs/precision_conditions"}, {"$ref": "#/$defs/status_unstated"}]
        }
      },
      "additionalProperties": false,
      "allOf": [
        {
          "if": {"required": ["coverage_factor"], "properties": {"coverage_factor": {"type": "object"}}},
          "then": {"properties": {"coverage_probability": {"type": "number"}}}
        },
        {
          "if": {"required": ["distribution"], "properties": {"distribution": {"const": "student_t"}}},
          "then": {"properties": {"dof": {"type": "number"}}},
          "else": {"properties": {"dof": {"type": "object"}}}
        },
        {
          "if": {"required": ["represents"], "properties": {"represents": {"const": "measurement"}}},
          "then": {"required": ["precision_conditions"]},
          "else": {"not": {"required": ["precision_conditions"]}}
        }
      ]
    },
    "provenance": {
      "description": "provenance.md section 2. A read checks origin, source and, for origin derived, derivation; the other members are the record checks'.",
      "type": "object",
      "required": ["origin", "extraction", "assistance", "review"],
      "properties": {
        "origin": {"$ref": "vocabulary/provenance.json#/$defs/origin"},
        "source": {"$ref": "#/$defs/source"},
        "extraction": {"x-materica-write-only": true, "$ref": "#/$defs/extraction"},
        "evidence": {"x-materica-write-only": true, "$ref": "#/$defs/evidence"},
        "assistance": {
          "description": "None, or the tool, model and provider as reported, the prompt version and the date: a placeholder until its members are named.",
          "x-materica-write-only": true,
          "anyOf": [{"$ref": "#/$defs/status_none"}, {"$ref": "#/$defs/placeholder"}]
        },
        "review": {
          "description": "Not checked, or a review. Outside the content hash, so a read never refuses a field for it: one it cannot read reads as not_checked (provenance.md section 2 item 6).",
          "x-materica-write-only": true,
          "anyOf": [{"$ref": "#/$defs/status_not_checked"}, {"$ref": "#/$defs/review"}]
        },
        "derivation": {"x-materica-write-only": {"unless": {"origin": "derived"}}, "$ref": "#/$defs/derivation"},
        "formulation": {
          "description": "The formulation's name and version and the evaluation that produced the value: a placeholder until its members are named.",
          "x-materica-write-only": true,
          "$ref": "#/$defs/json_object"
        },
        "search": {"x-materica-write-only": true, "$ref": "#/$defs/search"},
        "import": {
          "description": "What an importer found: a lead, never provenance. A placeholder until its members are named.",
          "x-materica-write-only": true,
          "$ref": "#/$defs/json_object"
        },
        "per_parameter": {
          "description": "A parameter's own provenance, in a parameter set.",
          "x-materica-write-only": true,
          "type": "object",
          "additionalProperties": {"$ref": "#/$defs/provenance"}
        },
        "recipe": {
          "description": "In a reference-only value, the locator and the steps to extract it from one's own copy (provenance.md section 7 item 2): a placeholder until its members are named.",
          "x-materica-write-only": true,
          "$ref": "#/$defs/json_object"
        }
      },
      "additionalProperties": false,
      "allOf": [
        {
          "if": {"required": ["origin"], "properties": {"origin": {"const": "measured_by_source"}}},
          "then": {"required": ["source"]}
        },
        {
          "if": {"required": ["origin"], "properties": {"origin": {"const": "derived"}}},
          "then": {"required": ["derivation"]}
        },
        {
          "if": {"required": ["origin"], "properties": {"origin": {"const": "evaluated_from_formulation"}}},
          "then": {"required": ["formulation"]}
        },
        {
          "if": {
            "required": ["extraction"],
            "properties": {"extraction": {"required": ["method"], "properties": {"method": {"const": "derivation"}}}}
          },
          "then": {"required": ["derivation"]}
        },
        {
          "if": {
            "required": ["extraction"],
            "properties": {"extraction": {"required": ["method"], "properties": {"method": {"const": "formulation"}}}}
          },
          "then": {"required": ["formulation"]}
        }
      ]
    },
    "source": {
      "description": "The source registry's key, the document read and the place in it. A read checks only key, which a result returns.",
      "type": "object",
      "required": ["key", "document", "locator"],
      "properties": {
        "key": {"type": "string"},
        "document": {"x-materica-write-only": true, "$ref": "#/$defs/document"},
        "locator": {"x-materica-write-only": true, "$ref": "#/$defs/locator"}
      },
      "additionalProperties": false
    },
    "document": {
      "description": "A document by its identifier (a DOI as doi:<DOI>, or a URL) and the version read.",
      "type": "object",
      "required": ["identifier", "version"],
      "properties": {"identifier": {"type": "string"}, "version": {"type": "string"}},
      "additionalProperties": false
    },
    "locator": {
      "description": "A place in the document version named beside it (provenance.md section 2 items 2 and 7).",
      "type": "object",
      "required": ["type"],
      "properties": {
        "type": {"$ref": "vocabulary/provenance.json#/$defs/locator_type"},
        "label": {"type": "string"},
        "page": {"type": "integer"},
        "column": {"$ref": "#/$defs/column"},
        "row": {"type": "string"},
        "entry": {"type": "string"}
      },
      "additionalProperties": false
    },
    "column": {
      "description": "A table's column, its header quoted and its index counted from 1 as printed.",
      "type": "object",
      "required": ["header", "index"],
      "properties": {"header": {"type": "string"}, "index": {"type": "integer", "minimum": 1}},
      "additionalProperties": false
    },
    "extraction": {
      "description": "provenance.md section 3: the method, with the members its row requires.",
      "type": "object",
      "required": ["method"],
      "properties": {
        "method": {"$ref": "vocabulary/provenance.json#/$defs/extraction_method"},
        "text_extraction": {"type": "string"},
        "digitisation": {
          "description": "The tool, the axis calibration and an estimate of digitising error: a placeholder until its members are named.",
          "$ref": "#/$defs/json_object"
        },
        "dataset_licence": {"type": "string"},
        "source_unit": {"type": "string"},
        "conversion": {"type": "string"}
      },
      "additionalProperties": false,
      "allOf": [
        {
          "if": {"required": ["method"], "properties": {"method": {"const": "table"}}},
          "then": {"required": ["text_extraction"]}
        },
        {
          "if": {"required": ["method"], "properties": {"method": {"const": "text"}}},
          "then": {"required": ["text_extraction"]}
        },
        {
          "if": {"required": ["method"], "properties": {"method": {"const": "digitised_figure"}}},
          "then": {"required": ["digitisation"]}
        },
        {
          "if": {"required": ["method"], "properties": {"method": {"const": "supplementary_dataset"}}},
          "then": {"required": ["dataset_licence"]}
        }
      ]
    },
    "evidence": {
      "description": "provenance.md section 4: the quote, or its hash where quotes may not ship, the locator and document it was read at, and the copy read, with the quote's place in it.",
      "type": "object",
      "properties": {
        "quote": {"type": "string"},
        "quote_sha256": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}(?![\\s\\S])"},
        "locator": {"$ref": "#/$defs/locator"},
        "document": {"$ref": "#/$defs/document"},
        "copy": {"$ref": "#/$defs/copy"}
      },
      "additionalProperties": false,
      "not": {"required": ["quote", "quote_sha256"]}
    },
    "copy": {
      "description": "provenance.md section 4 item 2: the SHA-256 of the copy read, the date it was retrieved, and the quote's place in that copy, the hash of the page-text document it counts in and its spans, present together or not at all (page_text.md section 2); outside the content hash. A place's rules across members (a place only beside a quote or its hash, a range in order and within its text, the boxes and the lines, one span per page, what may lie between two spans) are the record checks' (RC-222).",
      "type": "object",
      "required": ["sha256", "retrieved"],
      "properties": {
        "sha256": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}(?![\\s\\S])"},
        "retrieved": {"type": "string"},
        "page_text": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}(?![\\s\\S])"},
        "spans": {"type": "array", "minItems": 1, "items": {"anyOf": [{"$ref": "#/$defs/page_span"}, {"$ref": "#/$defs/element_span"}]}}
      },
      "dependentRequired": {"page_text": ["spans"], "spans": ["page_text"]},
      "additionalProperties": false
    },
    "page_span": {
      "description": "A span of a place in a PDF's page-text document (page_text.md section 2 items 2 to 5): the page by its position in the copy's file, from 1; the characters of its text; one box per line it touches, for a viewer; and the characters that print the value.",
      "type": "object",
      "required": ["page", "characters"],
      "properties": {
        "page": {"type": "integer", "minimum": 1},
        "characters": {"$ref": "#/$defs/character_range"},
        "boxes": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/box"}},
        "value_characters": {"$ref": "#/$defs/character_range"}
      },
      "additionalProperties": false
    },
    "element_span": {
      "description": "A span of a place in an XML file's page-text document (page_text.md section 2 items 2, 3 and 5): the element by its path, the characters of its string value, and the characters that print the value.",
      "type": "object",
      "required": ["element", "characters"],
      "properties": {
        "element": {"$ref": "#/$defs/element_path"},
        "characters": {"$ref": "#/$defs/character_range"},
        "value_characters": {"$ref": "#/$defs/character_range"}
      },
      "additionalProperties": false
    },
    "character_range": {
      "description": "[start, end]: Unicode code points counted from 0, end excluded (page_text.md section 2 item 3).",
      "type": "array",
      "minItems": 2,
      "maxItems": 2,
      "items": {"type": "integer", "minimum": 0}
    },
    "box": {
      "description": "[x0, y0, x1, y1] in the page's default user space, before its /Rotate (page_text.md section 2 item 4).",
      "type": "array",
      "minItems": 4,
      "maxItems": 4,
      "items": {"type": "number"}
    },
    "element_path": {
      "description": "An element's absolute path, every step positioned, a namespaced name as {uri}local (page_text.md section 1 item 9).",
      "type": "string",
      "pattern": "^(/(\\{[^}]+\\})?[^/{}\\[\\]]+\\[[1-9][0-9]*\\])+(?![\\s\\S])"
    },
    "review": {
      "description": "Who checked the value against the source, their ORCID, the date, whether they are independent of whoever or whatever extracted it, and the checklist items covered.",
      "type": "object",
      "required": ["result", "reviewer", "orcid", "date", "independent_of_extraction", "checklist"],
      "properties": {
        "result": {"$ref": "vocabulary/provenance.json#/$defs/review_result"},
        "reviewer": {"type": "string"},
        "orcid": {"type": "string"},
        "date": {"type": "string"},
        "independent_of_extraction": {"type": "boolean"},
        "checklist": {"type": "array", "items": {"type": "string"}}
      },
      "additionalProperties": false
    },
    "derivation": {
      "description": "A derived value's method, its inputs as pinned references, its assumptions, the inputs' specimen facts, and whether the inputs' conditions differ (provenance.md section 5).",
      "type": "object",
      "required": ["method", "inputs", "assumptions", "input_specimens"],
      "properties": {
        "method": {"type": "string"},
        "inputs": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/derivation_input"}},
        "assumptions": {"type": "array", "items": {"type": "string"}},
        "input_specimens": {"type": "array", "items": {"$ref": "#/$defs/input_specimen"}},
        "mixed_conditions": {"type": "boolean"}
      },
      "additionalProperties": false
    },
    "derivation_input": {
      "type": "object",
      "required": ["record", "field"],
      "properties": {"record": {"$ref": "#/$defs/pinned_record"}, "field": {"type": "string"}},
      "additionalProperties": false
    },
    "input_specimen": {
      "description": "An input's specimen facts, input being its index in inputs.",
      "type": "object",
      "required": ["input", "specimen"],
      "properties": {"input": {"type": "integer", "minimum": 0}, "specimen": {"$ref": "#/$defs/specimen"}},
      "additionalProperties": false
    },
    "search": {
      "description": "The search that found the sources a pooled statistic is taken across: the queries, databases, date and inclusion criteria (members not yet named), the sources' own weighting, and what they are (provenance.md section 2).",
      "type": "object",
      "required": ["inputs"],
      "properties": {
        "weighting": {"type": "string"},
        "inputs": {"$ref": "vocabulary/provenance.json#/$defs/search_inputs"}
      },
      "additionalProperties": {"$ref": "#/$defs/json_value"}
    },
    "pinned_record": {
      "description": "A record by its id and version, pinned by its content hash.",
      "type": "object",
      "required": ["id", "version", "content_hash"],
      "properties": {
        "id": {"$ref": "#/$defs/record_id"},
        "version": {"$ref": "#/$defs/version"},
        "content_hash": {"$ref": "#/$defs/content_hash"}
      },
      "additionalProperties": false
    },
    "extension": {
      "description": "A namespace's sections, using the same value fields. A placeholder until their shape is written; a reader never checks it.",
      "$ref": "#/$defs/json_object"
    },
    "status_object": {
      "description": "A member's status where it has no ordinary value (provenance.md section 1).",
      "type": "object",
      "required": ["status"],
      "properties": {
        "status": {"enum": ["unstated", "not_checked", "none", "not_applicable", "withheld"]},
        "reason": {"type": "string"}
      },
      "additionalProperties": false
    },
    "status_withheld": {
      "description": "A status object holding withheld: a reference-only value (provenance.md section 7).",
      "type": "object",
      "required": ["status"],
      "properties": {"status": {"enum": ["withheld"]}, "reason": {"type": "string"}},
      "additionalProperties": false
    },
    "status_none": {
      "description": "A status object holding none.",
      "type": "object",
      "required": ["status"],
      "properties": {"status": {"enum": ["none"]}, "reason": {"type": "string"}},
      "additionalProperties": false
    },
    "status_not_applicable": {
      "description": "A status object holding not_applicable.",
      "type": "object",
      "required": ["status"],
      "properties": {"status": {"enum": ["not_applicable"]}, "reason": {"type": "string"}},
      "additionalProperties": false
    },
    "status_unstated": {
      "description": "A status object holding unstated.",
      "type": "object",
      "required": ["status"],
      "properties": {"status": {"enum": ["unstated"]}, "reason": {"type": "string"}},
      "additionalProperties": false
    },
    "status_not_checked": {
      "description": "A status object holding not_checked.",
      "type": "object",
      "required": ["status"],
      "properties": {"status": {"enum": ["not_checked"]}, "reason": {"type": "string"}},
      "additionalProperties": false
    },
    "status_unstated_or_not_applicable": {
      "description": "A status object holding unstated or not_applicable.",
      "type": "object",
      "required": ["status"],
      "properties": {"status": {"enum": ["unstated", "not_applicable"]}, "reason": {"type": "string"}},
      "additionalProperties": false
    },
    "status_withheld_or_not_applicable": {
      "description": "A status object holding withheld or not_applicable.",
      "type": "object",
      "required": ["status"],
      "properties": {"status": {"enum": ["withheld", "not_applicable"]}, "reason": {"type": "string"}},
      "additionalProperties": false
    },
    "status_not_withheld": {
      "description": "A status object holding any token but withheld, which an evidence entry holds only whole.",
      "type": "object",
      "required": ["status"],
      "properties": {"status": {"enum": ["unstated", "not_checked", "none", "not_applicable"]}, "reason": {"type": "string"}},
      "additionalProperties": false
    },
    "placeholder": {
      "description": "A member whose shape is not yet written, in a member that may hold a status object instead: any object but one holding status, which is a status object and holds a token its row allows (provenance.md section 1 item 5).",
      "type": "object",
      "not": {"required": ["status"]},
      "additionalProperties": {"$ref": "#/$defs/json_value"}
    },
    "json_value": {
      "description": "Any JSON value: every number a double (record_format.md section 1 item 6).",
      "anyOf": [
        {"type": "boolean"},
        {"type": "number"},
        {"type": "string"},
        {"type": "array", "items": {"$ref": "#/$defs/json_value"}},
        {"$ref": "#/$defs/json_object"},
        {"type": "null"}
      ]
    },
    "json_object": {
      "type": "object",
      "additionalProperties": {"$ref": "#/$defs/json_value"}
    }
  }
}
