w3c / vc-data-model

W3C Verifiable Credentials v2.0 Specification
https://w3c.github.io/vc-data-model/
Other
299 stars 106 forks source link

Support of SHACL Schema in Version 2.0 #1419

Closed brentzundel closed 9 months ago

brentzundel commented 10 months ago

Discussed in https://github.com/w3c/vc-data-model/discussions/1411

Originally posted by **bmaier** January 8, 2024 We recognized with Draft Version 2.0 a better support for JSON Schema, which makes it easier to validate the claims in some cases. However, we (e.g., see GAIA-X) have more complex structures and semantics to validate that cannot be expressed with JSON-Schema. This is the reason why many prefer using the more intuitive SHACL for more complex uses instead of the JSON-Schema standard. SHACL can express more complex validation rules, such as requiring that a person's name starts with a capital letter when the issuer's country is the European Union (EU). The issue/proposal is to add support for the schema type ShaclSchema alongside the existing JsonSchema type. The non-normative samples should demonstrate the possibility to use both, as shown in the following example: ```json "credentialSchema": [{ "id": "https://example.org/examples/degree.json", "type": "JsonSchema" }, { "id": "https://example.org/examples/alumni.json", "type": "ShaclSchema" }] ``` This also requires enhancements to the [context](https://www.w3.org/ns/credentials/v2) and [description](https://www.w3.org/2018/credentials/#JsonSchema) ```json "JsonSchemaCredential": "https://w3.org/2018/credentials#JsonSchemaCredential", "ShaclSchema": { "@id": "https://w3.org/2018/credentials#ShaclSchema", "@context": { "@protected": true, "id": "@id", "type": "@type", "shaclSchema": { "@id": "https://w3.org/2018/credentials#shaclSchema", "@type": "@json" } } }, ````
iherman commented 10 months ago

Apologies for being formal at this point, but it is also my role with my staff contact's hat on...

The discussions and the issues in https://github.com/w3c/vc-data-model/pull/1416#issuecomment-1910762439 and in https://github.com/w3c/vc-data-model/pull/1416#issuecomment-1911721713 show that such a support is far from technically obvious, and would require a normative addition to the specification. However, the VCDM model has just been approved to move to Candidate Recommendation on the 1st of February, and the VC JSON Schema spec is already in Candidate Recommendation phase. This means we are now in a feature freeze state, and the WG should not consider adding new normative features.

I am not against continuing the discussion, but we should raise the 'future' flag for this issue, as well as for #1416 and #1411.

@brentzundel

iherman commented 9 months ago

The issue was discussed in a meeting on 2024-01-31

View the transcript #### 2.3. Support of SHACL Schema in Version 2.0 (issue vc-data-model#1419) _See github issue [vc-data-model#1419](https://github.com/w3c/vc-data-model/issues/1419)._ **Brent Zundel:** We already had a conversation about this one through the PR that was raised, this is the SHACL one. At this point, it seems likely we'll just label this future but we should allow the conversation to come to completion on the PR before making that designation here. … Happy to take comments if folks have them, otherwise moving on.
iherman commented 9 months ago

I think this issue should be closed. @brentzundel ?

brentzundel commented 9 months ago

The related PR has been closed. Closing this issue as consensus to make these changes was not found.