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

Add @vocab for private claims in /credentials/v2 @context #953

Closed
OR13 opened this issue Oct 19, 2022 · 65 comments
Closed

Add @vocab for private claims in /credentials/v2 @context #953

OR13 opened this issue Oct 19, 2022 · 65 comments
Assignees

Comments

@OR13
Copy link
Contributor

OR13 commented Oct 19, 2022

PROPOSAL: Add an @vocab to the /credentials/v2 @context.

Reasoning:

We (as editors of the did spec registries, and reviewers of various VC-JWT implementations) have seen a consistent failure to leverage @context properly in DID Core and Verifiable Credentials... due to the "term not defined in the context" issue.

The problem is not that "people don't want to define semantics"... its the opposite, they are eager to rely on semantics defined by the standards, but they don't know how to define new terms, or they don't want to take responsibility for hosting a vocabulary for their new terms as the first step in using or leveraging a new term... this is a barrier to adoption created by the W3C Working Groups, based on an argument for semantic purity... that has in my opinion, greatly harmed the adoption of semantic technologies and standards, including Decentralized Identifiers and Verifiable Credentials.

By adding @vocab to the core data model context, we can give these developers the same experience they have with JWT private claims, which you should read about here: rfc7519#section-4.3

If this proposal is adopted, developers will be allowed to do this:

{
  "@context": [
    // "https://www.w3.org/2018/credentials/v1",
    "https://www.w3.org/ns/credentials/v2",
    // "https://www.w3.org/2018/credentials/examples/v1"
    // { "@vocab": "https://www.w3.org/ns/credentials#" }
  ],
  "id": "http://example.edu/credentials/1872",
  "type": ["VerifiableCredential", "NewCredentialType"],
  "issuer": { 
    "id": "did:example:123", 
     "type": ["Organization", "OrganizationType"] 
   },
  "issuanceDate": "2010-01-01T19:23:24Z",
  "credentialSubject": {
    "id": "did:example:456", 
    "type": ["Person", "JobType"],
    "claimName": "claimValue"
  }
}

and claimName will get a default IRI, assigned by https://www.w3.org/ns/credentials/v2... something like:

https://www.w3.org/ns/credentials/#claimName.

https://www.w3.org/ns/credentials/claims/private#claimName

This will produce beautiful and valid JSON-LD, which can immediately be processed in an interoperable way, using SPARQL, RDF, or other semantic standards developed at W3C and elsewhere, including conversion to Cypher, GQL or Labeled Property Graphs (Automatically).

The issuer's of such credentials might later decide to refine term definitions for such credentials by either:

  1. inlining the new term definition
 { "claimName": { "@id": "https://industry.consortium.example/vocab#claimName" } }
  1. hosting a new context
https://industry.consortium.example/contexts/v1
{ "claimName": { "@id": "https://industry.consortium.example/vocab#claimName" } }

This allows for issuers to gradually improve their semantic precision over time, as they become more skilled and knowledgable about graph interoperability... Its been our experience this leads to better engagement, and better semantics in the long run.

The alternative to this proposal is the status quo, where we see a new DID Method registered every week, that fails to define JsonWebKey2020 or Ed25519VerificationKey2020 properly, but includes references to them and includes an @context that simply points at the did core v1 context.... These folks are only making a "mistake" because our working group chose not to take the same path I am proposing here when publishing https://www.w3.org/ns/did/v1.

We can see why people are assuming what they are doing is legal, we expect them to keep doing what they are doing... we can make what they are doing legal and interoperable, and useful.... why would we choose not to accept this proposal?... especially given that it does not block advanced context users from improving precision in the 2 ways mentioned above.

@OR13
Copy link
Contributor Author

OR13 commented Oct 19, 2022

Related issues:

In my opinion, accepting this proposal will obviate the need to adopt a number of more complicated and less elegant proposals that have been floated to the working group in the issues above, at TPAC, and on various other industry specific calls such as ones addressing Education, Finance or Supply Chain Specific verticals.

@selfissued
Copy link
Contributor

Orie's reasoning makes sense to me.

@dmitrizagidulin
Copy link
Contributor

👍 from me, I agree with this reasoning.

@mprorock
Copy link
Contributor

Very big fan of this!

@vongohren
Copy link

vongohren commented Oct 19, 2022

As a person still learning JSON-LD and have had its fights with it, all I can contribute with are questions.
First and foremost, the reasoning sounds valid, and for my questions:

What is the drawback of doing this?
Are there any other way of making things easier for developers to be strictly following the semantic world?
I have been tricked by vocab multiple times thinking my JSON-LD is valid, and I dont know if it is or not?
Should there be clear warning signs of what it means?
Should libraries provide warnings that one is depending on the vocab fallback mechanism?

I dont know, but I would love to hear this side as well to populate this issue with further opinions

@mkhraisha
Copy link

Big +1 from me.

@tplooker
Copy link

Strong support for this, for the reasons highlighted by @OR13

@David-Chadwick
Copy link
Contributor

One question to Orie. Say Issuer 1 in the UK creates a credential of the type you suggest, but uses a specific property of "value":"20" instead of "claimName":"claimValue". Then you in the US produce a similar credential with "value":"20", and someone in Japan does a similar thing. A verifier is likely to think that all of these VC are the same, whereas in fact each issuer, oblivious of the other ones, intended the value to be denominated in their national currency. Comments?

@gkellogg
Copy link
Member

gkellogg commented Oct 19, 2022

You might consider setting the default vocabulary to be document relative. Using the Document Base for the Default Vocabulary.

This has the advantage of not having two documents use equivalent term forms and have them be semantically confused with each other.

@decentralgabe
Copy link
Contributor

This seems to lower the barrier to 'compliant' LD, which I'm all in favor of!

My ignorance makes me wonder how is this any different than what is possible today? Couldn't the existing @context field be used to inline references? Or just adding an additional context URI that defines additional terms? Where in the spec is adding a @vocab prohibited?

@dlongley
Copy link
Contributor

why would we choose not to accept this proposal?

For the reasons stated over here:

#948 (comment)
#948 (comment)
#948 (comment)

There's a better solution -- which is to create another standard context anyone can use that includes @vocab that avoids the problems above and still provides the features that people want here.

@dlongley
Copy link
Contributor

See also this comment with more concrete proposals for how it would look.

@peacekeeper
Copy link
Contributor

Maybe we should consider a slight variation of this where we use @vocab only in scoped contexts inside some of the properties, not for the whole document. Specifically, for the values of credentialSubject and @type, since here we really expect everyone to come up with their own custom terms. Maybe also for issuer if that is an object where people use custom terms.

Outside of those, especially at the top level of the VC document, I'm not so sure if it's a good idea to allow undefined/ambiguous terms.

@bumblefudge
Copy link

bumblefudge commented Oct 20, 2022

Thanks again to @vongohren for putting forth questions to tease out the ergonomics of proposed solutions.

I have been tricked by vocab multiple times [into] thinking my JSON-LD is valid, and I dont know if it is or not?

This is a meta-question that I think deserves a separate tracking issue. Whatever functional solution is decided on by the group, the WG would do well to explain it thoroughly in non-normative text and implementation guidance, I would think! A good solution insufficiently documented might be a smaller (but still dangerous) footgun for interop.

Should there be clear warning signs of what it means?

One reason I like the "second developer context" approach (soon to be renamed***) is that anyone who sees it knows they're in the vocab zone wherever they do.

Should libraries provide warnings that one is depending on the vocab fallback mechanism?

Am I understanding correctly that the separate "developer context" (soon to be renamed***) would allow consuming parties to filter by type property? I.e., an implementer living in a JSON-only world and electing not to worrying themselves about LD interop could go to prod using the "lax interop" mode (i.e. the more permissive second @context file), and in so doing would be writing at the top of each credential "only parse in local/vocab mode".

*** = here are some funner names:

  • https://www.w3.org/credentials/implicit-properties-allowed/v1 (borrowing the x509 terminology david shared)
  • https://www.w3.org/credentials/closed-world-mode/v1 (i joke)
  • https://www.w3.org/credentials/private-terms/v1 (I think this is more precise than json-only because it's more like opting out of LD-based URL-anchored semantics than opting into exactly one form of private semantics)

@bumblefudge
Copy link

I also think Markus' suggestion of scoping laxity just to credentialSubject is an interesting one, although I wonder how many people are using undefined props outside of credSubj in the wild?).

Can anyone with LD experience speak to Gregg's suggestion (which might have gotten lost in the mix) of using Base to change how these credentials get graphed by LD parsers? I wasn't sure if Gregg was proposing it as a solution for the second context, or if the idea was to explain this option in non-normative text as a 3rd way of lowering the threshold for achieving valid LD.

@vongohren
Copy link

I support that we have to find a solution to giving some flexibility. But I also support the reasoning happening over here: #948.

+1 to Markus suggestion of limiting it to credential subject, unless you want to have a VC development sanbox to test out new ideas that are being created. Such as holderBinding or rendering or whatever was cooked together during RWoT 11 f.ex.

@David-Chadwick
Copy link
Contributor

@bumblefudge "although I wonder how many people are using undefined props outside of credSubj in the wild?"
The Open Badge 3 schema has several top level properties, which are defined, see
https://purl.imsglobal.org/spec/ob/v3p0/schema/json/ob_v3p0_achievementcredential_schema.json
But a less skilled developer might not define them properly

