{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openssom.org/schema/profile-deidentified-asset.json",
  "title": "SSOM De-identified Contribution Profile: Asset",
  "description": "An Asset with the identity of its owner removed. Unknown properties are rejected.",
  "allOf": [
    {
      "$ref": "asset.json"
    }
  ],
  "type": "object",
  "required": [
    "asset_id",
    "asset_type",
    "display_name",
    "lifecycle_state",
    "ssom_version",
    "identity",
    "contribution"
  ],
  "properties": {
    "asset_id": {
      "type": "string",
      "pattern": "^urn:ssom:asset:tok:[0-9a-f]{32,64}$"
    },
    "asset_type": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_]*$"
    },
    "display_name": {
      "type": "string",
      "pattern": "^urn:ssom:asset:tok:[0-9a-f]{32,64}$"
    },
    "lifecycle_state": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_]*$"
    },
    "asset_form": {},
    "equipment_roles": {},
    "device_roles": {},
    "lifecycle_roles": {},
    "asset_class_ref": {
      "type": "string",
      "pattern": "^urn:ssom:asset-class:[a-z0-9-]+$"
    },
    "equipment_model_ref": {
      "type": "string",
      "pattern": "^urn:ssom:equipment-model:[a-z0-9-]+$"
    },
    "ssom_version": {
      "type": "string",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9._@:+-]*$"
    },
    "identity": {
      "type": "object",
      "required": [
        "source_references",
        "confidence"
      ],
      "properties": {
        "source_references": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source_platform": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]*$"
              },
              "source_reference": {
                "type": "string",
                "pattern": "^urn:ssom:source:tok:[0-9a-f]{32,64}$"
              }
            },
            "additionalProperties": false
          }
        },
        "confidence": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "attribute_assertions": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "attribute_code",
          "value",
          "confidence"
        ],
        "properties": {
          "attribute_code": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]*$"
          },
          "value": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              },
              {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]*$"
              }
            ]
          },
          "unit": {
            "type": "object",
            "required": [
              "unit_code",
              "vocabulary_id"
            ],
            "properties": {
              "unit_code": {
                "type": "string",
                "pattern": "^[A-Z][A-Z0-9_]*$"
              },
              "vocabulary_id": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9-]*$"
              }
            },
            "additionalProperties": false
          },
          "quantity_kind": {},
          "confidence": {
            "type": "number"
          }
        },
        "additionalProperties": false
      }
    },
    "contribution": {
      "type": "object",
      "required": [
        "cohort_ref",
        "policy_decision_ref",
        "tokenization_version"
      ],
      "properties": {
        "cohort_ref": {
          "type": "string",
          "pattern": "^urn:ssom:cohort:tok:[0-9a-f]{32,64}$"
        },
        "policy_decision_ref": {
          "type": "string",
          "pattern": "^urn:ssom:decision:tok:[0-9a-f]{32,64}$"
        },
        "tokenization_version": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9._@:+-]*$"
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
