{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://aistory-archive.pages.dev/standards/galatea-g68.schema.json",
  "title": "Galatea Standard G-68 1.0",
  "description": "Public exchange contract for versioned embodiment references using millimeter geometry and G68-RH-XYZ-v1.",
  "type": "object",
  "required": [
    "G68-HDR",
    "reference_profile"
  ],
  "properties": {
    "G68-HDR": {
      "type": "object",
      "required": [
        "standard_version",
        "asset_id",
        "source_type",
        "coordinate_system",
        "unit",
        "precision",
        "rights_status",
        "compatibility_level"
      ],
      "additionalProperties": false,
      "properties": {
        "standard_version": {
          "const": "1.0"
        },
        "asset_id": {
          "type": "string",
          "minLength": 1
        },
        "source_type": {
          "type": "string",
          "minLength": 1
        },
        "coordinate_system": {
          "const": "G68-RH-XYZ-v1"
        },
        "unit": {
          "const": "mm"
        },
        "precision": {
          "const": "UNCERTAINTY_DRIVEN_RECORD"
        },
        "time_base": {
          "type": "string"
        },
        "rights_status": {
          "type": "string"
        },
        "content_hash": {
          "type": "string"
        },
        "compatibility_level": {
          "type": "string"
        }
      }
    },
    "reference_profile": {
      "type": "object",
      "required": [
        "class",
        "identifier",
        "version",
        "artifact_mode"
      ],
      "properties": {
        "class": {
          "enum": [
            "R0",
            "AR",
            "HR",
            "PR"
          ]
        },
        "identifier": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "artifact_mode": {
          "type": "boolean"
        },
        "origin_definition": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "G-Mesh": {
      "$ref": "#/$defs/layer"
    },
    "R-Profile": {
      "$ref": "#/$defs/layer"
    },
    "S-Skin": {
      "$ref": "#/$defs/layer"
    },
    "K-Motion": {
      "$ref": "#/$defs/layer"
    },
    "P-Scent": {
      "$ref": "#/$defs/layer"
    },
    "L-View": {
      "$ref": "#/$defs/layer"
    },
    "C-Cal": {
      "$ref": "#/$defs/layer"
    },
    "RGT": {
      "$ref": "#/$defs/layer"
    },
    "conformance": {
      "type": "object",
      "properties": {
        "data_identity": {
          "type": "string"
        },
        "reference_render_identity": {
          "type": "string"
        },
        "physical_embodiment_conformance": {
          "type": "string"
        },
        "decoder_renderer_id": {
          "type": "string"
        },
        "tolerance_profile_id": {
          "type": "string"
        },
        "note": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "interoperability_mapping": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "target_standard",
          "relationship"
        ],
        "properties": {
          "target_standard": {
            "type": "string"
          },
          "relationship": {
            "type": "string"
          },
          "target_identifier": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    },
    "artifact_reference_notes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "$defs": {
    "measurementStatus": {
      "enum": [
        "measured",
        "estimated"
      ]
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source_basis": {
          "type": "string"
        },
        "source_id": {
          "type": "string"
        },
        "method": {
          "type": "string"
        },
        "instrument_id": {
          "type": "string"
        },
        "calibration_record_id": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "layer": {
      "type": "object",
      "required": [
        "measurement_status",
        "data"
      ],
      "properties": {
        "measurement_status": {
          "$ref": "#/$defs/measurementStatus"
        },
        "data": {
          "type": "object"
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "provenance": {
          "$ref": "#/$defs/provenance"
        },
        "unit": {
          "type": "string"
        },
        "coordinate_system": {
          "type": "string"
        },
        "precision": {
          "type": [
            "string",
            "number"
          ]
        }
      },
      "additionalProperties": false
    }
  }
}
