- From: Ashley Harwood <ashley.harwood@gosource.com.au>
- Date: Mon, 13 Nov 2023 11:24:48 +1100
- To: public-credentials@w3.org
- Message-ID: <CAMJ6LWFRxStp9QdTLpBL20GbL8zVaSbq3=_D=iVeEsooRRQMsw@mail.gmail.com>
Hello everyone, I'm seeking advice on the proper way to specify a type for the subject in a verifiable credential with the use of context. My understanding was that typing a Verifiable Credential as follows: "type": [ "VerifiableCredential", "Employee" ] and then defining a context like this: { "@context": { "@version": 1.1, "@protected": true, "Employee": { "@id": "https://example.com#Employee", "@context": { "name": "xsd:string" } } } } followed by constructing the credential in this manner: { "type": [ "VerifiableCredential", "Employee" ], "@context": [ "https://www.w3.org/2018/credentials/v1", "https://example.com/employee.jsonld" ], "credentialSubject": { "id": "{{EMPLOYEE_DID_WEB}}", "name": "Ashley" } //... } would establish the necessary context for the credential subject. However, I encounter errors indicating that the "name" is not defined in the context. I know that using: "@vocab": "https://www.w3.org/ns/credentials/issuer-dependent#" acts as a universal solution for undefined terms, yet it compromises validation during credential creation. I'm also aware that defining terms "inline" like this: { "@context": [ { "@version": 1.1 }, "https://www.w3.org/ns/odrl.jsonld", { "name": "xsd:string" } ] } works but appears to go against the grain of JSON-LD's intent and disrupts the link between the credentialSubject and 'Employee' definition. Am I overlooking an aspect of this process? Many Thanks, Ashley -- --- The content of this email and attachments are considered confidential. If you are not the intended recipient, please delete the email and any copies, and notify the sender immediately. The information in this email must only be used, reproduced, copied, or disclosed for the purposes for which it was supplied.
Received on Monday, 13 November 2023 00:25:19 UTC