{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://matjson.org/schema/matrecord/0.1/schema.json",
  "title": "MatRecordJSON v0.1 — Concept Placeholder",
  "description": "Proposed normalized representation of MTRs, CMTRs, material certificates, test reports, and related evidence. Detailed semantics are TBC.",
  "x-matjson-profile": "matrecord",
  "x-matjson-status": "tbc",
  "type": "object",
  "required": [
    "matjson",
    "record",
    "materials",
    "evidence"
  ],
  "additionalProperties": false,
  "properties": {
    "matjson": {
      "type": "object",
      "required": [
        "profile",
        "version"
      ],
      "additionalProperties": false,
      "properties": {
        "profile": {
          "const": "matrecord"
        },
        "version": {
          "const": "0.1"
        }
      }
    },
    "record": {
      "type": "object",
      "required": [
        "id",
        "document_type"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "document_type": {
          "type": "string"
        },
        "issuer": {
          "type": "string"
        },
        "issued": {
          "type": "string",
          "format": "date"
        },
        "source_file": {
          "type": "string"
        }
      }
    },
    "materials": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "specification": {
            "type": "string"
          },
          "grade": {
            "type": [
              "string",
              "null"
            ]
          },
          "heat": {
            "type": [
              "string",
              "null"
            ]
          },
          "lot": {
            "type": [
              "string",
              "null"
            ]
          },
          "product_form": {
            "type": [
              "string",
              "null"
            ]
          },
          "chemistry": {
            "type": "object"
          },
          "mechanical": {
            "type": "object"
          },
          "heat_treatment": {
            "type": "array"
          },
          "tests": {
            "type": "array"
          }
        }
      }
    },
    "evidence": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "type",
          "reference"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "extraction_confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          }
        }
      }
    },
    "extensions": {
      "type": "object"
    }
  }
}
