w3c / vc-data-model-2.0-test-suite

W3C Verifiable Credentials v2.0 test suite
https://w3c.github.io/vc-data-model-2.0-test-suite/
Other
9 stars 10 forks source link

Clarification of example @context #71

Closed robdefeo closed 4 days ago

robdefeo commented 2 months ago

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:

BigBlueHat commented 4 days ago

@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 commented 4 days ago

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.