Coder Social home page Coder Social logo

Bug in the context file? about vc-data-model HOT 7 CLOSED

iherman avatar iherman commented on July 19, 2024
Bug in the context file?

from vc-data-model.

Comments (7)

BigBlueHat avatar BigBlueHat commented on July 19, 2024

@iherman fwiw, @gkellogg's Distiller creates these n-quads from the same JSON-LD...so there may indeed be a bug in the playground.

Here are the n-quads from the Distiller--which match what you were after:

_:g524580 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.w3.org/2018/credentials#VerifiablePresentation> .
_:g524580 <https://www.w3.org/2018/credentials#verifiableCredential> _:g524600 .
<http://university.example/credentials/1872> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.w3.org/2018/credentials#VerifiableCredential> _:g524600 .
<http://university.example/credentials/1872> <https://www.w3.org/2018/credentials#issuer> <https://university.example/issuers/565049> _:g524600 .

I'll do some more direct testing with jsonld.js (which is used on the Playground), and see how deep the rabbit hole goes. @davidlehn may have other thoughts.

from vc-data-model.

iherman avatar iherman commented on July 19, 2024

@iherman fwiw, @gkellogg's Distiller creates these n-quads from the same JSON-LD...so there may indeed be a bug in the playground.

Here are the n-quads from the Distiller--which match what you were after:

_:g524580 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.w3.org/2018/credentials#VerifiablePresentation> .
_:g524580 <https://www.w3.org/2018/credentials#verifiableCredential> _:g524600 .
<http://university.example/credentials/1872> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.w3.org/2018/credentials#VerifiableCredential> _:g524600 .
<http://university.example/credentials/1872> <https://www.w3.org/2018/credentials#issuer> <https://university.example/issuers/565049> _:g524600 .

I'll do some more direct testing with jsonld.js (which is used on the Playground), and see how deep the rabbit hole goes. @davidlehn may have other thoughts.

Phew. From the point of view of VCDM I am relieved (and also from the point of view of my own understanding...).

@msporny @brentzundel I am not sure whether we want to close this issue (being irrelevant for the VCDM spec) or leave it open until is handled, to avoid errors in discussions like in #1358 (comment) or #1358 (comment). I leave this decision to you. In any case, I removed the before-CR label.

from vc-data-model.

gkellogg avatar gkellogg commented on July 19, 2024

I suspect it's a bug in handling scoped context in jsonld.js. Looking at the credentials/v2 context definition:

  • VerifiablePresentation is a term which is used as a type in the outermost object, thus the type-scoped context it defines is used for expanding the rest of that object, which includes the term definition for verifiableCredential
  • verfiableCredential which is in scope has a @container: @graph, meaning that its value is taken to be a named graph, which at least in my implementation, gets a blank node graph label. It also sets @context: null, but establishes a new @context which is used to expand the values of that graph object.

For some reason, jsonld.js does not seem to interpret the value of verifiableCredential as being a blank graph. I would have thought that some test would catch this case, though.

from vc-data-model.

pchampin avatar pchampin commented on July 19, 2024

FWIW, Sophia, which is based on @timothee-haudebourg's JSON-LD library, also parses this correctly: example.

from vc-data-model.

davidlehn avatar davidlehn commented on July 19, 2024

There was missing JSON-LD test coverage for this use case and a jsonld.js bug. A JSON-LD test suite test was submitted, jsonld.js patched, and the json-ld.org playground was updated. It should work as expected now.

from vc-data-model.

iherman avatar iherman commented on July 19, 2024

The issue was discussed in a meeting on 2023-12-06

  • no resolutions were taken
View the transcript

2.8. Bug in the context file? (issue vc-data-model#1373)

See github issue vc-data-model#1373.

Brent Zundel: I think this one is before CR.

Manu Sporny: It's before CR.

Dave Longley: +1 to before CR.

Orie Steele: I would like some elaboration to be in the minutes: could someone explain the essence of the bug?

Dave Longley: It's not that we have a bug in our context file. It's that we added terms to make v1 VCs compatible with v2 Verifiable Presentations.
… We needed to make sure that context files for v1 VCs didn't affect the context files for v2 VPs.
… Some implementations had bugs, some didn't.
… We should be able to resolve this by nullifying the context as part of these implementations.
… We don't need to do anything in this WG.

Orie Steele: Sounds like there is no bug in our context, and this issue should be closed. It also sounds like there are buggy JSON-LD processors, that produce inconsistencies, that cause credentials to not verify.

Dave Longley: Orie: It is a reasonable expectation for any software is that there will be bugs from time to time.

Orie Steele: the complicated the software, the more reasonable it is to expect bugs.

Dave Longley: Orie: sometimes! :) ... i would say that it's not a good idea to assume simple software is less likely to be buggy (as this may lead to more likely bugs in such software).

Manu Sporny: You're coming across as trolling, Orie. Please stop. You asked us to explain something. We did, and now you're expressing what comes across as mock surprise.

from vc-data-model.

iherman avatar iherman commented on July 19, 2024

The bug has indeed been handled and the example works as expected.

This means that the issue turned out not to be in our @context file, so there is no action for this WG.

from vc-data-model.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.