vc-data-model icon indicating copy to clipboard operation
vc-data-model copied to clipboard

issue in the example EXAMPLE 4: Usage of the id property

Open SamerW opened this issue 3 years ago • 1 comments

Hi, I think that there is an error in the example 4 about the type of the degree mentioned https://www.w3.org/TR/vc-data-model/. You are using "type" to indicate the type of the degree but "type" term is not defined in the context (https://www.w3.org/2018/credentials/examples/v1). What is defined in the context above is "degreeType". Here is how it should be and it is resolving correctly

{
 "@context": [
   "https://www.w3.org/2018/credentials/v1",
   "https://www.w3.org/2018/credentials/examples/v1"
 ],
 "id": "http://example.edu/credentials/3732",
 "type": ["VerifiableCredential", "UniversityDegreeCredential"],
 "issuer": "https://example.edu/issuers/565049",
 "issuanceDate": "2010-01-01T00:00:00Z",
 "credentialSubject": {
   "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
   "degree": {
     "degreeType": "BachelorDegree",
     "name": "Bachelor of Science and Arts"
   }
 }
}

the Expanded version

[
 {
   "https://www.w3.org/2018/credentials#credentialSubject": [
     {
       "https://example.org/examples#degree": [
         {
           "https://example.org/examples#degreeType": [
             {
               "@value": "BachelorDegree"
             }
           ],
           "http://schema.org/name": [
             {
               "@type": "http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",
               "@value": "Bachelor of Science and Arts"
             }
           ]
         }
       ],
       "@id": "did:example:ebfeb1f712ebc6f1c276e12ec21"
     }
   ],
   "@id": "http://example.edu/credentials/3732",
   "https://www.w3.org/2018/credentials#issuanceDate": [
     {
       "@type": "http://www.w3.org/2001/XMLSchema#dateTime",
       "@value": "2010-01-01T00:00:00Z"
     }
   ],
   "https://www.w3.org/2018/credentials#issuer": [
     {
       "@id": "https://example.edu/issuers/565049"
     }
   ],
   "@type": [
     "https://www.w3.org/2018/credentials#VerifiableCredential",
     "https://example.org/examples#UniversityDegreeCredential"
   ]
 }
]

SamerW avatar Aug 10 '22 14:08 SamerW

@SamerW -- Please edit your initial comment to put code fences around the JSON blocks (here, these should be lines that contain only three backticks, one above and one below each JSON block). This will both make what you've posted more readable (primarily by preserving whitespace), and stop the unwrapped @type, @id, @value, and @context from pinging those GitHub users on every update to this issue...

TallTed avatar Aug 10 '22 14:08 TallTed

You are using "type" to indicate the type of the degree but "type" term is not defined in the context (https://www.w3.org/2018/credentials/examples/v1).

The type term is defined in the first @context here: https://www.w3.org/2018/credentials/v1

The example states that the Verifiable Credential is a UniversityDegreeCredential and that the degreeType of that UniversityDegreeCredential is a BachelorDegree.

AFAICT, the example is correct and well-formed. Please re-open the issue if you disagree.

msporny avatar Dec 14 '22 19:12 msporny