Skip to content

feat(vocab): setup yml2vocab for managing the LWS vocabulary and json-ld context#112

Merged
laurensdeb merged 14 commits into
mainfrom
feat/yml2vocab
Apr 13, 2026
Merged

feat(vocab): setup yml2vocab for managing the LWS vocabulary and json-ld context#112
laurensdeb merged 14 commits into
mainfrom
feat/yml2vocab

Conversation

@laurensdeb

Copy link
Copy Markdown
Contributor

This pull request introduces a build system and documentation for the Linked Web Storage Vocabulary, automating the generation of vocabulary artifacts from a YAML source and providing a standards-compliant HTML specification. It includes configuration for GitHub Actions, project dependencies, and initial vocabulary files in multiple formats.

Build automation and workflow setup:

  • Added a GitHub Actions workflow (.github/workflows/build-vocab.yml) to automatically build and commit vocabulary artifacts (index.html, vocabulary.ttl, vocabulary.jsonld, vocabulary.context.jsonld) when relevant source files change.
  • Added a package.json with a build script using yml2vocab and listed yml2vocab as a development dependency.
  • Added .gitignore to exclude node_modules/ from version control.

Vocabulary documentation and specification:

  • Added template.html as the ReSpec-based HTML template for generating the vocabulary specification, supporting reserved and deprecated terms, namespaces, and context files.
  • Added an auto-generated index.html providing a human-readable, standards-compliant specification for the Linked Web Storage Vocabulary, including property and class definitions, namespace documentation, and context references.

Vocabulary data formats:

  • Added a JSON-LD context file (vocabulary.context.jsonld) defining the mapping of vocabulary terms to IRIs and their structure for use with JSON-LD consumers.

Attribution

This PR relies on the yml2vocab tooling which enables this workflow.

@laurensdeb laurensdeb marked this pull request as ready for review March 29, 2026 18:38
@laurensdeb laurensdeb added the editorial This issue or pull-request is editorial in nature label Mar 30, 2026
@pchampin

Copy link
Copy Markdown
Contributor

Thanks @laurensdeb this looks great, overall.

One concern, though: I'm generally reluctant to include generated files in the main branch. I would find it cleaner if the provided github action was restricted to GH pages generations.

Eitherway, I think we should have a README in the lws10-vocab folder, listing all the generated files (whether they are commited or not), and providing instructions on how to generate/update them (people will want to see locally the effect of the changes they make to the YAML file or the template).

Comment thread lws10-vocab/vocabulary.yml Outdated
Comment thread lws10-vocab/template.html Outdated
laurensdeb and others added 3 commits March 30, 2026 15:08
Added company and companyURL fields for editors and authors.
Added new properties for 'updated' and 'size' in vocabulary.

@ebremer ebremer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I added
'''

  • id: as:updated
    label: modified
    domain: lws:DataResource
    range: xsd:dateTime
    comment: The date and time the resource was last modified.

  • id: schema:size
    label: size
    domain: lws:DataResource
    range: xsd:long
    comment: The size of the resource in bytes.
    '''
    to the vocabulary.yaml file. The generated files will need an update.

Added README.md with information about LWS Vocabulary.

@ebremer ebremer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I added two missing terms and the README.md for which files are auto-generated

@pchampin

pchampin commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Nipicking: my understanding is that, in yml2vocab, "imported" terms are expected to be described by described_by (pointing to the definition of the term, either in a vocabulary or a specification) rather than comment, which should be used for "local" terms.
@iherman do you confirm? Or am I overinterpreting?

@iherman

iherman commented Apr 2, 2026

Copy link
Copy Markdown
Member

@iherman do you confirm? Or am I overinterpreting?

defined_by can be used for any term, both local and imported. The same for comment. The former is usually a URL, the latter a text.

@pchampin

pchampin commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

@iherman do you confirm? Or am I overinterpreting?

defined_by can be used for any term, both local and imported. The same for comment. The former is usually a URL, the latter a text.

I stand corrected, then. Thx @iherman

@pchampin pchampin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

good to go, keeping in mind that eventually, the generated files should be kept out of the repo

Comment thread lws10-vocab/index.html Outdated
Comment on lines +20 to +27
editors: [{
name: "Jesse Wright"
}, {
name: "Erich Bremer"
}],
authors: [{
name: "Laurens Debackere"
}],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Affiliation information needs to be added - similar to https://github.com/w3c/lws-protocol/pull/111/changes

- Deploy entire repo to GitHub Pages instead of committing generated files
- Remove generated vocab artifacts from git tracking
- Update lws10-vocab/.gitignore to exclude generated files
@laurensdeb laurensdeb merged commit 713409e into main Apr 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

editorial This issue or pull-request is editorial in nature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants