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 sections on Processing Model and Context Validation #291

Merged
merged 13 commits into from
Jul 27, 2024

Conversation

msporny
Copy link
Member

@msporny msporny commented Jul 21, 2024

This PR attempts to address issue #288 by adding sections on Processing Model and Context Validation.


Preview | Diff

@msporny msporny added CR1 This item was processed during the first Candidate Recommendation phase. normative This issue or PR will trigger the need for another Candidate Recommendation Snapshot labels Jul 21, 2024
@msporny msporny requested a review from Wind4Greg as a code owner July 21, 2024 21:03
index.html Outdated Show resolved Hide resolved
index.html Outdated
Comment on lines 2279 to 2283
optionally, for the context values that do not exist in |approvedContexts|,
remove the |contextValue| from the `@context` property values. Set
|result|.|document| to the result of running the
<a data-cite="JSON-LD11-API#compaction-algorithm">
JSON-LD Compaction Algorithm</a> with the modified |inputDocument| as input.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need the same adjustments as VC data model PR 1535.

Copy link
Member Author

@msporny msporny Jul 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 0f234e8 ... which drastically changed the algorithm given @TallTed's changes. The previous algorithm didn't work for multiply nested documents w/ multiple contexts. The update attempts to address that use case. Please check my work @dlongley @davidlehn... I think I got all the corner cases, but need more eyes on it.

index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated
a status ([=boolean=] |status|)
</li>
<li>
a validated document ([=map=] |document|)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do any errors prevent return of a validated document? That is, is a validated document always returned in the map, regardless of errors?

Copy link
Member Author

@msporny msporny Jul 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, errors will result in an undefined value for document, which is noted in the algorithm below.

index.html Outdated
</ol>

<p>
The purpose of the algorithm above is to ensure that a consuming application has
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This explanation (all paragraphs of it) would be better presented before the algorithm it discusses, than following it. Making this relocation will mandate some rephrasing. It might be worthwhile to put this description into <h4>Context Validation Description</h4> (or similar title) followed by <h4>Context Validation Algorithm</h4>, both being within <h3>Context Validation</h4>.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 3107ccb (without creating more sections, just moved some text around).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@msporny3107ccb is a good start. I think lines 2312 through 2353 (using the line numbers visible at that commit) should also be moved to ~2245 (preceding the list of algorithm inputs) or possibly ~2264 (following the list of algorithm outputs). After that move, some further rephrasing may be appropriate. (Also note that there are change suggestions in flight on these sections, which I think should be made before the relocation, so the line numbers referenced here may also change before the relocation happens.)

index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated
This section contains an algorithm that applications MUST run after running the
algorithm in Section [[[#verify-proof]]] or Section
[[[#verify-proof-sets-and-chains]]], when validating a [=conforming secured
document=]. This algorithm takes a document ([=map=] |inputDocument|) and a set
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason for this order? Instinctively, my choice would be to first check whether the document is all right in terms of JSON-LD, ie, run the context validation, before running it through the validating steps (that may also involve running RDFC on the RDF graphs generated by the JSON-LD processing).

(Note if the order is reversed, it also has to be updated in the new processing model section.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 3107ccb.

@TallTed
Copy link
Member

TallTed commented Jul 23, 2024

There's a lot of repeated text, here and in w3c/vc-data-model#1535, which needs similar if not identical changes (which suggestions from myself and others do not currently reflect), possibly being adjusted to be said in one place, and referenced in the other.

@msporny
Copy link
Member Author

msporny commented Jul 24, 2024

@TallTed wrote:

There's a lot of repeated text, here and in w3c/vc-data-model#1535, which needs similar if not identical changes (which suggestions from myself and others do not currently reflect), possibly being adjusted to be said in one place, and referenced in the other.

See the reasoning here: w3c/vc-data-model#1535 (comment)

msporny and others added 4 commits July 24, 2024 17:18
Co-authored-by: Dave Longley <dlongley@digitalbazaar.com>
Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
@iherman iherman self-requested a review July 25, 2024 06:42
index.html Outdated
and expresses them using the `@context` property.
</li>
<li>
Selects a cryptography suite that meets the needs of the use case, such as
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Selects a cryptography suite that meets the needs of the use case, such as
Selects one or more cryptography suites that meet the needs of the use case, such as

Comment on lines +2259 to +2261
<li>
zero or more warnings ([=list=] of [=ProblemDetails=] |warnings|)
</li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't used in the algorithm.

Suggested change
<li>
zero or more warnings ([=list=] of [=ProblemDetails=] |warnings|)
</li>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but it's left in there so that implementations can add warnings if they would like (and there is a standards interface for them doing so. I'll add some text to note that implementations MAY add additional warnings/errors.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 04584e7.

index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated
<p>
Yet another valid approach would be for a transmitting application to
<a data-cite="JSON-LD11-API#compaction-algorithm">compact</a> a document to
exactly what a receiving application requests, omitting additional
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does a receiving application request (a) specific context(s)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed by explaining that it can happen via the query protocol.

index.html Outdated Show resolved Hide resolved
@msporny
Copy link
Member Author

msporny commented Jul 27, 2024

Normative, multiple reviews, changes requested and made, no objections, merging.

@msporny msporny merged commit 0eb5396 into main Jul 27, 2024
1 check passed
@msporny msporny deleted the msporny-processing-model branch July 27, 2024 18:14
which might be undefined.
</li>
<li>
If |contextValue| does not deeply equal |expectedContext|, then if any subtree in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slight mixup here in the grammar fixes, this step should read "or if" not "then if".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CR1 This item was processed during the first Candidate Recommendation phase. normative This issue or PR will trigger the need for another Candidate Recommendation Snapshot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants