Skip to content

Commit 5d8849b

Browse files
ihermanTallTeddavidlehn
authored
Add relatedResource and digestSRI to the vocabulary.
* Added anchors to the `digestSRI` and `relatedResource` terms (to be used by the vocabulary) * Added a section to define the `sristring` datatype * Added the `digestSRI`, `relatedResource`, `mediaType` to the v2 context * Added the `digestSRI` and `relatedResource` properties, as well as the `sriString` datatype to `vocabulary.yml` * Added a section on datatypes in the `template.html` file for the vocabulary generation * Added the `vocabulary.drawio` file to the repository and expanded the `README.md` file in the the corresponding directory * Updated the diagram, finalized the vocabulary (there were syntax errors) * `sristring` -> `sriString` --------- Co-authored-by: Ted Thibodeau Jr <[email protected]> Co-authored-by: David I. Lehn <[email protected]>
1 parent 5536809 commit 5d8849b

File tree

8 files changed

+876
-212
lines changed

8 files changed

+876
-212
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
.vscode
99
.idea
1010
.gitignore
11+
*.bkp
1112

1213
**/node_modules
1314
**/.DS_Store
1415
**/.vscode
15-
**/package-lock.json
16+
**/package-lock.json

contexts/credentials/v2

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@
6666
"@id": "https://www.iana.org/assignments/jwt#..."
6767
},
6868

69+
"digestSRI": {
70+
"@id": "https://www.w3.org/2018/credentials#digestSRI",
71+
"@type": "https://www.w3.org/2018/credentials#sriString"
72+
},
73+
"mediaType": {
74+
"@id": "https://schema.org/encodingFormat"
75+
},
76+
6977
"VerifiableCredential": {
7078
"@id": "https://www.w3.org/2018/credentials#VerifiableCredential",
7179
"@context": {
@@ -149,6 +157,10 @@
149157
"confidenceMethod": {
150158
"@id": "https://www.w3.org/2018/credentials#confidenceMethod",
151159
"@type": "@id"
160+
},
161+
"relatedResource": {
162+
"@id": "https://www.w3.org/2018/credentials#relatedResource",
163+
"@type": "@id"
152164
}
153165
}
154166
},

index.html

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2931,7 +2931,7 @@ <h2>Integrity of Related Resources</h2>
29312931
<p>
29322932
To validate that a resource referenced by a <a>verifiable credential</a> is the
29332933
same at verification time as it is at issuing time, an implementer MAY include a
2934-
property named <code>relatedResource</code> that stores an array of objects that
2934+
property named <code id="defn-relatedResource">relatedResource</code> that stores an array of objects that
29352935
describe additional integrity metadata about each resource referenced by the
29362936
<a>verifiable credential</a>. If <code>relatedResource</code> is present, there
29372937
MUST be an object in the array for each remote resource for each context used in
@@ -2945,7 +2945,7 @@ <h2>Integrity of Related Resources</h2>
29452945
<p>
29462946
Each object in the <code>relatedResource</code> array MUST contain the
29472947
following: the [[URL]] to the resource named <code>id</code> and the
2948-
<code>digestSRI</code> information for the resource constructed using the method
2948+
<code id="defn-digestSRI">digestSRI</code> information for the resource constructed using the method
29492949
specified in <a href="https://www.w3.org/TR/SRI/#integrity-metadata">Subresource
29502950
Integrity</a>.
29512951
</p>
@@ -6051,6 +6051,54 @@ <h3>Vocabularies</h3>
60516051
</table>
60526052

60536053
</section>
6054+
6055+
<section>
6056+
<h3>Datatypes</h3>
6057+
<p>
6058+
This section defines datatypes that are used by this specification.
6059+
</p>
6060+
6061+
<section>
6062+
<h4>The <code>sriString</code> Datatype</h4>
6063+
6064+
<p>
6065+
The string provides the integrity information for a resource using the method specified in the [[SRI]] specification.
6066+
</p>
6067+
6068+
<p>
6069+
The `sriString` datatype is defined as follows:
6070+
</p>
6071+
6072+
<dl>
6073+
<dt>The URL denoting this datatype</dt>
6074+
<dd>
6075+
`https://www.w3.org/2018/credentials#sriString`
6076+
</dd>
6077+
<dt>The lexical space</dt>
6078+
<dd>
6079+
See the <a href="https://www.w3.org/TR/SRI/#the-integrity-attribute">ABNF grammar</a>, defining the `integrity`
6080+
attribute in the [[SRI]] specification, for the restrictions on the string format.
6081+
</dd>
6082+
<dt>The value space</dt>
6083+
<dd>
6084+
A (possibly empty) list of <i>(alg,val)</i> pairs, where <i>alg</i> identifies a hash function, and <i>val</i> is an integer as a standard mathematical concept.
6085+
</dd>
6086+
<dt>The lexical-to-value mapping</dt>
6087+
<dd>
6088+
Any element of the lexical space is mapped to the value space by
6089+
following the <a href="https://www.w3.org/TR/SRI/#parse-metadata">parse metadata algorithm</a> based
6090+
on the <a href="https://www.w3.org/TR/SRI/#the-integrity-attribute">ABNF grammar</a> in the [[SRI]] specification.
6091+
</dd>
6092+
<dt>The canonical mapping</dt>
6093+
<dd>
6094+
The canonical mapping consists of the lexical-to-value mapping.
6095+
</dd>
6096+
</dl>
6097+
</section>
6098+
6099+
6100+
</section>
6101+
60546102
<section class="informative">
60556103
<h3>Differences between Contexts, Types, and CredentialSchemas</h3>
60566104

vocab/credentials/v2/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,9 @@ The generation of the final files is done via a github action (see `/.github/wor
99

1010
- `Readme.md`: this file.
1111
- `vocabulary.yml`: the core vocabulary specification. _Any change on the vocabulary must be made by modifying this file;_ see the separate [description](https://github.com/w3c/yml2vocab) of the underlying YAML format.
12-
- `template.json`: an HTML template file used by the script; it is the skeleton of the final HTML format based on [ReSpec](https://respec.org/docs/). If the file is modified, care should be taken not to change the core structure and the various, possibly empty, HTML elements with `@id` values. The script fills those elements with content when generating the `vocabulary.html` file.
12+
- `vocabulary.drawio`: the vocabulary diagram in the [draw.io](https://www.drawio.com/) format. _Any change on the vocabulary diagram must be made by modifying this file._
13+
14+
The corresponding application can be downloaded and used directly, or added to Google Docs. Note that, due to some bug in the software the exported SVG file must be ran through a [post-processing script](https://github.com/iherman/drawio-svg/), to be downloaded and run separately.
15+
- `vocabulary.svg`: the SVG file for the vocabulary, generated from `vocabulary.drawio`.
16+
- `template.json`: an HTML template file used by the script; it is the skeleton of the final HTML format based on [ReSpec](https://respec.org/docs/). If the file is modified, care should be taken not to change the core structure and the various, possibly empty, HTML elements with `@id` values. The script fills those elements with content when generating the `vocabulary.html` file (and removes any sections that remain empty after processing).
1317

vocab/credentials/v2/template.html

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
const retval = content
1515
.replace('<svg', '<svg aria-details="#vocabulary-diagram-alt" ')
1616
.replace(/xlink:href/g, 'href')
17-
.replace(/href="https:\/\/w3.org\/2018\/credentials\/#/g, 'href="#');
17+
.replace(/href="https:\/\/www.w3.org\/2018\/credentials#/g, 'href="#');
1818
return retval;
1919
}
2020

@@ -198,6 +198,10 @@ <h2>Class definitions</h2>
198198
<h2>Property definitions</h2>
199199
</section>
200200

201+
<section id="datatype_definitions" class="term_definitions">
202+
<h2>Datatype definitions</h2>
203+
</section>
204+
201205
<section id="individual_definitions" class="term_definitions">
202206
<h2>Definitions for individuals</h2>
203207
</section>
@@ -220,6 +224,10 @@ <h2>Reserved classes</h2>
220224
<h2>Reserved properties</h2>
221225
</section>
222226

227+
<section id="reserved_datatype_definitions" class="term_definitions">
228+
<h2>Reserved datatype definitions</h2>
229+
</section>
230+
223231
<section id="reserved_individual_definitions" class="term_definitions">
224232
<h2>Reserved individuals</h2>
225233
</section>
@@ -240,6 +248,10 @@ <h2>Deprecated classes</h2>
240248
<h2>Deprecated properties</h2>
241249
</section>
242250

251+
<section id="deprecated_property_definitions" class="term_definitions">
252+
<h2>Deprecated properties</h2>
253+
</section>
254+
243255
<section id="deprecated_individual_definitions" class="term_definitions">
244256
<h2>Deprecated individuals</h2>
245257
</section>
@@ -270,13 +282,14 @@ <h2>Diagram description</h2>
270282
</p>
271283
<p>
272284
The "VerifiableCredential" ellipse is connected to the "credentialSchema", "credentialStatus",
273-
"credentialSubject", "issuer", "evidence", "refreshService", "renderMethod", and "confidenceMethod"
274-
boxes, through connecting lines styled as Domain Of.
285+
"credentialSubject", "issuer", "relatedResource", "evidence", "refreshService", "renderMethod",
286+
and "confidenceMethod" boxes, through connecting lines styled as Domain Of.
275287
It is also connected to the crossing point circle with a similar connecting line,
276288
styled as Domain Of.
277289
The "VerifiablePresentation" ellipse is connected to the crossing point circle, as well as the "holder"
278290
and "verifiableCredential" boxes, with a similar connecting line, styled as Domain Of.
279-
The crossing point circle is connected to the "termsOfUse", "validFrom", and "validUntil" boxes with a connecting line styled as Domain Of.
291+
The crossing point circle is connected to the "termsOfUse", "validFrom", and "validUntil" boxes with a
292+
connecting line styled as Domain Of.
280293
The "verifiableCredential" box is connected to the "VerifiableCredentialGraph" ellipse with a connecting
281294
line styled as Range.
282295
The "JsonSchemaCredential" ellipse is connected to the "VerifiableCredential" ellipse with a
@@ -292,13 +305,18 @@ <h2>Diagram description</h2>
292305
connected to those Class ellipses, with connecting lines styled as Range.
293306
</p>
294307
<p>
295-
Finally, the "CredentialSchema" ellipse is connected to one more ellipse, on the far right
308+
The "CredentialSchema" ellipse is connected to one more ellipse, on the far right
296309
side of the diagram, styled as Class and labeled as "JsonSchema", with a connecting line
297310
styled as Superclass. This "JsonSchema" ellipse is also connected to a Property box
298311
labeled as "jsonSchema", through a connector line styled as Domain Of. This "jsonSchema"
299312
box is connected to a Datatype shape labeled as "rdf:JSON", with a connecting line
300313
styled as Range.
301314
</p>
315+
<p>
316+
Finally, on the lower far right side of the diagram, there is a separate Property box labeled as
317+
"digestSRI", connected to a Datatype shape labeled as "sristring", with a connecting line
318+
styled as Range.
319+
</p>
302320
</details>
303321
</section>
304322

0 commit comments

Comments
 (0)