diff --git a/cert_schema/jsonld_helpers.py b/cert_schema/jsonld_helpers.py index 7aadb51..afcb26c 100644 --- a/cert_schema/jsonld_helpers.py +++ b/cert_schema/jsonld_helpers.py @@ -71,6 +71,7 @@ JSON_LD_CONTEXT_V3_0 = os.path.join(BASE_DIR, '3.0/context.json') JSON_LD_CONTEXT_V3_1 = os.path.join(BASE_DIR, '3.1/context.json') +JSON_LD_CONTEXT_V3_2 = os.path.join(BASE_DIR, '3.2/context.json') MERKLE_PROOF_2019_LD_CONTEXT = os.path.join(BASE_DIR, '3.1/merkleProof2019Context.json') CHAINED_PROOF_2021_LD_CONTEXT = os.path.join(BASE_DIR, '3.1/chainedProof2021Context.json') STATUS_LIST_2021_LD_CONTEXT = os.path.join(BASE_DIR, '3.1/statusList2021Context.json') @@ -151,6 +152,12 @@ PRELOADED_CONTEXTS[ContextUrlsInstance.v3_1_canonical()] = bc_context PRELOADED_CONTEXTS[ContextUrlsInstance.v3_1_blockcerts_org()] = bc_context +with open(JSON_LD_CONTEXT_V3_2) as data_file: + bc_context = json.load(data_file) + PRELOADED_CONTEXTS[ContextUrlsInstance.v3_2()] = bc_context + PRELOADED_CONTEXTS[ContextUrlsInstance.v3_2_canonical()] = bc_context + PRELOADED_CONTEXTS[ContextUrlsInstance.v3_2_blockcerts_org()] = bc_context + def to_loader_response(data, url): return { 'contextUrl': None, diff --git a/npm/preloadedContexts.mjs b/npm/preloadedContexts.mjs index decd4fe..ec78ea2 100644 --- a/npm/preloadedContexts.mjs +++ b/npm/preloadedContexts.mjs @@ -8,6 +8,7 @@ import V2_CONTEXT from './schemas/2.0/context.json' assert { type: 'json' }; import V2_1_CONTEXT from './schemas/2.1/context.json' assert { type: 'json' }; import V3_CONTEXT from './schemas/3.0/context.json' assert { type: 'json' }; import V3_1_CONTEXT from './schemas/3.1/context.json' assert { type: 'json' }; +import V3_2_CONTEXT from './schemas/3.2/context.json' assert { type: 'json' }; import MERKLE_PROOF_2019_CONTEXT from './schemas/3.1/merkleProof2019Context.json' assert { type: 'json' }; import CHAINED_PROOF_2021_CONTEXT from './schemas/3.1/chainedProof2021Context.json' assert { type: 'json' }; import STATUS_LIST_2021_CONTEXT from './schemas/3.1/statusList2021Context.json' assert { type: 'json' }; @@ -36,6 +37,11 @@ preloadedContexts[CONTEXT_URLS.BLOCKCERTS_V3_CANONICAL_CONTEXT] = V3_CONTEXT; preloadedContexts[CONTEXT_URLS.BLOCKCERTS_V3_1_CONTEXT] = V3_1_CONTEXT; preloadedContexts[CONTEXT_URLS.BLOCKCERTS_ORG_V3_1_CONTEXT] = V3_1_CONTEXT; preloadedContexts[CONTEXT_URLS.BLOCKCERTS_V3_1_CANONICAL_CONTEXT] = V3_1_CONTEXT; + +preloadedContexts[CONTEXT_URLS.BLOCKCERTS_V3_2_CONTEXT] = V3_2_CONTEXT; +preloadedContexts[CONTEXT_URLS.BLOCKCERTS_ORG_V3_2_CONTEXT] = V3_2_CONTEXT; +preloadedContexts[CONTEXT_URLS.BLOCKCERTS_V3_2_CANONICAL_CONTEXT] = V3_2_CONTEXT; + preloadedContexts[CONTEXT_URLS.MERKLE_PROOF_2019_CONTEXT] = MERKLE_PROOF_2019_CONTEXT; preloadedContexts[CONTEXT_URLS.CHAINED_PROOF_2021_CONTEXT] = CHAINED_PROOF_2021_CONTEXT; preloadedContexts[CONTEXT_URLS.STATUS_LIST_2021_CONTEXT] = STATUS_LIST_2021_CONTEXT;