From 78bdcbbd6c435cbfaa54cf855a322ec98e1bc720 Mon Sep 17 00:00:00 2001 From: Manu Sporny Date: Mon, 26 Aug 2024 10:00:15 -0400 Subject: [PATCH] Align Context Validation structs with rest of spec. --- index.html | 52 +++++++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/index.html b/index.html index 9f6d811..5437387 100644 --- a/index.html +++ b/index.html @@ -2252,24 +2252,30 @@

Context Validation

rationale related to this algorithm, see Section [[[#validating-contexts]]]. This algorithm takes inputs of a document ([=map=] |inputDocument|), a set of known JSON-LD Contexts ([=list=] |knownContext|), and a boolean to -recompact when unknown contexts are detected ([=boolean=] |recompact|), and -returns a [=map=] that contains the following: +recompact when unknown contexts are detected ([=boolean=] |recompact|).

- +

+This algorithm returns a context validation result, +a [=struct=] whose [=struct/items=] are: +

+
+
validated
+
`true` or `false`
+
validatedDocument
+
+Null, if [=context validation result/validated=] is +`false`; otherwise, the [=input document=] +
+
warnings
+
+a [=list=] of [=ProblemDetails=], which defaults to an empty [=list=] +
+
errors
+
+a [=list=] of [=ProblemDetails=], which defaults to an empty [=list=] +
+

The context validation algorithm is as follows: @@ -2277,22 +2283,22 @@

Context Validation

  1. -Set |result|.|status| to `false`, |result|.|warnings| to an empty list, +Set |result|.|validated| to `false`, |result|.|warnings| to an empty list, |result|.|errors| to an empty list, |compactionContext| to an empty list; -and clone |inputDocument| to |result|.|document|. +and clone |inputDocument| to |result|.|validatedDocument|.
  2. -Let |contextValue| be the value of the `@context` property of |result|.|document|, +Let |contextValue| be the value of the `@context` property of |result|.|validatedDocument|, which might be undefined.
  3. If |contextValue| does not deeply equal |knownContext|, any subtree in -|result|.|document| contains an `@context` property, or any URI in +|result|.|validatedDocument| contains an `@context` property, or any URI in |contextValue| dereferences to a JSON-LD Context file that does not match a known good value or cryptographic hash, then perform the applicable action:
    1. -If |recompact| is `true`, set |result|.|document| to the result +If |recompact| is `true`, set |result|.|validatedDocument| to the result of running the JSON-LD Compaction Algorithm with the |inputDocument| and |knownContext| as inputs. If the compaction fails, add at least one error @@ -2304,8 +2310,8 @@

      Context Validation

  4. -If |result|.|errors| is empty, set |result|.|status| to `true`; otherwise, set -|result|.|status| to `false`, and remove the |document| property from |result|. +If |result|.|errors| is empty, set |result|.|validated| to `true`; otherwise, set +|result|.|validated| to `false`, and remove the |document| property from |result|.
  5. Return the value of |result|.