@dlongley
Copy link
Contributor

dlongley commented Oct 20, 2022

@peacekeeper,

Maybe we should consider a slight variation of this where we use @vocab only in scoped contexts inside some of the properties...

In my view, what we're trying to do here is give people an easy onramp to VCs where they don't have to absorb or understand everything all at once. So I think if we're going to give people (some who are struggling to create their own contexts) a common way to use @vocab, it would only add to their confusion when it only works on part of the VC. Therefore, I'm -1 to that idea.

@bumblefudge,

Can anyone with LD experience speak to #953 (comment) (which might have gotten lost in the mix) of using Base to change how these credentials get graphed by LD parsers?

I think it's an even more complex ask of the people we're trying to help. In order for it to work, different @base values need to be used per VC type (otherwise we don't get any benefit from the idea). So, that means people would need to include @base in their own contexts and come up with a unique @base value for each of their VC types that is different from other VC types in the world. I suspect people wouldn't know what to use for the @base value and we'd probably have to invent some pattern for them to use -- and, in the end, they wouldn't really understand why they were doing all that.

In short, I think the people we're trying to help by lowering the learning curve would be introduced to too many new concepts.


It's much easier to keep the concepts simple:

  1. VCs need term definitions.
  2. The core terms are defined in the core context and it appears in every VC.
  3. Everyone needs to add a second context that provides term definitions for the specific VC type.

Then we can say: "If you don't want to, aren't able to, or aren't ready to provide your own context, use this one: "URL X". It will indicate that your terms aren't globally defined and let you ease into defining them if and when you're ready."

In other words, the guidance for authoring a new VC type would be:

  1. Create your own context to unambiguously define your VC terms, OR
  2. Use the standard "not-global terms" context provided by the WG.
  3. When issuing the VC, add the core v2 context followed by the context you selected from step 1 or 2 to the @context field.

@msporny
Copy link
Member

msporny commented Oct 20, 2022

@OR13 wrote:

PROPOSAL: Add an @vocab to the /credentials/v2 @context.

-1 (a very strong one), because it disables all undefined term error reporting for everyone in production, whether they want it disabled or not. It doesn't give a choice to implementers that want these sorts of errors to be caught by common tooling. There are implementers, such as ourselves, that want the common tooling to report errors, so that we can provide a better experience for our production customers.

@vongohren wrote:

What is the drawback of doing this (@OR13's proposal)?

  1. It doesn't provide an option to opt-out of undefined properties. There is no "safe default" to say "I want every property to be defined by default."
  2. Everyone has to buy into "undefined properties by default". Verifiable Credentials in the financial services industry are one place where you don't want "undefined properties by default".
  3. It causes regular JSON-LD tooling to be unable to catch undefined properties and report errors in production.
  4. It pollutes the VC vocabulary with terms we might need to define in a future WG.
  5. It opens developers up to having what they thought were "private properties" being defined by the VCWG at some future point in time.
  6. It does not differentiate between the different uses of @vocab that have been identified. Namely, "undefined terms", "document-relative terms", "private terms", and "the default vocabulary is the VC vocabulary".

Let's review where it seems like we all agree:

  • We want a way for people to get started quickly with Verifiable Credentials without having to create a JSON-LD Context.
  • We want some subset of those people to eventually define their semantics carefully, knowing that there will be a subset that just won't want to do that and will ship undefined/local properties into production.
  • JSON-LD Context authors should be able to use @vocab as they see fit (because that's their problem domain)... though use of @vocab can be dangerous (as it has been suggested in this issue).

Based on that, I think that @bumblefudge's proposals seem to have the best chances of achieving consensus.

That is, this:

   "@context": ["https://www.w3.org/ns/credentials/v2", "<some-opt-in-private-claims-url>"]

really doesn't seem much more difficult than this:

   "@context": ["https://www.w3.org/ns/credentials/v2"]

Everyone should take heed that these discussions are not popularity contests. Technical concerns raised on any proposal will need to be addressed by the group. Technical concerns will need to be mitigated, or an alternative path chosen. At least five technical concerns have been raised on the "Add @vocab to /credentials/v2". A counter-proposal that doesn't suffer from those five technical issues has been put forward. What are the concrete technical concerns with that proposal?

@mfosterio
Copy link

mfosterio commented Oct 20, 2022

👍 I am for this, adding @vocab to the /credentials/v2 @context helps new comers create valid linked data by relying on the standards.

This will allow quicker adoption and prevent broken linked data. As certain developers learn more about the spec they can add more precise semantic purity as their knowledge and needs grow. This will help us broaden the community and create a larger Open Web Of Trust. 🔐☑️

@TallTed

This comment was marked as resolved.

@tplooker
Copy link

There's a better solution -- which is to create another standard context anyone can use that includes @vocab that avoids the problems above and still provides the features that people want here.

The problem is that this proposal requires developers to explicitly bring in a second context in order to use this default terms feature. I'm a -1 for it being a seperate context that has to resolved, managed and educated upon by the community, @vocab needs to be in the core v2 context.

-1 (a very strong one), because it disables all undefined term error reporting for everyone in production, whether they want it disabled or not. It doesn't give a choice to implementers that want these sorts of errors to be caught by common tooling. There are implementers, such as ourselves, that want the common tooling to report errors, so that we can provide a better experience for our production customers.

No it doesn't you could quite easily write an expansion map that

a) warns or errors on term expansion that is using @base or @vocab OR
b) warns or errors when the resulting term expansion is using a known IRI that is a fall like https://www.w3.org/credentials/undefinedTerm

@vongohren
Copy link

Based on that there are two camps here now.
Again im primarily here for questions.

Are there any middle ground?
Are there any good mental practices we can we do to get clarity?
Are there any parties that is being ignored now because we are just a bunch of developers?
Any future story that can be created showing the benefits, or the concerns?

This is a thing that is going into a spec we will have to live with for a long time

@dlongley
Copy link
Contributor

@tplooker,

The problem is that this proposal requires developers to explicitly bring in a second context in order to use this default terms feature. I'm a -1 for it being a seperate context that has to resolved, managed and educated upon by the community, @vocab needs to be in the core v2 context.

Having a pattern (which is already true today) that requires developers to bring in a second context to provide their VC-type-specific terms is consistent. I don't see it as harmful -- everyone needs to do this. The only question in v2, is whether the second context is the "undefined terms" context provided by the WG or a custom one provided (or otherwise selected) by the VC author. It's also a very easy framing for people to understand:

For the second context, create your own or choose X, provided by the WG.

This approach just builds on what we have already done in v1; the WG would just now be providing an "easy to use (but has ambiguity drawbacks)" second context for people to use.

No it doesn't you could quite easily write an expansion map that

You're referring to a specific implementation feature. Furthermore, it was removed from that implementation a while back in favor of a far simpler "safe" mode that throws on standard warnings from the JSON-LD spec instead (which was the "expansion map" feature's only use case). In other words, what was said earlier is true: standard tools do not support this and custom processing has to be implemented. It's much simpler for people to decide that their second context of choice is the "undefined terms context" instead of a custom one they provide -- and all the VC tooling can then be consistent and the choice can be easily detected.

