@cef-ebsi/vcdm1.1-nova-ims-digital-credential-schema
Version:
Schema defining a verifiable credential issued by NOVA IMS representing a student's course enrolment details.
337 lines (336 loc) • 11 kB
JavaScript
export const metadata = {
vcdm: "1.1",
id: {
base16:
"0xbb338a82e14e38d78e0e9020aeb2b60eb17efe8e4a376549293f6886ac2a013d",
multibase_base58btc: "zDbkpiR1AXmj88VXBMcPdKvSWsMPnj7N4zzXz7wDMV4F6",
},
verification: "Documents",
context: "Education and lifelong learning",
};
export const schema = {
$schema: "https://json-schema.org/draft/2020-12/schema",
title: "NOVA IMS Digital Credential",
description:
"Schema defining a verifiable credential issued by NOVA IMS representing a student's course enrolment details.",
type: "object",
allOf: [
{
$schema: "https://json-schema.org/draft/2020-12/schema",
title: "EBSI Verifiable Attestation",
description:
"The schema defines a generic structure for any EBSI-related Verifiable Credentials according to the Verifiable Credentials Data Model v1.1",
type: "object",
properties: {
"@context": {
description:
"Semantic context for the issued credential. First element MUST be https://www.w3.org/2018/credentials/v1",
type: "array",
items: { type: "string", format: "uri" },
contains: { const: "https://www.w3.org/2018/credentials/v1" },
minItems: 1,
uniqueItems: true,
},
id: {
description: "Globally unique identifier for the issued credential",
type: "string",
format: "uri",
},
type: {
description:
"Full type chain, used to identify the credential base types",
type: "array",
items: { type: "string" },
contains: { type: "string", const: "VerifiableAttestation" },
uniqueItems: true,
},
issuer: {
description:
"Defines a property for expressing the issuer of a Verifiable Credential",
oneOf: [
{
description: "DID of the credential issuer",
type: "string",
format: "uri",
},
{
type: "object",
required: ["id"],
properties: {
id: {
description: "DID of the credential issuer",
type: "string",
format: "uri",
},
},
},
],
},
issuanceDate: {
description:
"Defines the date and time, when the issued credential becomes valid",
type: "string",
format: "date-time",
},
issued: {
description: "Defines when the issued credential was issued",
type: "string",
format: "date-time",
},
validFrom: {
description:
"Defines the date and time, when the issued credential becomes valid",
type: "string",
format: "date-time",
},
validUntil: {
description:
"Defines the date and time, when the issued credential expires",
type: "string",
format: "date-time",
},
expirationDate: {
description:
"Defines the date and time, when the issued credential expires",
type: "string",
format: "date-time",
},
credentialSubject: {
description:
"Defines information about the subject that is defined by the type chain",
anyOf: [
{ $ref: "#/allOf/0/%24defs/credentialSubject" },
{
type: "array",
items: { $ref: "#/allOf/0/%24defs/credentialSubject" },
},
],
},
credentialStatus: {
description:
"Defines suspension and/or revocation details for the issued credential. Further redefined by the type extension",
anyOf: [
{ $ref: "#/allOf/0/%24defs/credentialStatus" },
{
type: "array",
items: { $ref: "#/allOf/0/%24defs/credentialStatus" },
},
],
},
credentialSchema: {
description:
"One or more schemas that validate the Verifiable Credential.",
anyOf: [
{ $ref: "#/allOf/0/%24defs/credentialSchema" },
{
type: "array",
items: { $ref: "#/allOf/0/%24defs/credentialSchema" },
},
],
},
termsOfUse: {
description:
"Contains the terms under which the issued credential was issued",
anyOf: [
{ $ref: "#/allOf/0/%24defs/termsOfUse" },
{ type: "array", items: { $ref: "#/allOf/0/%24defs/termsOfUse" } },
],
},
evidence: {
description:
"Contains the optional evidence used to issue this credential",
anyOf: [
{ $ref: "#/allOf/0/%24defs/evidence" },
{ type: "array", items: { $ref: "#/allOf/0/%24defs/evidence" } },
],
},
},
required: [
"@context",
"id",
"type",
"issuer",
"issuanceDate",
"issued",
"validFrom",
"credentialSubject",
"credentialSchema",
],
$defs: {
credentialSubject: {
description:
"Defines information about the subject that is defined by the type chain",
type: "object",
properties: {
id: {
description:
"Defines the DID of the subject that is described by the issued credential",
type: "string",
format: "uri",
},
},
},
credentialStatus: {
description:
"Defines suspension and/or revocation details for the issued credential. Further redefined by the type extension",
type: "object",
properties: {
id: {
description: "Exact identity for the credential status",
type: "string",
format: "uri",
},
type: {
description: "Defines the revocation type extension",
type: "string",
},
},
required: ["id", "type"],
},
credentialSchema: {
description:
"Contains information about the credential schema on which the issued credential is based",
type: "object",
properties: {
id: {
description:
"References the credential schema stored on the Trusted Schemas Registry (TSR) on which the Verifiable Authorisation is based on",
type: "string",
format: "uri",
},
type: {
description: "Defines credential schema type",
type: "string",
},
},
required: ["id", "type"],
},
termsOfUse: {
description:
"Contains the terms under which the issued credential was issued",
type: "object",
properties: {
id: {
description:
"Contains a URL that points to where more information about this instance of terms of use can be found.",
type: "string",
},
type: { description: "Defines the type extension", type: "string" },
},
required: ["type"],
},
evidence: {
type: "object",
properties: {
id: {
description:
"If present, it SHOULD contain a URL that points to where more information about this instance of evidence can be found.",
type: "string",
},
type: {
anyOf: [
{
description: "Defines the evidence type extension",
type: "string",
},
{
description: "Defines the evidence type extension",
type: "array",
items: { type: "string" },
},
],
},
},
required: ["type"],
},
},
},
{
properties: {
credentialSubject: {
description:
"Contains details about the student and their course enrolment at NOVA IMS.",
type: "object",
properties: {
firstName: {
type: "string",
description: "The given name(s) of the student.",
},
familyName: {
type: "string",
description: "The family name(s) of the student.",
},
courseName: {
type: "string",
description:
"The official name of the course of study at NOVA IMS.",
},
specialization: {
type: "string",
description:
"The specialisation within the course, if applicable.",
},
startDate: {
type: "string",
format: "date",
description:
"The official start date of the student's enrolment in the course (YYYY-MM-DD).",
},
endDate: {
type: "string",
format: "date",
description:
"The official or expected end date of the student's enrolment (YYYY-MM-DD).",
},
},
required: [
"firstName",
"familyName",
"courseName",
"startDate",
"endDate",
],
},
},
},
],
$defs: {},
};
export const examples = {
exampleDigitalCredential: {
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/security/suites/jws-2020/v1",
],
id: "urn:uuid:a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d",
type: [
"VerifiableCredential",
"VerifiableAttestation",
"NovaImsDigitalCertification",
],
issuer: {
id: "did:ebsi:zExampleNovaImsDID123456789abcdef",
name: "Universidade Nova IMS",
},
issuanceDate: "2024-07-26T10:30:00Z",
issued: "2024-07-26T10:30:00Z",
validFrom: "2024-07-26T10:30:00Z",
credentialSchema: {
id: "https://api-pilot.ebsi.eu/trusted-schemas-registry/v3/schemas/zExampleNovaImsSchemaIDabcdef12345",
type: "FullJsonSchemaValidator2021",
},
credentialStatus: {
id: "https://status.novaims.unl.pt/status/course-records/1#101",
type: "StatusList2021",
},
credentialSubject: {
id: "did:key:z6MkrPhff2g4Jk5a8fG1hJ9kL3nNpPqQrStUvWxyzZ7bXyAd",
firstName: "Beatriz",
familyName: "Costa",
courseName: "Mestrado em Gestão de Informação",
specialization: "Business Intelligence e Analytics",
startDate: "2022-09-19",
endDate: "2024-07-12",
},
},
};