{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "additionalProperties": true,
  "properties": {
    "type": {
      "type": "array",
      "readOnly": true,
      "default": [
        "RecognizedEntity",
        "RegisteredIdentity"
      ],
      "items": {
        "type": "string"
      },
      "allOf": [
        {
          "contains": {
            "const": "RecognizedEntity",
            "minContains": 1
          }
        },
        {
          "contains": {
            "const": "RegisteredIdentity",
            "minContains": 1
          }
        }
      ],
      "description": "MUST include both `RecognizedEntity` (W3C Recognized Entities v1.0) and `RegisteredIdentity` (UNTP), so that a DIA is processable by a conforming W3C recognized-entity processor."
    },
    "id": {
      "example": "did:web:samplecompany.com/123456789",
      "type": "string",
      "format": "uri",
      "description": "The DID controlled by the registered member, linked to the `registeredId` through this Identity Anchor. This is the `RecognizedEntity` identifier in W3C Recognized Entities v1.0 and MUST be a DID."
    },
    "registeredName": {
      "example": "Sample business Ltd",
      "type": "string",
      "description": "The registered name of the entity within the identifier scheme.  Examples: product - EV battery 300Ah, Party - Sample Company Pty Ltd,  Facility - Green Acres battery factory "
    },
    "registeredId": {
      "example": 123456789,
      "type": "string",
      "description": "The registration number (alphanumeric) of the entity within the register. Unique within the register."
    },
    "registeredDate": {
      "type": "string",
      "format": "date",
      "description": "The date on which this identity was first registered with the registrar."
    },
    "publicInformation": {
      "type": "string",
      "format": "uri",
      "description": "A link to further information about the registered entity on the authoritative registrar site."
    },
    "idScheme": {
      "$ref": "#/$defs/IdentifierScheme",
      "description": "The identifier scheme operated by the registrar"
    },
    "registrar": {
      "type": "object",
      "properties": {
        "type": {
          "type": "array",
          "readOnly": true,
          "default": [
            "Party"
          ],
          "items": {
            "type": "string"
          },
          "allOf": [
            {
              "contains": {
                "const": "Party",
                "minContains": 1
              }
            }
          ]
        },
        "id": {
          "example": "https://sample-business-register.gov/123456789",
          "type": "string",
          "format": "uri",
          "description": "Globally unique identifier of this party. Typically represented as a URI identifierScheme/Identifier URI"
        },
        "name": {
          "example": "Sample Company Ltd",
          "type": "string",
          "description": "Legal registered name of this party."
        }
      },
      "required": [
        "id",
        "name"
      ],
      "description": "The registrar party that operates the register."
    },
    "registerType": {
      "type": "string",
      "enum": [
        "product",
        "facility",
        "business",
        "trademark",
        "land",
        "accreditation"
      ],
      "example": "product",
      "description": "The thematic purpose of the register - organisations, facilities, products, trademarks, etc"
    },
    "recognitionScope": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RecognitionScope"
      },
      "description": "What the registrar recognises this entity as, and under what mandate - its legal form, class or licence category, the standards or schemes the recognition rests on, the actions it covers, and any territorial limit. Each entry references a definition the registrar itself publishes. Replaces the v0.8.0 `registrationScope`, which conflated these."
    }
  },
  "description": "The identity anchor binds a registered identity to one or more decentralised identifiers controlled by the registered member. It is a profile of the W3C Recognized Entities v1.0 `RecognizedEntity`, adding the register-managed identifier and scheme that W3C does not yet define.",
  "required": [
    "id",
    "registeredName",
    "registeredId",
    "registeredDate",
    "idScheme",
    "registerType"
  ],
  "$defs": {
    "IdentifierScheme": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "array",
          "readOnly": true,
          "default": [
            "IdentifierScheme"
          ],
          "items": {
            "type": "string"
          },
          "allOf": [
            {
              "contains": {
                "const": "IdentifierScheme",
                "minContains": 1
              }
            }
          ]
        },
        "id": {
          "type": "string",
          "format": "uri",
          "description": "The URI of this identifier scheme"
        },
        "name": {
          "example": "Global Identifier Scheme Name",
          "type": "string",
          "description": "The name of the identifier scheme. "
        }
      },
      "description": "An identifier registration scheme for products, facilities, or organisations. Typically operated by a state, national or global authority.",
      "required": [
        "id",
        "name"
      ]
    },
    "RecognitionScope": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "array",
          "readOnly": true,
          "default": [
            "RecognitionScope"
          ],
          "items": {
            "type": "string"
          },
          "allOf": [
            {
              "contains": {
                "const": "RecognitionScope",
                "minContains": 1
              }
            }
          ]
        },
        "scopeCode": {
          "type": "string",
          "enum": [
            "legal-form",
            "entity-class",
            "assessed-against",
            "action",
            "territory"
          ],
          "example": "legal-form",
          "description": "OPTIONAL discoverability hint identifying which aspect of the recognition this entry expresses, from the UN/CEFACT [recognition-scope code list](https://test.uncefact.org/vocabulary/recognition-scope/). Omit when no value fits; there is no 'other' value. The `id` remains the authoritative meaning."
        },
        "id": {
          "type": "string",
          "format": "uri",
          "example": "https://abr.business.gov.au/Help/EntityTypeDescription?Id=19",
          "description": "The registrar's own definition of this class, mandate, action or territory, as a resolvable URI. Authority stays with the register; UNTP maintains no list of the world's legal forms."
        },
        "name": {
          "type": "string",
          "example": "Australian Private Company",
          "description": "The value as the register names it, in the register's own language."
        },
        "scheme": {
          "$ref": "#/$defs/IdentifierScheme",
          "description": "OPTIONAL reference to the controlled list this value is drawn from. Useful because one registrar commonly publishes several lists and the value URI alone does not say which."
        }
      },
      "required": [
        "id",
        "name"
      ],
      "description": "One aspect of what a registrar recognises about an entity."
    }
  }
}
