{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "@context": {
      "description": "JSON-LD context. Production deployments use the published register vocabulary context at vocabulary.uncefact.org so that register.json is processable as Linked Data.",
      "oneOf": [
        { "type": "string", "format": "uri" },
        { "type": "array" },
        { "type": "object" }
      ]
    },
    "@type": {
      "oneOf": [
        { "type": "string" },
        { "type": "array", "items": { "type": "string" } }
      ]
    },
    "id": { "type": "string", "format": "uri" },
    "name": { "type": "string" },
    "description": { "type": "string" },
    "lastUpdated": { "type": "string", "format": "date" },
    "registrar": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": { "type": "string", "format": "uri" },
        "name": { "type": "string" },
        "agent": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "id": { "type": "string", "format": "uri" },
            "name": { "type": "string" },
            "description": { "type": "string" }
          },
          "required": ["id"]
        }
      },
      "required": ["id", "name"]
    },
    "entries": {
      "type": "array",
      "items": { "$ref": "#/$defs/SchemeEntry" }
    }
  },
  "required": ["id", "name", "lastUpdated", "registrar", "entries"],
  "description": "A register of conformity schemes that have published machine-readable UNTP Conformity Vocabulary Catalogue (CVC) vocabularies. Each entry catalogues one scheme operated by a scheme owner, points at the owner's published vocabularyURL, and carries agent-discovered profile metadata (topics, standards/regulatory alignments, validity, criterion count). Profile and criterion content remain canonical at the scheme owner's URL; the register is a discovery and indexing layer over a federation of independently-published scheme vocabularies.",
  "$defs": {
    "SchemeEntry": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "@type": {
          "oneOf": [
            { "type": "string" },
            { "type": "array", "items": { "type": "string" } }
          ]
        },
        "id": {
          "type": "string",
          "format": "uri",
          "description": "Globally unique identifier for this entry within the register (e.g. https://registers.uncefact.org/untp/cvc/rba-vap)."
        },
        "name": { "type": "string" },
        "shortName": { "type": "string" },
        "owner": {
          "$ref": "#/$defs/SchemeOwner",
          "description": "The scheme owner. The `owner.id` (DID) is the cryptographic identity that signs the registration VC and that the registrar agent uses to verify scheme authorship."
        },
        "statement": {
          "type": "string",
          "description": "Owner-authored description of the scheme's purpose, scope, and assurance approach."
        },
        "vocabularyURL": {
          "type": "string",
          "format": "uri",
          "description": "Root URL of the scheme owner's published CVC vocabulary. The registrar agent crawls this URL on each observation cycle to discover profiles, profile versions, and per-version metadata."
        },
        "documentation": {
          "type": "string",
          "format": "uri",
          "description": "Public landing page for the scheme."
        },
        "industrySector": { "$ref": "#/$defs/IndustrySector" },
        "geographicScope": { "$ref": "#/$defs/GeographicScope" },
        "endorsementLevel": {
          "type": "string",
          "enum": ["Self", "Mandate", "Accreditation", "Benchmarked"],
          "description": "Assurance level. Resolves via context @vocab to the corresponding reg:Endorsement_* concept (e.g. `Self` → `reg:Endorsement_Self`)."
        },
        "endorsement": { "$ref": "#/$defs/Endorsement" },
        "licenseType": {
          "type": "string",
          "enum": [
            "ProprietaryCode",
            "ProprietaryDocument",
            "PermissiveOpenSource",
            "Copyleft",
            "CreativeCommons",
            "SourceAvailable",
            "Public"
          ],
          "description": "Licence terms for the scheme vocabulary. Resolves via context @vocab to the corresponding reg:License_* concept."
        },
        "establishedDate": {
          "type": "string",
          "format": "date",
          "description": "Date the scheme was first established."
        },
        "trustmark": {
          "type": "string",
          "format": "uri",
          "description": "URL of the scheme's trust mark or seal image."
        },
        "status": {
          "type": "string",
          "enum": ["proposed", "planned", "development", "pilot", "active", "observed", "conformant", "non-conformant", "dormant", "withdrawn"],
          "description": "Lifecycle status. `proposed`/`planned` for hand-curated seeds; `active`/`observed`/`conformant` once the registrar agent has crawled and validated the scheme's vocabulary."
        },
        "registrationVc": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "id": { "type": "string", "format": "uri" },
            "issuer": { "type": "string", "format": "uri" },
            "issuedAt": { "type": "string", "format": "date-time" },
            "hashAlgorithm": { "type": "string" },
            "hashValue": { "type": "string" }
          },
          "required": ["id", "issuer"]
        },
        "profiles": {
          "type": "array",
          "items": { "$ref": "#/$defs/ConformityProfile" },
          "description": "Profiles discovered by the registrar agent's crawl of `vocabularyURL`. Agent-maintained; not hand-edited."
        },
        "observedStatus": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "lastObservedAt": { "type": "string", "format": "date-time" },
            "currentAssessment": {
              "type": "string",
              "enum": ["conformant", "non-conformant", "partially-conformant", "insufficient-data"]
            },
            "profilesDiscovered": { "type": "integer", "minimum": 0 },
            "profileVersionsDiscovered": { "type": "integer", "minimum": 0 }
          },
          "required": ["currentAssessment"]
        }
      },
      "required": ["id", "name", "owner", "vocabularyURL", "status"]
    },
    "SchemeOwner": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "@type": {
          "oneOf": [
            { "type": "string" },
            { "type": "array", "items": { "type": "string" } }
          ]
        },
        "id": {
          "type": "string",
          "format": "uri",
          "description": "DID of the scheme owner organisation."
        },
        "name": { "type": "string" },
        "website": { "type": "string", "format": "uri" },
        "registeredId": { "type": "string", "description": "Optional business-register identifier of the owner organisation." }
      },
      "required": ["id", "name"]
    },
    "Endorsement": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "@type": {
          "oneOf": [
            { "type": "string" },
            { "type": "array", "items": { "type": "string" } }
          ]
        },
        "name": { "type": "string" },
        "issuingAuthority": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "id": { "type": "string", "format": "uri" },
            "name": { "type": "string" }
          },
          "required": ["id", "name"]
        },
        "endorsementEvidence": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "linkURL": { "type": "string", "format": "uri" },
            "linkName": { "type": "string" },
            "mediaType": { "type": "string" }
          },
          "required": ["linkURL"]
        }
      },
      "required": ["name", "issuingAuthority"]
    },
    "ConformityProfile": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "@type": {
          "oneOf": [
            { "type": "string" },
            { "type": "array", "items": { "type": "string" } }
          ]
        },
        "id": {
          "type": "string",
          "format": "uri",
          "description": "Profile identifier minted by the scheme owner (e.g. https://vocab.responsiblebusiness.org/vap/vap-full)."
        },
        "name": { "type": "string" },
        "description": { "type": "string" },
        "profileVersions": {
          "type": "array",
          "items": { "$ref": "#/$defs/ConformityProfileVersion" }
        }
      },
      "required": ["id", "name"]
    },
    "ConformityProfileVersion": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "@type": {
          "oneOf": [
            { "type": "string" },
            { "type": "array", "items": { "type": "string" } }
          ]
        },
        "profileVersionId": {
          "type": "string",
          "format": "uri",
          "description": "Stable URI for this profile version (e.g. https://vocab.responsiblebusiness.org/vap/vap-full/8.0.2). Referenced by `attestation.assessmentScheme` in DCCs and by claims in DPPs/DFRs."
        },
        "versionLabel": { "type": "string" },
        "validFrom": { "type": "string", "format": "date" },
        "validThrough": { "type": "string", "format": "date" },
        "topics": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://vocabulary\\.uncefact\\.org/conformity-topics/.+"
          },
          "description": "Conformity topic classifications for this profile version. Each value is a URI of a concept in the UNTP conformity-topics SKOS scheme."
        },
        "criterionCount": { "type": "integer", "minimum": 0 },
        "standardAlignments": {
          "type": "array",
          "items": { "$ref": "#/$defs/StandardAlignment" }
        },
        "regulatoryAlignments": {
          "type": "array",
          "items": { "$ref": "#/$defs/RegulatoryAlignment" }
        },
        "schemaReference": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "uri": { "type": "string", "format": "uri" },
            "hashAlgorithm": { "type": "string" },
            "hashValue": { "type": "string" },
            "registeredAt": { "type": "string", "format": "date-time" }
          },
          "required": ["uri"]
        }
      },
      "required": ["profileVersionId", "versionLabel"]
    },
    "StandardAlignment": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "@type": { "oneOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }] },
        "standard": { "type": "string", "format": "uri" },
        "name": { "type": "string" },
        "alignmentLevel": {
          "type": "string",
          "enum": ["partial", "meets", "exceeds"]
        }
      },
      "required": ["standard", "alignmentLevel"]
    },
    "RegulatoryAlignment": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "@type": { "oneOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }] },
        "regulation": { "type": "string", "format": "uri" },
        "name": { "type": "string" },
        "alignmentLevel": {
          "type": "string",
          "enum": ["partial", "meets", "exceeds"]
        }
      },
      "required": ["regulation", "alignmentLevel"]
    },
    "IndustrySector": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "label": { "type": "string" },
        "isicCodes": { "type": "array", "items": { "type": "string" } }
      },
      "required": ["label"]
    },
    "GeographicScope": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "label": { "type": "string" },
        "countries": { "type": "array", "items": { "type": "string" } },
        "isGlobal": { "type": "boolean" }
      },
      "required": ["label"]
    }
  }
}
