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 formal vocabulary definitions. #105

Merged
merged 9 commits into from
Jan 13, 2024
Merged
47 changes: 47 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish to Github Pages
on:
push:
branches: [main]
# Allows workflow to be triggered manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout/@v3
- name: Setup Node 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Generate vocabulary
run: |
npm install yml2vocab
npm update yml2vocab
./node_modules/.bin/yml2vocab -v vocab/vocabulary.yml -t vocab/template.html
rm -rf node_modules
- name: Setup Github Pages
uses: actions/configure-pages@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
44 changes: 21 additions & 23 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ <h3>BitstringStatusListEntry</h3>
<h3>BitstringStatusListCredential</h3>

<p>
When a status list <a>verifiable credential</a> is published, it MUST be a
When a status list <a>verifiable credential</a> is published, it MUST be a
conforming document, as defined in [[VC-DATA-MODEL-2.0]], that expresses the
data model in this section. The following section describes the format of
the <a>verifiable credential</a> that encapsulates the status list:
Expand Down Expand Up @@ -491,13 +491,13 @@ <h3>BitstringStatusListCredential</h3>
</tr>
<tr>
<td>credentialSubject.type</td>
<td>
<td id="BitstringStatusList">
The `type` of the credential <a>subject</a>, which is the
status list, MUST be `BitstringStatusList`.
</td>
</tr>
<tr>
<td>credentialSubject.statusPurpose</td>
<td id="statusPurpose">credentialSubject.statusPurpose</td>
<td>
The purpose of the status entry MUST be a string. While the value of the
string is arbitrary, the following values MUST be used for their intended
Expand Down Expand Up @@ -538,7 +538,7 @@ <h3>BitstringStatusListCredential</h3>
</td>
</tr>
<tr>
<td>credentialSubject.encodedList</td>
<td id="encodedList">credentialSubject.encodedList</td>
<td>
The `encodedList` property of the credential <a>subject</a> MUST be
the GZIP-compressed [[RFC1952]], base-64 encoded [[RFC4648]] bitstring values
Expand All @@ -553,7 +553,7 @@ <h3>BitstringStatusListCredential</h3>
</td>
</tr>
<tr>
<td>credentialSubject.ttl</td>
<td id="ttl">credentialSubject.ttl</td>
Copy link
Contributor

Choose a reason for hiding this comment

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

I flagged this elsewhere -- but don't think ttl works as specified and we don't need it here. I won't object to it being added here, but we'll then just need to remove it later unless it can be shown that it works properly.

Copy link
Member Author

Choose a reason for hiding this comment

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

Please raise an issue if you haven't done so already noting why TTL doesn't work.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nevermind, I found it: #73 (comment)

<td>
The `ttl` indicates the "time to live" in milliseconds. This property MAY be
present. If not present, implementers MUST use a value of `300000` for this
Expand All @@ -565,39 +565,37 @@ <h3>BitstringStatusListCredential</h3>
</td>
</tr>
<tr>
<td>credentialSubject.size</td>
<td id="size">credentialSubject.size</td>
<td>
The `size` indicates the size of the status entry in bits. `size` MAY be
provided. If `size` is not present as a property of the `credentialStatus`, then
`size` MUST be processed as `1`. `size` MUST be an integer greater than zero.
If `size` is provided and is greater than `1`, then the property
`credentialStatus.statusMessages` MUST be present, and the number of status
`credentialStatus.statusMessage` MUST be present, and the number of status
messages must equal the number of possible values.
</td>
</tr>
<tr>
<td id="statusMessage">credentialSubject.statusMessage</td>
<td>
credentialSubject.statusMessages
</td>
<td>
The `statusMessages` property MUST be an array. If present,
The `statusMessage` property MUST be an array. If present,
the length of the array must equal the number of possible status states
indicated by `size`. `statusMessages` MAY be present if
`size` is `1`. `statusMessages` MUST be present if
indicated by `size`. `statusMessage` MAY be present if
`size` is `1`. `statusMessage` MUST be present if
`size` is greater than `1`. If not present, the message value
associated with the bit value of `0` is "unset" and the bit
value of `1` is "set".
If present, elements in the `statusMessages` array MUST contain at
If present, elements in the `statusMessage` array MUST contain at
minimum two properties:
<ul>
<li>
<li id="status">
`status`, being a string of the hex value of the status
</li>
<li>
`value`, being a string containing the associated message
<li id="message">
`message`, being a string containing the associated message
</li>
</ul>
Implementers MAY add additional values to objects in the `statusMessages` array.
Implementers MAY add additional values to objects in the `statusMessage` array.
Implementers MAY use the string value of `undefined` in the value to indicate
that a corresponding status is not defined for the associated status value, but
that it may be defined in the future. Rules for how to handle various status
Expand All @@ -607,7 +605,7 @@ <h3>BitstringStatusListCredential</h3>
</td>
</tr>
<tr>
<td>credentialSubject.reference</td>
<td id="reference">credentialSubject.reference</td>
<td>
The `reference` property provides a point for implementers to include a [[URL]]
to material related to the status. An implementer MAY include the `reference`
Expand Down Expand Up @@ -664,10 +662,10 @@ <h3>BitstringStatusListCredential</h3>
"statusPurpose": "<span class="highlight">status</span>",
"reference": "https://example.org/status-dictionary/",
"size": 2,
"statusMessages": [
{"status":"0x0", "value":"valid"},
{"status":"0x1", "value":"invalid"},
{"status":"0x2", "value":"pending_review"},
"statusMessage": [
{"status":"0x0", "message":"valid"},
{"status":"0x1", "message":"invalid"},
{"status":"0x2", "message":"pending_review"},
...
],
"encodedList": "H4sIAAAAAAAAA-3BMQEAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAIC3AYbSVKsAQAAA"
Expand Down
11 changes: 11 additions & 0 deletions vocab/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Generate RDFS vocabulary files

The script in the directory generates RDFS vocabulary files in JSON and Turtle formats, plus a human readable HTML file containing the vocabulary in RDFa, based on a simple vocabulary definition in a YAML file. This is done using the [yml2vocab](https://github.com/w3c/yml2vocab); more details about the script can also be found in the [yml2vocab readme file](https://github.com/w3c/yml2vocab).

The generation of the final files is done via a github action (see `/.github/workflows/generate-vocab-files.yml`).

## Content of the directory

- `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.html`: 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).
215 changes: 215 additions & 0 deletions vocab/template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
<html lang="en">
<head>
<meta charset='utf-8'/>
<title></title>
<script class="remove" src="https://www.w3.org/Tools/respec/respec-w3c"></script>
<script>
function remove_status_remark() {
const sotd = document.getElementById("sotd");
const p = sotd.getElementsByTagName('p')[0];
sotd.removeChild(p);
}
// Note: The vocabulary URL must be adapted for the given environment!!!!
function massageSVGLinks(utils, content, url) {
const retval = content
.replace('<svg', '<svg aria-details="#vocabulary-diagram-alt" ')
.replace(/xlink:href/g, 'href')
.replace(/href="https:\/\/www.w3.org\/ns\/credentials\/status#/g, 'href="#');
return retval;
}

</script>
<script class="remove">
var respecConfig = {
specStatus: "base",
shortName: "ns/credentials/status",
thisVersion: "https://www.w3.org/ns/credentials/status/",
doJsonLd: true,
editors: [{
name: "Ivan Herman",
url: "https://www.w3.org/People/Ivan/",
company: "W3C",
w3cid: 7382,
orcid: "0000-0003-0782-2704",
companyURL: "https://www.w3.org",
note: "v2.0"
},{
name: "Manu Sporny",
url: "http://manu.sporny.org/",
company: "Digital Bazaar",
companyURL: "http://digitalbazaar.com/",
w3cid: 41758,
note: "v1.0, v2.0"
}],
alternateFormats: [
{uri: "vocabulary.ttl", label: "Turtle"},
{uri: "vocabulary.jsonld", label: "JSON-LD"}
],
postProcess : [remove_status_remark],
inlineCSS: true,
doRDFa: false,
noIDLIn: true,
noLegacyStyle: false
};
</script>
<style type="text/css">
dl.terms dt {
float: left;
clear: left;
width: 10vw;
}

dl.terms dd {
margin-left: 15vw;
}

dl.terms dd:after {
content: '';
display: block;
clear: both;
margin-bottom: 5px;
}
table.rdfs-definition td {
vertical-align: top;
margin-right: 2em;
}
.bold {
font-weight: bold;
}
/* code {
color: red;
} */

.term_definitions section {
border-bottom-style: solid ;
border-bottom-width: 1px;
border-bottom-color: darkgrey;
}

.annoy {
background: hsla(40,100%,50%,0.95);
color: black;
padding: .75em 1em;
border: red;
border-style: solid none;
box-shadow: 0 2px 8px black;
text-align: center;
}

</style>
</head>
<body typeof="owl:Ontology">
<section id="abstract">
<p>This document describes the <span property="dc:title" id="title"></span>, i.e.,
the <span property="dc:description" id="description"></span>.
</p>
<p>Alternate versions of the vocabulary definition exist in
<a rel="alternate" href="vocabulary.ttl">Turtle</a> and
<a rel="alternate" href="vocabulary.jsonld">JSON-LD</a>.
</p>
<dl>
<dt>Published:</dt><dd><time property="dc:date" id="time"></time></dd>
<dt>Version Info:</dt>
<dd>1.0</dd>
<dt id="see_also">See Also: </dt>
</dl>
</section>
<section id="sotd">
<p>
This vocabulary has been defined by the
<a href="https://www.w3.org/2017/vc/WG/">
W3C Verifiable Credentials Working Group</a> and provides the official RDFS
vocabulary for
<a href="https://www.w3.org/TR/vc-bitstring-status-list/">
Bitstring Status Lists</a>. Comments regarding this document are welcome.
Please file issues directly on
<a href="https://github.com/w3c/vc-bitstring-status-list/issues/">GitHub</a>, or
send them to
<a href="mailto:[email protected]">[email protected]</a>
(<a href="mailto:[email protected]?subject=subscribe">
subscribe</a>,
<a href="https://lists.w3.org/Archives/Public/public-vc-comments/">
archives</a>).
</p>
</section>
<section>
<h2>Specification of terms</h2>
<p>
In general, the terms &mdash; i.e., the properties and classes &mdash; used in
the VCDM are formally specified in Recommendation Track documents published by
the <a href="https://www.w3.org/groups/wg/vc">W3C Verifiable Credentials Working
Group</a> or, for some deprecated or reserved terms, in Reports published by the
<a href="https://www.w3.org/groups/cg/credentials">W3C Credentials Community
Group</a>. In each case of such external definition, the term's description in
this document contains a link to the relevant specification. Additionally, the
`rdfs:definedBy` property in the RDFS representation(s) refers to the formal
specification.
</p>
<p>
In some cases, a local explanation is necessary to complement, or to replace,
the definition found in an external specification. For instance, this is so when
the term is needed to provide a consistent structure to the RDFS vocabulary,
such as when the term defines a common supertype for class instances that are
used as objects of specific properties. For such cases,
the extra definition is included in the current
document (and the `rdfs:comment` property is used to include them in the RDFS
representations).
</p>
</section>
<section>
<h2>Namespaces</h2>
<p>This specification makes use of the following namespaces:</p>
<dl class="terms" id="namespaces">
</dl>
</section>

<section id="term_definitions">
<h1>Regular terms</h1>

<section id="class_definitions" class="term_definitions">
<h2>Class definitions</h2>
</section>

<section id="property_definitions" class="term_definitions">
<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>
</section>

<section id="deprecated_term_definitions">
<h1>Deprecated terms</h1>

<p class="annoy">
All terms in this section are <em><strong>deprecated</strong></em>, and are only
kept in this vocabulary for backward compatibility.
</p>
<p>
New applications should not use them.
</p>

<section id="deprecated_class_definitions" class="term_definitions">
<h2>Deprecated classes</h2>
</section>

<section id="deprecated_property_definitions" class="term_definitions">
<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>
</section>

</body>
</html>
Loading
Loading