{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://data.deqar.eu/schema/v1.json",
  "title": "DEQAR Report (Verifiable Accreditation)",
  "description": "An ESG-compatible external quality assurance result recorded in DEQAR",
  "type": "object",
  "properties": {
    "@context": {
      "description": "Defines semantic context of the Verifiable Credential",
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "id": {
      "description": "Unique DEQAR report ID",
      "type": "string",
      "format": "uri"
    },
    "type": {
      "description": "Defines the DEQAR Report/Verifiable Accreditation type",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "issuer": {
      "description": "Defines the issuer (DID of registered QA agency or EQAR as proxy)",
      "type": "string"
    },
    "issuanceDate": {
      "description": "Defines when the Verifiable Credential was issued",
      "type": "string",
      "format": "date-time"
    },
    "validFrom": {
      "description": "Date and time when the QA report became valid (DEQAR valid_from)",
      "type": "string",
      "format": "date-time"
    },
    "expirationDate": {
      "description": "Date and time when the QA report expires (DEQAR valid_to, default 6 years)",
      "type": "string",
      "format": "date-time"
    },
    "credentialSubject": {
      "description": "Defines information about the higher education institutions (and programmes) covered by the QA report",
      "type": "object",
      "properties": {
        "id": {
          "description": "DID of the higher education institution covered by the QA report",
          "type": "string"
        },
        "authorizationClaims": {
          "description": "Details about the type, outcome and scope of quality assurance",
          "type": "object",
          "properties": {
            "accreditationType": {
              "description": "Type of external quality assurance",
              "type": "string",
              "enum": [
                "institutional",
                "institutional/programme",
                "programme",
                "joint programme",
                "institution/programme",
                "http://data.europa.eu/snb/accreditation/003293d2ce",
                "http://data.europa.eu/snb/accreditation/e57dddfcf3"
              ]
            },
            "accreditationStatus": {
              "description": "Official status of the external quality assurance",
              "type": "string",
              "enum": [
                "part of obligatory EQA system",
		"voluntary"
              ]
            },
            "decision": {
              "description": "Formal outcome of the QA report",
              "type": "string",
              "enum": [
                "positive",
                "positive with conditions or restrictions",
                "negative",
                "not applicable",
                null
              ]
            },
            "report": {
              "description": "A publicly accessible report of the quality assurance procedure",
              "type": [
                "string",
                "array"
              ],
              "items": {
                "type": "string"
              }
            },
            "limitField": {
              "description": "Limited field of study for which the institutional QA procedure is valid",
              "type": "string"
            },
            "limitQFLevel": {
              "description": "Limited set of EQF/QF-EHEA levels for which the institutional QA procedure is valid",
              "type": [
                "string",
                "array"
              ],
              "items": {
                "type": "string"
              }
            },
            "limitQualification": {
              "description": "Qualification(s) for which the QA procedure is valid",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "description": "A portable and unique identifier of the qualification.",
                    "type": "string"
                  },
                  "title": {
                    "description": "The title of the qualification",
                    "type": "string"
                  },
                  "alternativeLabel": {
                    "description": "Alternative name(s) of the qualification",
                    "type": [
                      "string",
                      "array"
                    ],
                    "items": {
                      "type": "string"
                    }
                  },
                  "EQFLevel": {
                    "description": "The qualification level as specified by the European Qualification Framework",
                    "type": "string"
                  },
                  "NQFLevel": {
                    "description": "The qualification level as specified by a National Qualification Framework",
                    "type": "string"
                  }
                }
              }
            },
            "reviewDate": {
              "description": "The date by which the next periodic external QA procedure should be conducted",
              "type": "string"
            }
          },
          "required": [
            "accreditationType",
            "decision",
            "report"
          ]
        }
      },
      "required": [
        "id",
        "authorizationClaims"
      ]
    },
    "credentialStatus": {
      "description": "Contains information about how to verify the status of the Verifiable Accreditation (via the Revocation and Endorsement Registry, RER)",
      "type": "object",
      "properties": {
        "id": {
          "description": "References record in the Revocation and Endorsement Registry (RER) to enable verification of a Verifiable Accreditation’s validity",
          "type": "string"
        },
        "type": {
          "description": "Defines the Verifiable Credential status type",
          "type": "string"
        }
      },
      "required": [
        "id",
        "type"
      ]
    },
    "credentialSchema": {
      "description": "Contains information about the credential schema (template) on which the Verifiable Accreditation is based",
      "type": "object",
      "properties": {
        "id": {
          "description": "References the credential schema (template) stored on the (relevant) Trusted Schemas Registry (TSR) on which the Verifiable Accreditation is based",
          "type": "string"
        },
        "type": {
          "description": "Defines credential schema type",
          "type": "string"
        }
      },
      "required": [
        "id",
        "type"
      ]
    },
    "proof": {
      "description": "Contains information about the proof",
      "type": "object",
      "properties": {
        "type": {
          "description": "Defines the proof type",
          "type": "string"
        },
        "proofPurpose": {
          "description": "Defines the purpose of the proof",
          "type": "string"
        },
        "created": {
          "description": "Defines the date and time, when the proof has been created",
          "type": "string",
          "format": "date-time"
        },
        "verificationMethod": {
          "description": "Contains information about the verification method / proof mechanisms",
          "type": "string"
        },
        "jws": {
          "description": "Defines the proof value in JWS format",
          "type": "string"
        }
      },
      "required": [
        "type",
        "created",
        "jws"
      ]
    }
  },
  "required": [
    "@context",
    "id",
    "type",
    "issuer",
    "issuanceDate",
    "credentialSubject",
    "credentialSchema",
    "proof"
  ]
}
