Skip to content

Commit

Permalink
Full distribution for the version with added definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
iherman committed Sep 11, 2024
1 parent eb92e5f commit 54b685d
Show file tree
Hide file tree
Showing 45 changed files with 173 additions and 138 deletions.
2 changes: 1 addition & 1 deletion dist/lib/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ function finalizeRawEntry(raw) {
domain: toArray(raw.domain),
range: toArray(raw.range),
deprecated: deprecated,
defined_by: (raw.defined_by) ? raw.defined_by : "",
defined_by: toArray(raw.defined_by) ?? [],
status: status,
comment: (raw.comment) ? cleanComment(raw.comment) : "",
see_also: toSeeAlso(raw.see_also),
Expand Down
14 changes: 12 additions & 2 deletions dist/lib/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ exports.toHTML = void 0;
*/
const common_1 = require("./common");
const jsdom_1 = require("jsdom");
// This object is need for a proper formatting of some text
const formatter = new Intl.ListFormat('en', { style: 'long', type: 'conjunction' });
/**
* A thin layer on top of the regular DOM Document. Necessary to "hide" the differences between
* the JSDOM and Deno's DOM WASM implementations; higher layers should not depend on these.
Expand Down Expand Up @@ -168,8 +170,16 @@ function toHTML(vocab, template_text) {
span.className = 'bold';
document.addChild(span, 'em', ` (${item.status})`);
}
if (item.defined_by !== "") {
document.addChild(section, 'p', `See the <a rel="rdfs:isDefinedBy" href="${item.defined_by}">formal definition of the term</a>.`);
switch (item.defined_by.length) {
case 0: break;
case 1: {
document.addChild(section, 'p', `See the <a rel="rdfs:isDefinedBy" href="${item.defined_by}">formal definition of the term</a>.`);
break;
}
default: {
const refs = item.defined_by.map((def) => `<a rel="rdfs:isDefinedBy" href="${def}">here</a>`);
document.addChild(section, 'p', `See the formal definitions ${formatter.format(refs)}.`);
}
}
if (item.comment !== "") {
let description = item.comment;
Expand Down
9 changes: 7 additions & 2 deletions dist/lib/jsonld.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,13 @@ function toJSONLD(vocab) {
"@type": "http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML"
};
}
if (entry.defined_by !== '') {
target["rdfs:isDefinedBy"] = `${entry.defined_by}`;
if (entry.defined_by.length !== 0) {
if (entry.defined_by.length === 1) {
target["rdfs:isDefinedBy"] = entry.defined_by[0];
}
else {
target["rdfs:isDefinedBy"] = entry.defined_by;
}
}
target["vs:term_status"] = `${entry.status}`;
if (entry.see_also && entry.see_also.length > 0) {
Expand Down
5 changes: 3 additions & 2 deletions dist/lib/turtle.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ function toTurtle(vocab) {
if (entry.comment !== '') {
turtle += ` rdfs:comment """<div>${entry.comment}</div>"""^^rdf:HTML ;\n`;
}
if (entry.defined_by !== '') {
turtle += ` rdfs:isDefinedBy <${entry.defined_by}>, <${common_1.global.vocab_url}> ;\n`;
if (entry.defined_by.length !== 0) {
const defs = entry.defined_by.map((def) => `<${def}>`).join(", ");
turtle += ` rdfs:isDefinedBy ${defs}, <${common_1.global.vocab_url}> ;\n`;
}
else {
turtle += ` rdfs:isDefinedBy <${common_1.global.vocab_url}> ;\n`;
Expand Down
20 changes: 18 additions & 2 deletions dist/lib/vocab.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@
"type": "string"
},
"defined_by": {
"type": "string",
"format": "uri"
"$ref": "#/$defs/URIOrArrayOfURIs"
},
"see_also": {
"$ref": "#/$defs/SeeAlso"
Expand Down Expand Up @@ -190,6 +189,23 @@
]
},

"URIOrArrayOfURIs": {
"description": "Some of the URI values may be arrays or single URIs, hence this utility schema",
"oneOf": [
{
"type": "string",
"format": "uri"
},
{
"type": "array",
"items": {
"type": "string",
"format": "uri"
}
}
]
},

"ExampleElement": {
"title" : "A single example block, with an optional label",
"type": "object",
Expand Down
14 changes: 7 additions & 7 deletions docs/classes/index.VocabGeneration.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/classes/lib_common.StatusCounter.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/enums/lib_common.Status.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/functions/index.generateVocabularyFiles.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/functions/index.generate_vocabulary_files.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/functions/lib_context.toContext.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/functions/lib_convert.getData.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/functions/lib_html.toHTML.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/functions/lib_jsonld.toJSONLD.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/functions/lib_schema.validateWithSchema.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/functions/lib_turtle.toTurtle.html

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions docs/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/interfaces/lib_common.Contexts.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/interfaces/lib_common.Example.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/interfaces/lib_common.Link.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/interfaces/lib_common.OntologyProperty.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/interfaces/lib_common.RDFClass.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/interfaces/lib_common.RDFDatatype.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/interfaces/lib_common.RDFIndividual.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/interfaces/lib_common.RDFPrefix.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/interfaces/lib_common.RDFProperty.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/interfaces/lib_common.RDFTerm.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/interfaces/lib_common.RawVocab.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/interfaces/lib_common.RawVocabEntry.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/interfaces/lib_common.ValidationError.html

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions docs/interfaces/lib_common.ValidationResults.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/interfaces/lib_common.Vocab.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/modules/index.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/modules/lib_common.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/modules/lib_context.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/modules/lib_convert.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/modules/lib_html.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/modules/lib_jsonld.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/modules/lib_schema.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/modules/lib_turtle.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/variables/lib_common.EXTRA_DATATYPES.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/variables/lib_common.global.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions previews/di/vocabulary.html

Large diffs are not rendered by default.

25 changes: 14 additions & 11 deletions previews/di/vocabulary.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"@language": "en"
},
"rdfs:seeAlso": "https://www.w3.org/TR/vc-data-integrity/",
"dc:date": "2024-07-04",
"dc:date": "2024-09-11",
"rdfs_properties": [
{
"@id": "sec:verificationMethod",
Expand Down Expand Up @@ -298,7 +298,10 @@
"@value": "<div>Historically, this property has often been expressed using `expires` as a shortened term in JSON-LD. Since this shortened term and its mapping to this property are in significant use in the ecosystem, the inconsistency between the short term name (`expires`) and the property identifier (`...#expiration`) is expected and should not trigger an error.</div>",
"@type": "http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML"
},
"rdfs:isDefinedBy": "https://www.w3.org/TR/vc-data-integrity/#defn-proof-expires",
"rdfs:isDefinedBy": [
"https://www.w3.org/TR/vc-data-integrity/#defn-proof-expires",
"https://www.w3.org/TR/controller-document/#defn-vm-expires"
],
"vs:term_status": "stable",
"mentioned": [
{
Expand Down Expand Up @@ -341,7 +344,7 @@
],
"rdfs:range": "sec:VerificationMethod",
"rdfs:label": "Authentication method",
"rdfs:isDefinedBy": "https://www.w3.org/TR/controller-document/#defn-authentication",
"rdfs:isDefinedBy": "https://www.w3.org/TR/controller-document/#authentication",
"vs:term_status": "stable",
"mentioned": [
{
Expand All @@ -366,7 +369,7 @@
],
"rdfs:range": "sec:VerificationMethod",
"rdfs:label": "Assertion method",
"rdfs:isDefinedBy": "https://www.w3.org/TR/controller-document/#defn-assertionmethod",
"rdfs:isDefinedBy": "https://www.w3.org/TR/controller-document/#assertion",
"vs:term_status": "stable",
"mentioned": [
{
Expand Down Expand Up @@ -395,7 +398,7 @@
"@value": "<div>Historically, this property has often been expressed using `capabilityDelegation` as a shortened term in JSON-LD. Since this shortened term and its mapping to this property are in significant use in the ecosystem, the inconsistency between the short term name (`capabilityDelegation`) and the property identifier (`...#capabilityDelegationMethod`) is expected and should not trigger an error.</div>",
"@type": "http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML"
},
"rdfs:isDefinedBy": "https://www.w3.org/TR/controller-document/#defn-capabilityDelegation",
"rdfs:isDefinedBy": "https://www.w3.org/TR/controller-document/#capability-delegation",
"vs:term_status": "stable",
"mentioned": [
{
Expand Down Expand Up @@ -424,7 +427,7 @@
"@value": "<div>Historically, this property has often been expressed using `capabilityInvocation` as a shortened term in JSON-LD. Since this shortened term and its mapping to this property are in significant use in the ecosystem, the inconsistency between the short term name (`capabilityInvocation`) and the property identifier (`...#capabilityInvocationMethod`) is expected and should not trigger an error.</div>",
"@type": "http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML"
},
"rdfs:isDefinedBy": "https://www.w3.org/TR/controller-document/#defn-capabilityInvocation",
"rdfs:isDefinedBy": "https://www.w3.org/TR/controller-document/#capability-invocation",
"vs:term_status": "stable",
"mentioned": [
{
Expand Down Expand Up @@ -453,7 +456,7 @@
"@value": "<div>Historically, this property has often been expressed using `keyAgreement` as a shortened term in JSON-LD. Since this shortened term and its mapping to this property are in significant use in the ecosystem, the inconsistency between the short term name (`keyAgreement`) and the property identifier (`...#keyAgreementMethod`) is expected and should not trigger an error.</div>",
"@type": "http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML"
},
"rdfs:isDefinedBy": "https://www.w3.org/TR/controller-document/#defn-keyAgreement",
"rdfs:isDefinedBy": "https://www.w3.org/TR/controller-document/#key-agreement",
"vs:term_status": "stable",
"mentioned": [
{
Expand Down Expand Up @@ -1079,17 +1082,17 @@
"vs:term_status": "stable"
},
{
"@id": "sec:MALFORMED_PROOF_ERROR",
"@id": "sec:PROOF_VERIFICATION_ERROR",
"@type": "sec:ProcessingError",
"rdfs:label": "Malformed proof (-17)",
"rdfs:isDefinedBy": "https://www.w3.org/TR/vc-data-integrity/#MALFORMED_PROOF_ERROR",
"rdfs:isDefinedBy": "https://www.w3.org/TR/vc-data-integrity/#PROOF_VERIFICATION_ERROR",
"vs:term_status": "stable"
},
{
"@id": "sec:MISMATCHED_PROOF_PURPOSE_ERROR",
"@id": "sec:PROOF_TRANSFORMATION_ERROR",
"@type": "sec:ProcessingError",
"rdfs:label": "Mismatched proof purpose (-18)",
"rdfs:isDefinedBy": "https://www.w3.org/TR/vc-data-integrity/#MISMATCHED_PROOF_PURPOSE_ERROR",
"rdfs:isDefinedBy": "https://www.w3.org/TR/vc-data-integrity/#PROOF_TRANSFORMATION_ERROR",
"vs:term_status": "stable"
},
{
Expand Down
22 changes: 11 additions & 11 deletions previews/di/vocabulary.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sec: a owl:Ontology ;
dc:description """vocabulary used to ensure the authenticity and integrity of Verifiable Credentials and similar types of constrained digital documents using cryptography, especially through the use of digital signatures and related mathematical proofs
"""@en ;
rdfs:seeAlso <https://www.w3.org/TR/vc-data-integrity/> ;
dc:date "2024-07-04"^^xsd:date ;
dc:date "2024-09-11"^^xsd:date ;
.

# Property definitions
Expand Down Expand Up @@ -94,7 +94,7 @@ sec:expiration a rdf:Property, owl:DatatypeProperty ;
rdfs:range xsd:dateTime ;
rdfs:label "Expiration time for a proof or verification method" ;
rdfs:comment """<div>Historically, this property has often been expressed using `expires` as a shortened term in JSON-LD. Since this shortened term and its mapping to this property are in significant use in the ecosystem, the inconsistency between the short term name (`expires`) and the property identifier (`...#expiration`) is expected and should not trigger an error.</div>"""^^rdf:HTML ;
rdfs:isDefinedBy <https://www.w3.org/TR/vc-data-integrity/#defn-proof-expires>, <https://w3id.org/security#> ;
rdfs:isDefinedBy <https://www.w3.org/TR/vc-data-integrity/#defn-proof-expires>, <https://www.w3.org/TR/controller-document/#defn-vm-expires>, <https://w3id.org/security#> ;
vs:term_status "stable" ;
.

Expand All @@ -109,38 +109,38 @@ sec:nonce a rdf:Property, owl:DatatypeProperty ;
sec:authentication a rdf:Property, sec:VerificationRelationship ;
rdfs:range sec:VerificationMethod ;
rdfs:label "Authentication method" ;
rdfs:isDefinedBy <https://www.w3.org/TR/controller-document/#defn-authentication>, <https://w3id.org/security#> ;
rdfs:isDefinedBy <https://www.w3.org/TR/controller-document/#authentication>, <https://w3id.org/security#> ;
vs:term_status "stable" ;
.

sec:assertionMethod a rdf:Property, sec:VerificationRelationship ;
rdfs:range sec:VerificationMethod ;
rdfs:label "Assertion method" ;
rdfs:isDefinedBy <https://www.w3.org/TR/controller-document/#defn-assertionmethod>, <https://w3id.org/security#> ;
rdfs:isDefinedBy <https://www.w3.org/TR/controller-document/#assertion>, <https://w3id.org/security#> ;
vs:term_status "stable" ;
.

sec:capabilityDelegationMethod a rdf:Property, sec:VerificationRelationship ;
rdfs:range sec:VerificationMethod ;
rdfs:label "Capability delegation method" ;
rdfs:comment """<div>Historically, this property has often been expressed using `capabilityDelegation` as a shortened term in JSON-LD. Since this shortened term and its mapping to this property are in significant use in the ecosystem, the inconsistency between the short term name (`capabilityDelegation`) and the property identifier (`...#capabilityDelegationMethod`) is expected and should not trigger an error.</div>"""^^rdf:HTML ;
rdfs:isDefinedBy <https://www.w3.org/TR/controller-document/#defn-capabilityDelegation>, <https://w3id.org/security#> ;
rdfs:isDefinedBy <https://www.w3.org/TR/controller-document/#capability-delegation>, <https://w3id.org/security#> ;
vs:term_status "stable" ;
.

sec:capabilityInvocationMethod a rdf:Property, sec:VerificationRelationship ;
rdfs:range sec:VerificationMethod ;
rdfs:label "Capability invocation method" ;
rdfs:comment """<div>Historically, this property has often been expressed using `capabilityInvocation` as a shortened term in JSON-LD. Since this shortened term and its mapping to this property are in significant use in the ecosystem, the inconsistency between the short term name (`capabilityInvocation`) and the property identifier (`...#capabilityInvocationMethod`) is expected and should not trigger an error.</div>"""^^rdf:HTML ;
rdfs:isDefinedBy <https://www.w3.org/TR/controller-document/#defn-capabilityInvocation>, <https://w3id.org/security#> ;
rdfs:isDefinedBy <https://www.w3.org/TR/controller-document/#capability-invocation>, <https://w3id.org/security#> ;
vs:term_status "stable" ;
.

sec:keyAgreementMethod a rdf:Property, sec:VerificationRelationship ;
rdfs:range sec:VerificationMethod ;
rdfs:label "Key agreement protocols" ;
rdfs:comment """<div>Historically, this property has often been expressed using `keyAgreement` as a shortened term in JSON-LD. Since this shortened term and its mapping to this property are in significant use in the ecosystem, the inconsistency between the short term name (`keyAgreement`) and the property identifier (`...#keyAgreementMethod`) is expected and should not trigger an error.</div>"""^^rdf:HTML ;
rdfs:isDefinedBy <https://www.w3.org/TR/controller-document/#defn-keyAgreement>, <https://w3id.org/security#> ;
rdfs:isDefinedBy <https://www.w3.org/TR/controller-document/#key-agreement>, <https://w3id.org/security#> ;
vs:term_status "stable" ;
.

Expand Down Expand Up @@ -484,15 +484,15 @@ sec:PROOF_GENERATION_ERROR a sec:ProcessingError ;
vs:term_status "stable" ;
.

sec:MALFORMED_PROOF_ERROR a sec:ProcessingError ;
sec:PROOF_VERIFICATION_ERROR a sec:ProcessingError ;
rdfs:label "Malformed proof (-17)" ;
rdfs:isDefinedBy <https://www.w3.org/TR/vc-data-integrity/#MALFORMED_PROOF_ERROR>, <https://w3id.org/security#> ;
rdfs:isDefinedBy <https://www.w3.org/TR/vc-data-integrity/#PROOF_VERIFICATION_ERROR>, <https://w3id.org/security#> ;
vs:term_status "stable" ;
.

sec:MISMATCHED_PROOF_PURPOSE_ERROR a sec:ProcessingError ;
sec:PROOF_TRANSFORMATION_ERROR a sec:ProcessingError ;
rdfs:label "Mismatched proof purpose (-18)" ;
rdfs:isDefinedBy <https://www.w3.org/TR/vc-data-integrity/#MISMATCHED_PROOF_PURPOSE_ERROR>, <https://w3id.org/security#> ;
rdfs:isDefinedBy <https://www.w3.org/TR/vc-data-integrity/#PROOF_TRANSFORMATION_ERROR>, <https://w3id.org/security#> ;
vs:term_status "stable" ;
.

Expand Down

0 comments on commit 54b685d

Please sign in to comment.