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

Clarification of example @context #71

Closed
robdefeo opened this issue May 13, 2024 · 3 comments
Closed

Clarification of example @context #71

robdefeo opened this issue May 13, 2024 · 3 comments

Comments

@robdefeo
Copy link

From the readme, there is this section.

Implementations are expected to not error when any of the following context
files are used in a verifiable credential or a verifiable presentation:

However based on the test cases this is inconsistent, e.g. https://github.com/w3c/vc-data-model-2.0-test-suite/blob/main/tests/input/credential-type-unmapped-fail.json is

{
  "@context": [
    "https://www.w3.org/ns/credentials/v2"
  ],
  "type": [
    "VerifiableCredential",
    "ExampleTestCredential"
  ],
  "issuer": "did:example:issuer",
  "credentialSubject": {
    "id": "did:example:subject"
  }
}

Since it contains https://www.w3.org/ns/credentials/v2 the statement

Implementations are expected to not error when any of the following context files are used in a verifiable credential or a verifiable presentation:

This statement is incorrect based on the word any. What is the correct statement/implementation:

  • any should be replaced with both
  • or https://www.w3.org/ns/credentials/v2 should be removed from the list
@BigBlueHat
Copy link
Member

@robdefeo I think the current spec text is more clarifying: https://w3c.github.io/vc-data-model/#dfn-context

The value of the @context property MUST be an ordered set where the first item is a URL with the value https://www.w3.org/ns/credentials/v2.

That said, it does look like that test fixture had been incorrect. Things in the test suite have moved forward since then as well and that test file now contains content that should cause a failure.

Thanks for reporting the bug! Please keep them coming! 😃

@BigBlueHat
Copy link
Member

Ah, also, it looks like https://github.com/w3c/vc-data-model-2.0-test-suite/blob/main/tests/input/credential-type-unmapped-fail.json was specifically for testing unmapped types and has a value in the type field that was not listed in the context.

The updated fixture now further prevents confusion by clearing out the @vocab value--which is likely being removed from the VCDMv2 context since it continues to cause confusion.

@robdefeo
Copy link
Author

Thanks @BigBlueHat this helps a lot

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

2 participants