-
Notifications
You must be signed in to change notification settings - Fork 116
Schema vs @context #474
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
Comments
As I understand it, they are already quite different as they're defined in the spec. The @context property defines a common vocabulary. E.g. this allows a VC to have the string The credentialSchema property defines a data schema, i.e. a schema that defines the structure of the data in the credential. The data schema would define the property names and acceptable value types one might expect to find in the credentialSubject section of the VC. E.g. If the VC should contain a I hope that clarifies things. |
@brentzundel The data model lived without the credentialSchema property until ZKP was added. The @context contained all the schema information that was necessary for extensibility and understanding the contents of a VC. |
I think you may be confusing @context with type. @context defines a common vocabulary for those who are willing to do some JSON-LD processing. In the spec, type has this statement:
I agree that type and credentialSchema are very similar. The difference between them (as far as I can tell) is that type MUST be present, and MUST be a URL, but that URL doesn't actually need to contain anything useful. Where credentialSchema MUST be one or more data schemas that provide verifiers with enough information to determine if the provided data conforms to the provided schema. Each credentialSchema MUST specify its type (for example, JsonSchemaValidator2018), and an id property that MUST be a URI identifying the schema file. So, tl;dr, the credentialSchema and type properties are very similar in what they may contain, but the type property doesn't actually need to contain anything, while the credentialSchema does. I still don't see any similarity between credentialSchema and @context. |
We certainly have quite a significant difference in understanding, so it is clear that clarification is needed to the standard if two people who are intimately involved in producing it have such differences in opinion (its a pity for those who are reading the standard for the first time :-). According to the specification, credentialSchema may define two different types of schemas: |
the type of the VC is defined in the type property
@context does not define properties. All @context defines is a vocabulary; it is a list of strings that can be used in place of longer strings. @msporny or @dlongley or @dmitrizagidulin please confirm this. credentialSchema defines the properties and value types that should be expected in the credential. This allows a credential to be automatically processed to see if the properties and values it contains match the properties and value types specified in the credentialSchema. |
@brentzundel Sorry, let me ask my question i) again, as I realise it was ambiguous. i) where is the type defined? |
There are a few ways of doing this. The type itself is a URL (when resolved via the mappings in
Note that the latter two mechanisms can include content integrity proofs via other technologies like hashlinks or DLT and can be implemented with caching/local copies as use cases demand. |
Thank you @dlongley for saying better what I was trying to. |
@dlongley Thankyou. Can you also answer this issue that I raised above "the @context must define all the basic properties that any VC may contain (such as terms of use, expiration date, ID, type etc.), along with their aliases, since @context has been in the specification from the start (way before credentialSchema was invented)." |
The |
@dlongley Thankyou yet again! If this is the case then it would be beneficial to add an explanatory note to the standard to explain the difference (which was the original purpose of me raising this issue). |
I think another benefit is that it provides an opportunity to annotate type definitions or "lock them" to specific versions of the vocabulary. Dereferencing type URLs, for instance, may give you a "live version" of the vocabulary. Depending on how stable and popular such a vocabulary is, authors of VCs may prefer to include a "static" version of their vocabulary via |
@David-Chadwick If that PR does not address your issue, please recommend some concrete changes to the data model that would address your issue so that this can be a more productive conversation. |
My objective is to make the CR understandable to implementors and to remove ambiguities and lack of clarity. So this is what we need in my opinion:
Then for the credentialSchema property
Finally we should provide examples of the more complex concepts e.g. if we say that credentialSchema restricts or makes immutable the definitions in @context, then provide an example of this. (I dont know how you make a definition immutable - a definition that changes is not really a definition is it?) |
+1 David.
I have stayed out of this discussion because it has been handled at a
supremely abstract level that keeps me out. David’s comment is not news but
is the first I’ve seen that I can react to.
My use cases for VC are a) physician credentials and reputation and b) a
prescription acceptable to a typical pharmacy.
I don’t expect the initial spec to solve the reputation issues in a) or the
trust issues in b) but I do hope the spec allows for these to evolve and
mature.
Please can we try harder to relate the abstract stuff to real-world
commercial use cases?
Adrian
On Tue, Apr 9, 2019 at 4:43 PM David Chadwick ***@***.***> wrote:
My objective is to make the CR understandable to implementors and to
remove ambiguities and lack of clarity. So this is what we need in my
opinion:
1. A clear definition of what the @context <https://github.com/context>
property is, what its values are, what its purpose is and how it must be
interpreted. (Surely it cannot be ignored).
This definition has to apply to both JSON processors and JSON-LD
processors, which may interpret it differently. So if it has different
purposes for the two processes, then the differences need to be spelt out
clearly and succinctly with no vague hand waving.
2. A explanation of what the implications of the @context
<https://github.com/context> is on other properties in a VC, such as
the type property (e.g. it allows aliases of URLs). This needs to be made
crystal clear for both JSON and JSON-LD processors.
3. If the @context <https://github.com/context> points to shifting
definitions, again this has to be made very clear in the spec.
4. How @context <https://github.com/context> aids extensibility and
interworking.
5. What the deficiencies in @context <https://github.com/context> are
(if there weren't any we would not need credentialSchema for specifying the
ontology)
Then for the credentialSchema property
1. what it provides in addition to the @context
<https://github.com/context> property
2. what are the implications for implementations that do not have a
credentialSchema property. This needs to cover those that use JSON
processors as well as JSON-LD processors.
Finally we should provide examples of the more complex concepts e.g. if we
say that credentialSchema restricts or makes immutable the definitions in
@context <https://github.com/context>, then provide an example of this.
(I dont know how you make a definition immutable - a definition that
changes is not really a definition is it?)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#474 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAIeYfuTocLBqmbuYD1BKHGfV8kD2Xjeks5vfPtdgaJpZM4cL7iw>
.
--
Adrian Gropper MD
PROTECT YOUR FUTURE - RESTORE Health Privacy!
HELP us fight for the right to control personal health data.
DONATE: https://patientprivacyrights.org/donate-3/
|
I believe PR #535 does this: https://github.com/w3c/vc-data-model/pull/535/files
Fine with me. Which section should we put this clarification in?
What is your definition of "shifting definitions"? My concern here is that we're going to duplicate large sections of the JSON-LD specification, would pointing to the JSON-LD specification help? Every time we've done that in the past, we've gotten a raft of "I shouldn't have to read the JSON-LD specification" comments in and have duplicated text to avoid those sorts of issues raised against the specification.
Is this not what this section does? https://w3c.github.io/vc-data-model/#contexts Would pointing to this section of the JSON-LD specification work for you? https://www.w3.org/TR/json-ld/#the-context If doing that doesn't accomplish what you want, what concrete specification text could we add to address your concerns?
I'm fine with doing this. Please suggest some concrete specification text.
This is covered in https://w3c.github.io/vc-data-model/#content-integrity-protection -- would linking to that section address your concerns? If not, what concrete text could we add and to what section to address your concerns? |
From VCWG call on April 30, 2019: |
PR approved 7 days ago, merged 3 days ago. Closing. |
We now have two ways of saying which schema defines the properties in a VC and VP: the credentialSchema property and the @context property. It is not clear to me which should be used when. I think we need to add some clarification text to the CR to either give an indication of which property should be used to define which schema items in a VC, or to say there are no rules and it does not matter which is used, and the verifier must check both properties in order to collect the full set of schema definitions.
I note that @contexts can be nested in JSON LD. Is this also true for credentialSchema properties? Or is this one of their differences?
The text was updated successfully, but these errors were encountered: