@cef-ebsi/vcdm1.1-vid-natural-person-schema
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

EBSI Logo

@cef-ebsi/vcdm1.1-vid-natural-person-schema

PID as W3C VC (VCDM 1.1)

The schema defines a structure for W3C VC PID

The schema is published to the Trusted Schemas Registry with the IDs:

  • 0x0372c96d0939ad2423ceda90077290ff1ffd644fceb78a89b5da80c6f1ea5daf (hexadecimal)
  • zETjzC5EFJGGYvm1SnBqQhNQUSPSk9ZMUEofGh6VZgfx (multibase base58btc)

Table of Contents

JSON Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "PID as W3C VC (VCDM 1.1)",
  "description": "The schema defines a structure for W3C VC PID",
  "type": "object",
  "allOf": [
    {
      "$ref": "./node_modules/@cef-ebsi/vcdm1.1-attestation-schema/schema.json"
    },
    {
      "properties": {
        "id": {
          "description": "Globally unique identifier for the issued credential. It can be a UUID or another globally unique identifier. document_number as per ARF",
          "type": "string",
          "format": "uri"
        },
        "issuer": {
          "description": "DID of the credential issuer. issuing_authority as per ARF",
          "oneOf": [
            {
              "type": "string",
              "format": "uri"
            },
            {
              "type": "object",
              "required": ["id"],
              "properties": {
                "id": {
                  "description": "DID of the credential issuer",
                  "type": "string",
                  "format": "uri"
                },
                "issuingCountry": {
                  "description": "issuing_country as per ARF. ISO 2-letter code",
                  "$ref": "#/$defs/nationality"
                }
              }
            }
          ]
        },
        "credentialSubject": {
          "$ref": "#/$defs/credentialSubjectPID"
        }
      }
    }
  ],
  "$defs": {
    "credentialSubjectPID": {
      "type": "object",
      "properties": {
        "credentialSubject": {
          "description": "Defines additional information about the subject that is described by the Verifiable ID",
          "type": "object",
          "properties": {
            "id": {
              "description": "Defines the DID of the subject that is described by the Verifiable Attestation. unique_id as per ARF",
              "type": "string",
              "format": "uri"
            },
            "familyName": {
              "description": "Defines current family name(s) of the credential subject. family_name as per ARF",
              "type": "string"
            },
            "firstName": {
              "description": "Defines current first name(s) of the credential subject. given_name as per ARF",
              "type": "string"
            },
            "familyNameAtBirth": {
              "description": "Defines family name(s) of the credential subject at birth. family_name_birth as per ARF",
              "type": "string"
            },
            "firstNameAtBirth": {
              "description": "Defines first name(s) of the credential subject at birth. given_name_birth as per ARF",
              "type": "string"
            },
            "dateOfBirth": {
              "description": "Defines date of birth of the credential subject. birth_date as per ARF",
              "type": "string",
              "format": "date"
            },
            "yearOfBirth": {
              "description": "Defines the year of birth of the credential subject. age_birth_year as per ARF",
              "type": "string",
              "format": "date"
            },
            "ageOverNN": {
              "description": "age_over_NN as per ARF.",
              "type": "boolean"
            },
            "ageInYears": {
              "description": "age_in_years as per ARF.",
              "type": "number"
            },
            "personalIdentifier": {
              "description": "Defines the unique national identifier of the credential subject (constructed by the sending Member State in accordance with the technical specifications for the purposes of cross-border identification and which is as persistent as possible in time). Alternative non-cryptographic identifier.  unique_id or administrative_identifier as per ARF",
              "type": "string"
            },
            "placeOfBirth": {
              "description": "Defines the place where the credential subject is born. birth_place, _country, _state, _city as per ARF",
              "$ref": "#/$defs/address"
            },
            "currentAddress": {
              "description": "Defines the current address of the credential subject. resident_address as per ARF",
              "$ref": "#/$defs/address"
            },
            "gender": {
              "description": "Defines the gender of the credential subject. Note: enumeration should be extended to capture are recognised genders. gender as per ARF",
              "type": "string",
              "enum": ["male", "female", "other"]
            },
            "nationality": {
              "description": "One or more nationalities. Recognised vocabulary must be used to express the nationalities. nationality as per ARF",
              "oneOf": [
                {
                  "$ref": "#/$defs/nationality"
                },
                {
                  "type": "array",
                  "items": {
                    "$ref": "#/$defs/nationality"
                  },
                  "minItems": 1
                }
              ]
            }
          },
          "required": [
            "id",
            "familyName",
            "firstName",
            "dateOfBirth",
            "personalIdentifier"
          ]
        }
      }
    },
    "nationality": {
      "type": "string",
      "enum": [
        "AD",
        "AE",
        "AF",
        "AG",
        "AI",
        "AL",
        "AM",
        "AO",
        "AQ",
        "AR",
        "AT",
        "AU",
        "AW",
        "AX",
        "AZ",
        "BA",
        "BB",
        "BD",
        "BE",
        "BF",
        "BG",
        "BH",
        "BI",
        "BJ",
        "BL",
        "BM",
        "BN",
        "BO",
        "BQ",
        "BR",
        "BS",
        "BT",
        "BV",
        "BW",
        "BY",
        "BZ",
        "CA",
        "CC",
        "CD",
        "CF",
        "CG",
        "CH",
        "CI",
        "CK",
        "CL",
        "CM",
        "CN",
        "CO",
        "CR",
        "CU",
        "CV",
        "CW",
        "CX",
        "CY",
        "CZ",
        "DE",
        "DJ",
        "DK",
        "DM",
        "DO",
        "DZ",
        "EC",
        "EE",
        "EG",
        "EH",
        "ER",
        "ES",
        "ET",
        "FI",
        "FJ",
        "FK",
        "FM",
        "FO",
        "FR",
        "GA",
        "GB",
        "GD",
        "GE",
        "GF",
        "GG",
        "GH",
        "GI",
        "GL",
        "GM",
        "GN",
        "GP",
        "GQ",
        "GR",
        "GS",
        "GT",
        "GU",
        "GW",
        "GY",
        "HK",
        "HM",
        "HN",
        "HR",
        "HT",
        "HU",
        "ID",
        "IE",
        "IL",
        "IM",
        "IN",
        "IO",
        "IQ",
        "IR",
        "IS",
        "IT",
        "JE",
        "JM",
        "JO",
        "JP",
        "KE",
        "KG",
        "KH",
        "KI",
        "KM",
        "KN",
        "KP",
        "KR",
        "KW",
        "KY",
        "KZ",
        "LA",
        "LB",
        "LC",
        "LI",
        "LK",
        "LR",
        "LS",
        "LT",
        "LU",
        "LV",
        "LY",
        "MA",
        "MC",
        "MD",
        "ME",
        "MF",
        "MG",
        "MH",
        "MK",
        "ML",
        "MM",
        "MN",
        "MO",
        "MP",
        "MQ",
        "MR",
        "MS",
        "MT",
        "MU",
        "MV",
        "MW",
        "MX",
        "MY",
        "MZ",
        "NA",
        "NC",
        "NE",
        "NF",
        "NG",
        "NI",
        "NL",
        "NO",
        "NP",
        "NR",
        "NU",
        "NZ",
        "OM",
        "PA",
        "PE",
        "PF",
        "PG",
        "PH",
        "PK",
        "PL",
        "PM",
        "PN",
        "PR",
        "PS",
        "PT",
        "PW",
        "PY",
        "QA",
        "RE",
        "RO",
        "RS",
        "RU",
        "RW",
        "SA",
        "SB",
        "SC",
        "SD",
        "SE",
        "SG",
        "SH",
        "SI",
        "SJ",
        "SK",
        "SL",
        "SM",
        "SN",
        "SO",
        "SR",
        "SS",
        "ST",
        "SV",
        "SX",
        "SY",
        "SZ",
        "TC",
        "TD",
        "TF",
        "TG",
        "TH",
        "TJ",
        "TK",
        "TL",
        "TM",
        "TN",
        "TO",
        "TR",
        "TT",
        "TV",
        "TW",
        "TZ",
        "UA",
        "UG",
        "UM",
        "US",
        "UY",
        "UZ",
        "VA",
        "VC",
        "VE",
        "VG",
        "VI",
        "VN",
        "VU",
        "WF",
        "WS",
        "YE",
        "YT",
        "ZA",
        "ZM",
        "ZW"
      ]
    },
    "address": {
      "description": "Postal Address as per schema.org with additional Full Address property.",
      "type": "object",
      "properties": {
        "addressCountry": {
          "description": "Defines the country of residence of the credential subject. MUST be two-letter ISO 3166-1 alpha-2 country code.",
          "type": "string"
        },
        "addressRegion": {
          "description": "Defines the address region of residence of the credential subject. MUST be ISO 3166-2 code",
          "type": "string"
        },
        "addressLocality": {
          "description": "The locality in which the street address is, and which is in the region. For example, Mountain View.",
          "type": "string"
        },
        "postalCode": {
          "description": "Defines the postal code of residence of the credential subject",
          "type": "string"
        },
        "streetAddress": {
          "description": "The street address. For example, 1600 Amphitheatre",
          "type": "string"
        },
        "fullAddress": {
          "description": "The complete address written as a string. https://semiceu.github.io/Core-Person-Vocabulary/releases/2.1.0/",
          "type": "string"
        }
      }
    }
  }
}

Installation

# with npm
npm add @cef-ebsi/vcdm1.1-vid-natural-person-schema@1.3.0

# with Yarn
yarn add @cef-ebsi/vcdm1.1-vid-natural-person-schema@1.3.0

# with pnpm
pnpm add @cef-ebsi/vcdm1.1-vid-natural-person-schema@1.3.0

Usage

The package exports the schema and its metadata as JavaScript objects:

import { schema, metadata } from "@cef-ebsi/vcdm1.1-vid-natural-person-schema";

// you can now use the schema and metadata

In addition, the package exports a TypeScript type corresponding to the schema:

import type { PIDAsW3CVCVCDM11 } from "@cef-ebsi/vcdm1.1-vid-natural-person-schema";

License

Copyright (c) 2019 European Commission Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in compliance with the Licence. You may obtain a copy of the Licence at:

Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the Licence for the specific language governing permissions and limitations under the Licence.

Readme

Keywords

none

Package Sidebar

Install

npm i @cef-ebsi/vcdm1.1-vid-natural-person-schema

Weekly Downloads

16

Version

1.3.0

License

EUPL-1.2

Unpacked Size

94.2 kB

Total Files

8

Last publish

Collaborators

  • iamtxena
  • yhuard
  • joticajulian
  • zgorizzo
  • maurolucc