@dlongley
Copy link
Contributor

@vongohren,

To answer your first question:

Are there any middle ground?

IMO, the two camps started with:

  1. No @vocab at all, semantic ambiguity is too dangerous / problematic.
  2. Defining and hosting your own context is too much of a lift for some developers, so put @vocab into the core context.

So, the middle ground is already what has been proposed above:

"Ok, let's allow semantic ambiguity for developers that don't want to / can't easily define and host their own @context, but don't force it on everyone. We can give them a second context from the WG, eliminating their need to define and host it entirely. They can use it in the same way (second context position) that they would have had to use their own context."

@David-Chadwick
Copy link
Contributor

@dlongley . I agree. The simplest solution is that every JSON-only implementor always includes just two @contexts in every VC they issue, and these are defined in the v2 standard, namely: the v2 standard context and the 'unregistered' context which contains the @vocab.

@melvincarvalho
Copy link

melvincarvalho commented Oct 21, 2022

@OR13 nice idea of how to use unregistered JSON terms in JSON-LD

but it gets messy for a few reasons

  • how do you catch terms which are errors?
  • it introduces an http vocab which might now play well with pure dweb systems
  • the http vocab might not contain the given term
  • if lots of specs use this pattern, we'll have lots of different base vocabs clashing
  • best practice document says to use the base of the document for this

Is there a solution to all of this? Possibly, but it would require some work and consensus.

  • Instead of having a base vocab at the VCDM level. Push it upstream to the JSON-LD (v.next) level. Then all specs that use JSON with JSON-LD can benefit

  • Instead of using a random http domain, use a decentralized name, or a urn, or something similar (would require consensus on what though something like urn:json: might work)

This could be done in stages. First rolled out in one child spec (this). Then promoted to best practices doc. Then suggestion promoted to full JSON-LD

There might be some flaws in this logic, but perhaps could be a compromise solution that allows JSON and JSON-LD to live happily every after. Or at least some food for thought in that direction.

If every spec of this kind chooses their own @vocab, I can picture some objections that are hard to clear up. But there might be some compromise solution that everyone can live with.

@nadalin
Copy link

nadalin commented Oct 22, 2022 via email

@gkellogg
Copy link
Member

@bumblefudge,

Can anyone with LD experience speak to #953 (comment) (which might have gotten lost in the mix) of using Base to change how these credentials get graphed by LD parsers?

I think it's an even more complex ask of the people we're trying to help. In order for it to work, different @base values need to be used per VC type (otherwise we don't get any benefit from the idea). So, that means people would need to include @base in their own contexts and come up with a unique @base value for each of their VC types that is different from other VC types in the world. I suspect people wouldn't know what to use for the @base value and we'd probably have to invent some pattern for them to use -- and, in the end, they wouldn't really understand why they were doing all that.

In short, I think the people we're trying to help by lowering the learning curve would be introduced to too many new concepts.

Yes, it making @vocab base-relative and there is no default document base, then it doesn't make sense. It's a useful paradigm when a document has a location which is used as the default document-base. @base has to be defined within the document, and not in a remote context, so it wouldn't make any sense to need to define @base just to get this feature.

@OR13:
The problem is that in a credential, the document base may not be defined, because id is optional... if id where required, your suggestion seems like a good one, assuming the syntax is possible.

Document base and @id are two different things, but if Credentials are passed around without a notion of their originating location (particularly, as would be used by a JSON-LD processor), this doesn't help either way.

The best solution you're left with is something that "carves out" a default vocabulary namespace for default terms, as has been suggested in other proposals. I'll go away now :)

@OR13
Copy link
Contributor Author

OR13 commented Oct 26, 2022

The best solution you're left with is something that "carves out" a default vocabulary namespace for default terms, as has been suggested in other proposals.

Yes, and despite my observations regarding "centralized registries" and WG consensus.

I think the W3C is already committed to doing this...

We are maintaining vocabulary and terms for the core data model, we have maintain a default vocabulary for unmapped terms as well...

And just to be clear, there is a big difference between allowing, and recommending unmapped terms and default vocabulary.

I'll go away now :)

Please don't! We desperately need your wisdom, but if it's overwhelming I am happy to shuttle content to you.

@jimschoening1
Copy link

Could emerging ontology standards provide standard (and logically consistent) terms and definitions (via a PURL server)?

These are being developed as a hierarchy as follows:

Top-Level Ontology: ISO/IEC-JTC1-21838-2 Basic Formal Ontology (see https://ncorwiki.buffalo.edu/index.php/BFO_2020) provides sturcture only (not useful terms), and is imported by a standard mid-level ontology.

Mid-Level Ontology: Common Core Ontology is a mid-level ontology being standardized via IEEE (which I chair), and also as open source at https://opensource.ieee.org/cco/CommonCoreOntologies (need to create free account to access).

Domain ontologies: We're standardizing just two to start with (Cyber Ontology and MyOntology), but many more standard domain ontologies will follow.

IEEE is also setting up a PURL server so terms can be found and pointed to, rather than defined in other ways.

@OR13
Copy link
Contributor Author

OR13 commented Oct 26, 2022

@jimschoening1 Yes, once you have made your claims... the natural next question is, can you make your claims / evidence clearer or less ambiguous.

I did a review of vocabulary related to https://github.com/ietf-scitt recently, and I was surprised at the ambiguity and overlap between certain terms.

Here are a couple examples:

It's a very popular occurrence in standards organizations too prefix a term with. "NIST" or "W3C" or "RATs"... so that people know which meaning / term you are intending to refer to...

Referring to a well established ontology is one of the best ways to provide better semantic precision.

Here are a few of my favorites, which we use to provide clarity regarding supply chain credentials:

@jimschoening1
Copy link

jimschoening1 commented Oct 27, 2022

@OR13,
Thank you for saying, "Referring to a well established ontology is one of the best ways to provide better semantic precision."
While the Common Core Ontology I mentioned above is not yet an approved standard, it is very mature and will only see perhaps 5% of its 1600 classes/terms changed during standardization. It includes the classes/terms commonly used accross multiple domains. Any terms not found could be extended as part of a domain and submitted to the IEEE Ontology Standards Working Group for inclusion.
Question: Would anyone in this community like to provide a VC claim (with terms defined in any way) and then review how the IEEE WG expresses the same payload data with the emerging standard ontologies?

@OR13
Copy link
Contributor Author

OR13 commented Oct 27, 2022

I'm happy to explore an example, and if the working group approves, we can include it in the next version of the TR.

I've added a separate issue to track that, please provide a JSON example on #963.

@tplooker
Copy link

tplooker commented Oct 28, 2022

The problem with this is, even though you use /private#, two claims that both use something like "foo" would result in using the same term and could create correlations that are probably unintended https://www.w3.org/ns/credentials/claims/private#foo.

Even with explicitly defined terms this issue doesn't go away, developers can pull in a bad mix of context URL's into a credential and find themselves in a situations where the IRI for a term isn't what they expected (that is if they even check). Semantics should be viewed as a useful feature that can be scaled into as the ecosystem needs it more. It shouldn't be table stakes to understand JSON-LD just to get started.

The best solution you're left with is something that "carves out" a default vocabulary namespace for default terms, as has been suggested in other proposals. I'll go away now :)

+1 and this should exist in the core v2 context, it shouldn't have to be dragged in separately. When it comes to the url I think "privateTerm/Claim" vs "undefined" is better because term expansions via @vocab aren't actually undefined, instead they've just been expanded through a default vocabulary.

@msporny
Copy link
Member

msporny commented Oct 30, 2022

Now that @OR13 has modified the initial proposal, the following issues (with strikethroughs) have been address... the ones without remain:

  1. It doesn't provide an option to opt-out of undefined/private properties. There is no "safe default" to say "I want every property to be accurately defined."
  2. Everyone has to buy into "undefined/private properties by default". Verifiable Credentials in the financial services industry are one place where you don't want "undefined/private properties by default".
  3. It causes regular JSON-LD tooling to be unable to catch undefined/private properties and report errors in production without building additional tooling to look at every single value, which harms the JSON-only (just check the context identifiers) use cases.
  4. It pollutes the VC vocabulary with terms we might need to define in a future WG.
  5. It opens developers up to having what they thought were "undefined/private properties" being defined by the VCWG at some future point in time.
  6. It does not differentiate between the different uses of @vocab that have been identified. Namely, "undefined terms", "document-relative terms", "catch-all vocabulary-based terms (schema.org)", and "private terms", and "the default vocabulary is the VC vocabulary".

I'll also note that @melvincarvalho raised the following concerns, with strike-throughs based on the now modified (better) proposal from @OR13:

  1. how do you catch terms which are errors? (this is the same as 3 above)
  2. it introduces an http vocab which might not play well with pure dweb systems
  3. the http vocab might not contain the given term
  4. if lots of specs use this pattern, we'll have lots of different base vocabs clashing best practice document says to use the base of the document for this.

These concerns will need to be addressed OR a reasonable compromise position proposed. I'll re-state the counter-proposal and elaborate in an attempt to make sure we're all on the same page:

COUNTER-PROPOSAL: Define a JSON-LD Context for at least "private claims". Require that any Verifiable Credential specify at least two contexts (the base context in the first position, and a market-vertical-specific context in the second position).

This has always been a requirement to have a useful VC, and every conformant pilot/production deployment that we've seen has used this pattern (demonstrating that developers are capable of doing this):

  "@context": ["https://www.w3.org/ns/credentials/v2", "https://www.w3.org/ns/credentials/private-claims/v2"]

If a developer isn't capable of copy-pasting that ^ into their code, there is probably very little that we can do to help them.

Creating a property that consists of an array with two string values is not a difficult ask of a developer, especially since we require far more complex properties in the rest of the VC Data Model.

To be clear, Digital Bazaar remains a very strong -1 on the proposal stated here, for the reasons elaborated upon above. We are, however, a +1 on the counter-proposal stated above, which is a compromise position (we would rather @vocab not be used at all in any sort of production setting because it silences certain types of processing errors that are dangerous to not see in production).

@David-Chadwick
Copy link
Contributor

David-Chadwick commented Oct 30, 2022

+1 to 2 @context values
-1 to 1 @context value
The latter disadvantages every wallet and verifier regardless of the issuer. The former only disadvantages JSON-LD verifiers and wallets that want to interwork with pure JSON issuers, providing the type is always globally unique.

@jandrieu
Copy link
Contributor

@David-Chadwick You can only ever have one @context, it can always have multiple values.

However, I want to push back on the term "private" to describe any of this. Private v public is a red herring of a distinction that I have written about for over a decade now. The word itself has almost no meaning in this context (no pun intended).

If someone wants to define a new context (perhaps the exact same one as envisioned as this "private" context), then, by all means do so.

Anyone can create a context. That's how it works.

Can someone explain what "private" means here? Maybe we can come up with a better term for the functional purpose of this additional context that any VC issuer would, of course, be able to add if it matches their use of the data model.

It doesn't seem that it should be required. Anything required should be in the VC context that defines required terms. Given that it shouldn't be required, it seems like a fine NOTE for the WG to consider.

@dlongley
Copy link
Contributor

dlongley commented Oct 31, 2022

@jandrieu,

Can someone explain what "private" means here?

I think what is meant by "private" here is something along the lines of "issuer-dependent". That is, you cannot tell what such a term actually maps to without the issuer telling you via some out-of-band mechanism. The URL such a term maps to (via @vocab) will not reveal its meaning nor will it disambiguate it when the same term (same as in "homonym") is used by a different issuer -- or perhaps even the same issuer in a different credential type.

@David-Chadwick
Copy link
Contributor

@jandrieu Thankyou. Fixed my comment now.

@OR13
Copy link
Contributor Author

OR13 commented Oct 31, 2022

  1. It doesn't provide an option to opt-out of undefined/private properties. There is no "safe default" to say "I want every property to be accurately defined."

I am arguing that this proposal is the "safe default".

Advanced processors can detect terms that are expanded using this default.

The chances of developers creating valid (processable) JSON-LD goes up, this leads to the ability ingest more data albeit at a "lower" semantic quality.

If you think about it, the data you get from a single context with a default vocab is always better than the data you don't get because the JSON-LD processor errored.

2. Everyone has to buy into "undefined/private properties by default". Verifiable Credentials in the financial services industry are one place where you don't want "undefined/private properties by default".

Everyone is already buying into:

And in particular:

 "@version": 1.1,
    "@protected": true,

    "id": "@id",
    "type": "@type",

The aliasing above is a great example of other places where we have tried to smooth the experience for JSON developers, to produce JSON-LD... Adding a default vocab completes this unfinished work.

3. It causes regular JSON-LD tooling to be unable to catch undefined/private properties and report errors in production without building additional tooling to look at every single value, which harms the JSON-only (just check the context identifiers) use cases.

This is false, the JSON-LD tooling can detect when vocabs are used to expand things.

Experience has shown us that the JSON-only (not a thing btw), are best served by a default vocabulary... because it aligns with their intuition.... they can add new terms, and no errors will be thrown, and terms they don't understand are ignored and preserved.

I am a "JWS secured valid JSON-LD" is the best way to issue credentials person at this point.
I am seeking to improve the experience for others like myself... Telling people to "just check the context"... does not work... they need to check every term in their new object and make sure its defined in the context... the best way to support that is to include a vocab in the context.

6. It does not differentiate between the different uses of @vocab that have been identified. Namely, "undefined terms", "document-relative terms", "catch-all vocabulary-based terms (schema.org)", and "private terms", and "the default vocabulary is the VC vocabulary".

It does, see the namespace differences, for example:

It seems like there might be more to this bullet point, especially related to the use of @base or @container... I suggest we open separate issues for those, since the change the shape of the graph that is produced (with or without an included vocab).

it introduces an http vocab which might not play well with pure dweb systems

See the HTTP vocabs listed above, this ship sailed already, but its not too late.... we can make all the IRIs non http, here is an example for chebi:

https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI%3A16526

CHEBI:16526

I don't think we need any IRIs (including the context or the vocab terms inside it be based on http... we have chosen to do so because of the usability benefits... which is what adding a vocab would be... we could add a vocab that expanded terms to NON http IRIs... if the WG wants to do that for the default vocab, I am open to discussing.

the http vocab might not contain the given term

Yes, that is how vocab expansion works... instead of exploding, you might land on an issue that asks for help defining the term... See also schema.org, and their setup.

if lots of specs use this pattern, we'll have lots of different base vocabs clashing best practice document says to use the base of the document for this.

I'd like a citation for the best practice on this.

It is true, that you can override the default vocab trivially, for example:

"@context": [
    "https://www.w3.org/ns/credentials/v2",
    { "@vocab": "https://vendor.example/ns/dynamic/" }
  ],

Then the organization behind https://vendor.example/ns/dynamic/ can handle defining only the terms they need to, and choose to leave the other terms with a warning that says "experimental / not supported".

BTW, all the terms we have defined in v1 are hosted on https:

^ We can ask w3.org and w3id.org for their server logs to see how active these resolutions are, that might inform our decision making process, regarding requiring remote contexts, or allowing remote term definitions (term definitions hosted outside of W3C, but where W3C takes a normative dependency on them).

COUNTER-PROPOSAL: Define a JSON-LD Context for at least "private claims". Require that any Verifiable Credential specify at least two contexts (the base context in the first position, and a market-vertical-specific context in the second position).

"@context": ["https://www.w3.org/ns/credentials/v2", "https://www.w3.org/ns/credentials/private-claims/v2"]

^ This proposal is workable.

But maybe it would be better to save the resolution and just do this:

"@context": ["https://www.w3.org/ns/credentials/v2",  { "@vocab": "https://www.w3.org/ns/credentials/claims/private#" }]

