Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump rdf-urdna dependency to 1.3 #142

Open
andresrosenthal opened this issue Apr 19, 2024 · 0 comments
Open

Bump rdf-urdna dependency to 1.3 #142

andresrosenthal opened this issue Apr 19, 2024 · 0 comments

Comments

@andresrosenthal
Copy link

andresrosenthal commented Apr 19, 2024

Given JSON-LD document:

{
  "@context": [
    "https://www.w3.org/2018/credentials/v1",
    "https://w3id.org/security/suites/jws-2020/v1",
    "https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#"
  ],
  "type": [
    "VerifiableCredential"
  ],
  "id": "https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json",
  "issuer": "did:web:xroad-8-member1.s3.eu-west-1.amazonaws.com",
  "issuanceDate": "2024-02-15T14:20:56.969Z",
  "credentialSubject": {
    "gx:legalName": "NIIS",
    "gx:headquarterAddress": {
      "gx:countrySubdivisionCode": "EE-37"
    },
    "gx:legalRegistrationNumber": {
      "id": "https://xroad-8-member1.s3.eu-west-1.amazonaws.com/lrn.json#cs"
    },
    "gx:legalAddress": {
      "gx:countrySubdivisionCode": "EE-37"
    },
    "type": "gx:LegalParticipant",
    "gx-terms-and-conditions:gaiaxTermsAndConditions": "70c1d713215f95191a11d38fe2341faed27d19e083917bc8732ca4fea4976700",
    "id": "https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json#cs"
  }
}

With rdf-urdna 1.1 the RDF normalization results in:

<https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json#cs> <gx-terms-and-conditions:gaiaxTermsAndConditions> "70c1d713215f95191a11d38fe2341faed27d19e083917bc8732ca4fea4976700" .
<https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json#cs> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#LegalParticipant> .
<https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json#cs> <https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#headquarterAddress> _:c14n0 .
<https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json#cs> <https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#legalAddress> _:c14n1 .
<https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json#cs> <https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#legalName> "NIIS" .
<https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json#cs> <https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#legalRegistrationNumber> <https://xroad-8-member1.s3.eu-west-1.amazonaws.com/lrn.json#cs> .
<https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.w3.org/2018/credentials#VerifiableCredential> .
<https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json> <https://www.w3.org/2018/credentials#credentialSubject> <https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json#cs> .
<https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json> <https://www.w3.org/2018/credentials#issuanceDate> "2024-02-15T14:20:56.969Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
<https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json> <https://www.w3.org/2018/credentials#issuer> <did:web:xroad-8-member1.s3.eu-west-1.amazonaws.com> .
_:c14n0 <https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#countrySubdivisionCode> "EE-37" .
_:c14n1 <https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#countrySubdivisionCode> "EE-37" .

While with 1.3 the normalization results in (as expected):

<https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json#cs> <gx-terms-and-conditions:gaiaxTermsAndConditions> "70c1d713215f95191a11d38fe2341faed27d19e083917bc8732ca4fea4976700" .
<https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json#cs> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#LegalParticipant> .
<https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json#cs> <https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#headquarterAddress> _:c14n1 .
<https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json#cs> <https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#legalAddress> _:c14n0 .
<https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json#cs> <https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#legalName> "NIIS" .
<https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json#cs> <https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#legalRegistrationNumber> <https://xroad-8-member1.s3.eu-west-1.amazonaws.com/lrn.json#cs> .
<https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.w3.org/2018/credentials#VerifiableCredential> .
<https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json> <https://www.w3.org/2018/credentials#credentialSubject> <https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json#cs> .
<https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json> <https://www.w3.org/2018/credentials#issuanceDate> "2024-02-15T14:20:56.969Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
<https://xroad-8-member1.s3.eu-west-1.amazonaws.com/participant.json> <https://www.w3.org/2018/credentials#issuer> <did:web:xroad-8-member1.s3.eu-west-1.amazonaws.com> .
_:c14n0 <https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#countrySubdivisionCode> "EE-37" .
_:c14n1 <https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#countrySubdivisionCode> "EE-37" .

Currently it causes failures when the mentioned JSON-LD document is turned into a Verifiable Credential with some other library & verified with this one (or the other way around), as the hash changes due to the inconsistent normalization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant