Skip to content

Commit

Permalink
Add relatedResource and digestSRI to the vocabulary.
Browse files Browse the repository at this point in the history
* 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 <tthibodeau@openlinksw.com>
Co-authored-by: David I. Lehn <dlehn@digitalbazaar.com>
  • Loading branch information
3 people authored Oct 16, 2023
1 parent 5536809 commit 5d8849b
Show file tree
Hide file tree
Showing 8 changed files with 876 additions and 212 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
.vscode
.idea
.gitignore
*.bkp

**/node_modules
**/.DS_Store
**/.vscode
**/package-lock.json
**/package-lock.json
12 changes: 12 additions & 0 deletions contexts/credentials/v2
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@
"@id": "https://www.iana.org/assignments/jwt#..."
},

"digestSRI": {
"@id": "https://www.w3.org/2018/credentials#digestSRI",
"@type": "https://www.w3.org/2018/credentials#sriString"
},
"mediaType": {
"@id": "https://schema.org/encodingFormat"
},

"VerifiableCredential": {
"@id": "https://www.w3.org/2018/credentials#VerifiableCredential",
"@context": {
Expand Down Expand Up @@ -149,6 +157,10 @@
"confidenceMethod": {
"@id": "https://www.w3.org/2018/credentials#confidenceMethod",
"@type": "@id"
},
"relatedResource": {
"@id": "https://www.w3.org/2018/credentials#relatedResource",
"@type": "@id"
}
}
},
Expand Down
52 changes: 50 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2931,7 +2931,7 @@ <h2>Integrity of Related Resources</h2>
<p>
To validate that a resource referenced by a <a>verifiable credential</a> is the
same at verification time as it is at issuing time, an implementer MAY include a
property named <code>relatedResource</code> that stores an array of objects that
property named <code id="defn-relatedResource">relatedResource</code> that stores an array of objects that
describe additional integrity metadata about each resource referenced by the
<a>verifiable credential</a>. If <code>relatedResource</code> is present, there
MUST be an object in the array for each remote resource for each context used in
Expand All @@ -2945,7 +2945,7 @@ <h2>Integrity of Related Resources</h2>
<p>
Each object in the <code>relatedResource</code> array MUST contain the
following: the [[URL]] to the resource named <code>id</code> and the
<code>digestSRI</code> information for the resource constructed using the method
<code id="defn-digestSRI">digestSRI</code> information for the resource constructed using the method
specified in <a href="https://www.w3.org/TR/SRI/#integrity-metadata">Subresource
Integrity</a>.
</p>
Expand Down Expand Up @@ -6051,6 +6051,54 @@ <h3>Vocabularies</h3>
</table>

</section>

<section>
<h3>Datatypes</h3>
<p>
This section defines datatypes that are used by this specification.
</p>

<section>
<h4>The <code>sriString</code> Datatype</h4>

<p>
The string provides the integrity information for a resource using the method specified in the [[SRI]] specification.
</p>

<p>
The `sriString` datatype is defined as follows:
</p>

<dl>
<dt>The URL denoting this datatype</dt>
<dd>
`https://www.w3.org/2018/credentials#sriString`
</dd>
<dt>The lexical space</dt>
<dd>
See the <a href="https://www.w3.org/TR/SRI/#the-integrity-attribute">ABNF grammar</a>, defining the `integrity`
attribute in the [[SRI]] specification, for the restrictions on the string format.
</dd>
<dt>The value space</dt>
<dd>
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.
</dd>
<dt>The lexical-to-value mapping</dt>
<dd>
Any element of the lexical space is mapped to the value space by
following the <a href="https://www.w3.org/TR/SRI/#parse-metadata">parse metadata algorithm</a> based
on the <a href="https://www.w3.org/TR/SRI/#the-integrity-attribute">ABNF grammar</a> in the [[SRI]] specification.
</dd>
<dt>The canonical mapping</dt>
<dd>
The canonical mapping consists of the lexical-to-value mapping.
</dd>
</dl>
</section>


</section>

<section class="informative">
<h3>Differences between Contexts, Types, and CredentialSchemas</h3>

Expand Down
6 changes: 5 additions & 1 deletion vocab/credentials/v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@ The generation of the final files is done via a github action (see `/.github/wor

- `Readme.md`: this file.
- `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.
- `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.
- `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._

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.
- `vocabulary.svg`: the SVG file for the vocabulary, generated from `vocabulary.drawio`.
- `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).

28 changes: 23 additions & 5 deletions vocab/credentials/v2/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
const retval = content
.replace('<svg', '<svg aria-details="#vocabulary-diagram-alt" ')
.replace(/xlink:href/g, 'href')
.replace(/href="https:\/\/w3.org\/2018\/credentials\/#/g, 'href="#');
.replace(/href="https:\/\/www.w3.org\/2018\/credentials#/g, 'href="#');
return retval;
}

Expand Down Expand Up @@ -198,6 +198,10 @@ <h2>Class definitions</h2>
<h2>Property definitions</h2>
</section>

<section id="datatype_definitions" class="term_definitions">
<h2>Datatype definitions</h2>
</section>

<section id="individual_definitions" class="term_definitions">
<h2>Definitions for individuals</h2>
</section>
Expand All @@ -220,6 +224,10 @@ <h2>Reserved classes</h2>
<h2>Reserved properties</h2>
</section>

<section id="reserved_datatype_definitions" class="term_definitions">
<h2>Reserved datatype definitions</h2>
</section>

<section id="reserved_individual_definitions" class="term_definitions">
<h2>Reserved individuals</h2>
</section>
Expand All @@ -240,6 +248,10 @@ <h2>Deprecated classes</h2>
<h2>Deprecated properties</h2>
</section>

<section id="deprecated_property_definitions" class="term_definitions">
<h2>Deprecated properties</h2>
</section>

<section id="deprecated_individual_definitions" class="term_definitions">
<h2>Deprecated individuals</h2>
</section>
Expand Down Expand Up @@ -270,13 +282,14 @@ <h2>Diagram description</h2>
</p>
<p>
The "VerifiableCredential" ellipse is connected to the "credentialSchema", "credentialStatus",
"credentialSubject", "issuer", "evidence", "refreshService", "renderMethod", and "confidenceMethod"
boxes, through connecting lines styled as Domain Of.
"credentialSubject", "issuer", "relatedResource", "evidence", "refreshService", "renderMethod",
and "confidenceMethod" boxes, through connecting lines styled as Domain Of.
It is also connected to the crossing point circle with a similar connecting line,
styled as Domain Of.
The "VerifiablePresentation" ellipse is connected to the crossing point circle, as well as the "holder"
and "verifiableCredential" boxes, with a similar connecting line, styled as Domain Of.
The crossing point circle is connected to the "termsOfUse", "validFrom", and "validUntil" boxes with a connecting line styled as Domain Of.
The crossing point circle is connected to the "termsOfUse", "validFrom", and "validUntil" boxes with a
connecting line styled as Domain Of.
The "verifiableCredential" box is connected to the "VerifiableCredentialGraph" ellipse with a connecting
line styled as Range.
The "JsonSchemaCredential" ellipse is connected to the "VerifiableCredential" ellipse with a
Expand All @@ -292,13 +305,18 @@ <h2>Diagram description</h2>
connected to those Class ellipses, with connecting lines styled as Range.
</p>
<p>
Finally, the "CredentialSchema" ellipse is connected to one more ellipse, on the far right
The "CredentialSchema" ellipse is connected to one more ellipse, on the far right
side of the diagram, styled as Class and labeled as "JsonSchema", with a connecting line
styled as Superclass. This "JsonSchema" ellipse is also connected to a Property box
labeled as "jsonSchema", through a connector line styled as Domain Of. This "jsonSchema"
box is connected to a Datatype shape labeled as "rdf:JSON", with a connecting line
styled as Range.
</p>
<p>
Finally, on the lower far right side of the diagram, there is a separate Property box labeled as
"digestSRI", connected to a Datatype shape labeled as "sristring", with a connecting line
styled as Range.
</p>
</details>
</section>

Expand Down
Loading

0 comments on commit 5d8849b

Please sign in to comment.