Support of domain specific types in verifiable presentation
Describe the Bug
This is no issue yet but I want to open a discussion and I am looking forward to hear what you think about it.
My main question is: how to get a compliance credential for a domain specific service offering that inherits from "ServiceOffering"?
It is not a problem to define the @type field as a gx:ServiceOffering and add some additional domain specific attributes. I will get a compliance credential easily. But this approach has the disadvantage that I cannot perform a validation of the claims against a domain specific shape in the GXFS federated catalogue.
My thought was then: If I add the domain specific type to the array of @type in the claims-part then GAIA-X compliance is still given since a gx:ServiceOffering is also present as a @type.
Example: My claims inside the credentialSubject look like following:
"credentialSubject": {
"@context": {
"surveyonto": "http://semanticweb.org/metadatasurveyontology/"
},
"@type": [
"surveyonto:SurveyResultDataOffering",
"gx:ServiceOffering"
],
"gx:providedBy": {
"id": "did:web:wizard.lab.gaia-x.eu:api:credentials:2d37wbGvQzbAQ84yRouh2m2vBKkN8s5AfH9Q75HZRCUQmJW7yAVSNKzjJj6gcjE2mDNDUHCichXWdMH3S2c8AaDLm3kXmf5R8DRMPbLR68sddw7QrWg3ZN5YDga144j65ZQm64gqYn4mtt9WFJNH1HGEdHXgpxYp9RxyPkqJyVkFqCfnHZBWxabawqeSFz5e7L16tb3RQivEycpmj7Ubp8STAjxfk55uaZu6dyyFsWJGBQiD3fNs2mwqRarFx1WSuohRmGLXwVRmcfz8W6psAJuWw19qmgWscFwbKS1LU3NfmGh25dc3xrshhWzo5fbswaumLA9UokKVdYQo7xCYJYqcpjCuzFZq3YG8cajAc1KvxUXoKuPmDTsF5eb3WHUDSQpY2nrHXdHgkCSihaqUUH3eJPpZ7rQDSKM3SRFDqFWbbjHDRQfVfwc15izT6h5jdNXEy1AwmnWDnqqTCiwKyPnzJBBoA7x9rdQbZqEqPFixg3xstH1yHYxHBjhgjbjXjzyCjcqygtRr7HWvjm3PkBBWkJvpNs8R8CaTAvyLEKLDNK76itMRgdRjQ1yoTBVXwWEoMdV5qUQ5j1WZcBs1T9itSYGc1JwB5dGbUf6#62215be4566e37213d6e1b4ac299dd7b27fa8b10eb08fba876cf901d5790cb2a"
},
"gx:policy": "",
"gx:termsAndConditions": {
"gx:URL": "http://termsandconds.com",
"gx:hash": "d8402a23de560f5ab34b22d1a142feb9e13b3143"
},
"gx:dataAccountExport": {
"gx:requestType": "API",
"gx:accessType": "digital",
"gx:formatType": "application/json"
},
"surveyonto:survey_start_time": {
"@value": "2023-09-28T12:16:17",
"@type": "xsd:dateTime"
},
"id": ""
}
Note that I added
"surveyonto:SurveyResultDataOffering"
into the list of types as well as an additional property "survey_start_time".
Currently I get the error message: "VerifiableCrdential contains a shape that is not defined in registry shapes" (typo can be fixed in VerifiableCrdential occasionally).
Expected Behavior
Since there is also a @type "gx:ServiceOffering" I would expect that these claims are GAIA-X compliant since all mandatory attributes are set. Thus I would expect that I would get a compliance credential.
As already stated: If I remove the "SurveyResultDataOffering" from the list of types and only gx:ServiceOffering remains I would get the compliance credential even if there is the additional attribute "survey_start_time".
Observed Behavior
Error message "VerifiableCrdential contains a shape that is not defined in registry shapes"
When looking into the code I can see that all given types must match on of the types defined in the trust framework (method shouldCredentialBeValidated
https://gitlab.com/gaia-x/lab/compliance/gx-compliance/-/blame/development/src/common/services/shacl.service.ts#L131)
Steps to Reproduce or Payload
see payload above. This one produced the error message mentioned.
Context Information
-
Detailed Description
-
Possible Solution(s)
If I am not completely wrong with my expected behavior the solution could be:
Change the logic from: "All types need to be of one types defined by the trust framework" to: "At least one type needs to be one of the types defined by the trust framework".
Thanks for your opinions.