This way, anyone who copy pastes an example will be free to edit it, and add new terms... and they won't be forced to add another IRI to their document loader, and W3C won't be forced to serve another context file, that people will forget to add to their document loader.

I think we should unpack the benefits of "JSON" that isn't valid "JSON-LD"... why would we want to expose users to these errors?

We discussed this with our engineering team, and a lot of them felt that throwing errors was a good way to "teach lessons on JSON-LD".

They also noted that, as experts in this space, the more errors that we process / handle the better our job security... people will need us to help them figure out how to define their terms!

That could help us gate keep terms, so the terms that make it through are always of the highest quality... but it also feels a bit like a "premine"... where the value accrues to the people who understand the system first.

As an editor / maintainer of term registries in W3C and DIF... I don't think this stance is helping us with adoption, and I don't think its "gatekeeping".... I think it's "censorship".

We have built a system, where the average developer cannot produce data that is semantically valid, and our justification is that they should "become JSON-LD experts.... or hire one".

Instead, we could make it such that they can produce data, and it is valid / has usable graph structure... and then they can learn or hire an expert to improve from the foundation and the safe defaults we have encoded into the spec... that is what we should be doing.

@vongohren
Copy link

Just to shoot in that if the info is clearly documented places in the spec, we create an issue on stackexchange related to invalid JSON-LD and answere it ourselves with the solution, add this to vocab.

I dont think this will be such a hinder. I start making a VC, and it fails in the lib. Future libs can help to say want dev capabilities, do this. One will search for solutions and if done right the questions will pop up when searching. Or one will reread the spec to see what is up.

So I dont really understand why explicitly flagging a free for all VC is difficult?

@OR13
Copy link
Contributor Author

OR13 commented Nov 3, 2022

Here is an example of exactly the problem that this proposal will address:

EcdsaSecp256k1VerificationKey2019 is not defined in https://w3id.org/did/v1

Also, the context is not correct, it should be https://www.w3.org/ns/did/v1

Notice that www.w3.org is W3C controlling term definitions, whereas w3id.org is controlled by the W3C CCG.

@TallTed
Copy link
Member

TallTed commented Nov 8, 2022

[@OR13] whereas w3id.org is controlled by the W3C CCG

Not quite. w3id.org is controlled by the W3ID Consortium. Lots more details are at https://w3id.org/, such as —

The letters 'w3' in the domain name for this site stand for "World Wide Web". Other than hosting the software for the Permanent Identifier Community Group, the "World Wide Web Consortium" (W3C) is not involved in the support or management of this website in any way.

@tplooker
Copy link

tplooker commented Nov 8, 2022

It doesn't provide an option to opt-out of undefined/private properties. There is no "safe default" to say "I want every property to be accurately defined."

Yes there is it just requires a JSON-LD processor able to detect that the term expansion is using this default vocab

Everyone has to buy into "undefined/private properties by default". Verifiable Credentials in the financial services industry are one place where you don't want "undefined/private properties by default".

Kind of, just because the default exists, it doesn't mean everyone has to use the default. There are many standards that can be cited that have used this strategy to great affect. See OpenID Connect Core and FAPI as one such example, the constrains applied by FAPI to the protocol required for financial service related interactions would be prohibitive if all implementers were forced to meet this bar.

@OR13
Copy link
Contributor Author

OR13 commented Nov 22, 2022

Instructions for making the context immutable using IPFS, and examples of the changes requested in this issue to the v1 context:

https://github.com/transmute-industries/ns.transmute.org

https://cloudflare-ipfs.com/ipns/vocab.v1.credentials.ns.transmute.org

See examples here: #947 (comment)

Notable that if even the examples in our spec are wrong (terms not defined in context), we're really setting developers and implementers up for failure, and a 1 line change to the current v1 context would have fixed this issue;

https://github.com/transmute-industries/ns.transmute.org/blob/main/contexts/credentials-v1-vocab.json#L8

@OR13
Copy link
Contributor Author

OR13 commented Dec 14, 2022

Another DID Method registration that would have benefited from a vocab in DID Core v1 context.

w3c/did-spec-registries#484

@OR13
Copy link
Contributor Author

OR13 commented Dec 14, 2022

@iherman I believe we had resolutions related to this on a special topic call, but I do not see them here.

@OR13
Copy link
Contributor Author

OR13 commented Dec 14, 2022

PR is up: #1001

@OR13 OR13 self-assigned this Dec 14, 2022
@OR13 OR13 added the pr exists label Dec 14, 2022
@msporny
Copy link
Member

msporny commented Jan 24, 2023

PR #1001 has been merged, which addresses this issue. Closing.

@msporny msporny closed this as completed Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests