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
Remove reliance on external URL by allowing primary context to be a JSON Object #549
Comments
That change would require JSON-LD processing for all processor classes (a normative change which we're trying to avoid right now), and it would result in less consensus on the spec (and most likely a larger number of formal objections when we try to transition)... because it will force everyone to use a JSON-LD processor. Note that the specification currently states:
It also states:
We also have these PRs pending that clarify this further in the spec: As the spec is currently written, there is no requirement to dereference/fetch the URLs. It is also recommended that you cache the contents of the contexts you care about and load them from disk/memory. I believe that doing so would address all of the issues you raised above. Given the language above, and that at least one of the PRs above being merged, it would require no further changes to the specification. Does that work for you, @yancyribbens? |
Not necessarily. If we specify the exact character string of the JSON object that should be used for the inline context, that's equivalent to specifying the URL so no additional processing of the context would be required, right? This would give implementations which object to leaning on the w3.org URL for any reason a possibility to include the context in a way that JSON-LD processors would still understand, and JSON implementations could still string-match on as before. And it makes it consistent with the fact that other (non VC core) contexts can be included inline as objects too. On a related note - especially since we're telling people they don't have to fetch the context and should cache it - should we have a copy of the context in an appendix in the spec anyway? Then nobody ever has to fetch the context URL even once, if they don't want to. (Happy to make a PR for this if so.) |
My primary objective is to see if
If the context is provided inline, then implementors have a stronger way of knowing the Something I don't know is if
+1 to adding a copy of the context in the appendix. We could also include a hash of the context in the spec to assert the context is in a certain byte order and hasn't been changed. I understand not wanting to introduce any normative changes, and I'm not proposing this as a blocker necessarily, however, if a second CR is needed this is still a change that would add value. |
Just make an in-memory map in your consuming software that maps the string to the full context. Once the spec reaches REC it won't change (but we can expect some tweaks during CR based on implementation feedback). There's no reason for you to ever retrieve it (not even once). Just hard-code all contexts from the spec and you're done. |
Where "etc" is security/v1 which relies on Dublin Core, which relies on ..? |
@dlongley I think part of the problem here is that the contexts are not in the spec.. |
@dlongley I agree that may be the best way, however, I thought we could reduce the cognitive burden of requiring caching at the software level by instead providing the context inline or at least, in the spec. |
+1 for eventually having an appendix with the contexts in the spec, keeping in mind
|
@dlongley including all the nested contexts, down to Dublin Core and whatever that points to? |
There is no use of a dublin core context. There are presently only three contexts: security/v1, security/v2, and credentials/v1. The security/v1 context only references the dublin core vocabulary in term mappings, it does not include another context for it. |
Do I understand this thread to be saying not only that there are now only three contexts, but that is all there ever will be ("Just hard-code all contexts from the spec and you're done")? I think that clearly stating this at the points where That is, requiring JWT users to choose between 3 specific URIs (and the immutable content to which they dereference, which is also visible in an appendix to the spec) for |
@TallTed wrote:
No, that is not correct. There will always be the base context (which is an amalgamation of 3 different contexts credentials/v1, security/v1, and security/v2) plus one or more application / market vertical-specific contexts. |
@yancyribbens wrote:
We should not provide the context inline (as an object associated with @context) for at least two reasons:
Based on these two reasons, -1 to inlining the context as an object.
We could do this, but I think what I'd rather do is:
If we do that, developers can Would that address your concern, @yancyribbens? |
From VCWG call on April 30, 2019: |
@stonematt did you mean "non-normative" instead of "non-substantive"? |
No, we meant "non-substantive". :) We are changing normative things in the spec (and around the spec, like flattening the context) in ways that some might thing will affect implementations, but will in fact not do that. So, some would argue that we are making changes to normative sections of the specification, but in ways that will not change what implementers have to do. In these cases, we refer to those changes as "non-substantive". Hope that helps explain the particular word choice in the RESOLUTION. |
PR has been created here #587 |
@yancyribbens I think this is complete. Can you confirm? If so, please just go ahead and close. |
Working with examples in the test-suit has presented continuous problems, either resolving URIs that should be functional (down at time of writing), specifying the correct content type, and test-suit examples that aren't hosted.
From the spec:
The value of the @context property MUST be an ordered set where the first item is a URI with the value https://www.w3.org/2018/credentials/v1
If we allow inline context in the spec, the test-suite examples could also be modified to inline context, offering a simple way to present cached content to ease the burden on implementors during CR and later implementations.
The text was updated successfully, but these errors were encountered: