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

Normalization options differ from pyld #480

Open
lemoustachiste opened this issue Apr 5, 2022 · 0 comments
Open

Normalization options differ from pyld #480

lemoustachiste opened this issue Apr 5, 2022 · 0 comments

Comments

@lemoustachiste
Copy link

lemoustachiste commented Apr 5, 2022

Hi,

I was facing another normalization issue today and I have found that with javascript we use jsonld.normalize with expandContext https://github.com/digitalbazaar/jsonld.js/blob/main/lib/jsonld.js#L536, while pyld does not offer the same option https://github.com/digitalbazaar/pyld/blob/master/lib/pyld/jsonld.py#L247.

We use pyld on the issuing side and jsonld.js on the verification side, so having different options for normalize yields a different result.

Given this context:

[
    "https://www.w3.org/2018/credentials/v1",
    {
      "Blockcerts": {
        "@id": "bc:Blockcerts",
        "@type": "@id"
      }
    },
    "https://w3id.org/blockcerts/v3"
],

With JS, I have this output:

<urn:uuid:41015b98-fc99-447c-b211-ef6782147fb3> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://w3id.org/blockcerts#Blockcerts> .

While with PY, I have this one:

<urn:uuid:41015b98-fc99-447c-b211-ef6782147fb3> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <bc:Blockcerts> .

So I can stop passing the expandContext option, but I'd like to understand the implication of doing so. And also, why this option is not available in Python?

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