w3c-ccg / did-spec

Please see README.md for latest version being developed by W3C DID WG.
https://w3c.github.io/did-core/
Other
124 stars 45 forks source link

Did Query #85

Closed SmithSamuelM closed 5 years ago

SmithSamuelM commented 6 years ago

This action item from the Did Spec Completion proposals doc did not make it into the latest did spec 0.1

2: DID URI Query Component

Motivation We forgot to include the URI query component in defining DID ABNF. There was no reason for this; it simply an oversight. Proposal Add the DID query component to the ABNF in section 3.1, and add a section to define it. did-reference = did [ ";" did-service ] [ "/" did-path ] [ "?" did-query ] [ "#" did-frag ] did = "did:" method ":" specific-idstring method = 1namechar namechar = %x61-7A / DIGIT specific-idstring = idstring ( ":" idstring ) idstring = 1idchar idchar = ALPHA / DIGIT / "." / "-" did-service = 1servchar ( ";" 1servchar ) servchar = idchar / "=" / "&"

SmithSamuelM commented 6 years ago

The presence of the DID query has two main syntactical interpretations.

When a DID path component is present the DID query is a modifier on the did path resource in the same way that it works on a URL.

When a DID path component is not present then the DID Query is a modifier on the Did meta-data obtained from the DDO and narrowed by the did fragment if present.

SmithSamuelM commented 6 years ago

The query string can be used for any query purpose after the id-string, the md-string, or the path-segment.

SmithSamuelM commented 5 years ago

What is remaining to close and merge this pull request? The Query was always meant to be part of the DID syntax but was left out as an oversight.

peacekeeper commented 5 years ago

I think PR 106 nicely fixes the ABNF, but..

  1. There are a number of other small issues with the PR which I have articulated there (e.g. in a few places it seems to assume that fragment comes before query?).
  2. While adding did-query to the ABNF seems uncontroversial, there is more discussion about did-service elsewhere.

Perhaps @mikelodder7 can update his PR accordingly, or we start a new PR.

mikelodder7 commented 5 years ago

Okay, I'll do that and try to get to pushing an update today.

mwherman2000 commented 5 years ago

Shouldn't the URI/URL/URN refactoring of the draft DID spec precede these kinds of changes? Reference: https://github.com/w3c-ccg/did-spec/pull/159#discussion_r251207514 I believe the refactoring will require more changes than is currently being imagined (even with the goal being to minimize these effects). CC: @msporny

SmithSamuelM commented 5 years ago

See my comments on #90. If we use the existing elements in the right way we don't have to redefine the URL/URI syntax. Its a big hit if we do so we should be clever about the semantics and restrain ourselves on modifying the syntax. If we use the JSON PTR in the fragment and the DID path presence as a semantic switch then we can define custom but narrowed contextual semantics for the DID query which I believe future proofs the specification.

mwherman2000 commented 5 years ago

There's several additional issues related to the ABNF grammar in section https://w3c-ccg.github.io/did-spec/#the-generic-did-scheme ...shouldn't these be addressed as well ...as a single PR?

  1. https://github.com/w3c-ccg/did-spec/issues/85 - DID Query (this issue).
  2. https://github.com/w3c-ccg/did-spec/issues/126 - DID Fragment issues
  3. https://github.com/w3c-ccg/did-spec/issues/128 - DID Reference omits the need for the punctuation character
  4. https://github.com/w3c-ccg/did-spec/issues/129 - definition (the specific wording) of/for DID Scheme is confuding
  5. https://github.com/w3c-ccg/did-spec/issues/131 - language in this section contradicts the previous language
  6. https://github.com/w3c-ccg/did-spec/issues/132 - References are not referred to consistently
  7. https://github.com/w3c-ccg/did-spec/issues/133 - confuding non-recommendation for central registries
  8. https://github.com/w3c-ccg/did-spec/issues/134 - Reference to "The fully qualified DID"
  9. https://github.com/w3c-ccg/did-spec/issues/135 - "ABNF rules" not named consistently
  10. https://github.com/w3c-ccg/did-spec/issues/136 - definitions for did-path and did-fragment are missing
SmithSamuelM commented 5 years ago

It would be great if there were anyway to get them all resolved in a batch. We spent a lot of time last year on a DID Hardening effort to resolve issues in a batch. #85 was part of that. The ones above are all new since then. Some of the confusion in the above is not realizing that the DID query is supposed to be there and can be used. So if I seem discouraged its because after a year stuff was agreed upon still did not get merged. So getting 9 new things resolved at the same time seems impossible.

msporny commented 5 years ago

Shouldn't the URI/URL/URN refactoring of the draft DID spec precede these kinds of changes?

No, because of the reasons @SmithSamuelM mentions. This is also a much smaller change thatn refactoring the entire spec. Small changes go in first, then large changes (as a general rule)... it causes way less merge conflicts. This change has also been hanging out there for a while and implementers need some closure on it.

SmithSamuelM commented 5 years ago

+1

dmitrizagidulin commented 5 years ago

Addressed in PR #168.