w3c / yml2vocab

Generate RDFS vocabulary files from YAML
https://w3c.github.io/yml2vocab
Other
14 stars 5 forks source link

Adding context information to vocabularies #24

Closed iherman closed 8 months ago

iherman commented 8 months ago

This PR adds a new feature to the tool: the ability to add context information to the vocabularies. Ie, listing JSON-LD @context files that mention specific terms in the vocabulary (knowing that such list is not exhaustive, there may be several context files out there). This is done by adding an extra key to the vocabulary.yml files (context) which may contain a list of URLs. The tool then generates extra RDF information about this (using the schema.org/mentions and http://www.w3.org/ns/json-ld#Context terms) and, most importantly, it also displays these in human-readable form in the HTML versions.

To test, but also demonstrate, I have made changes (not yet in their home repos) for the vcdm, di, and bsl vocabularies. Here is how they look:

there are references to the context files defined by the VC, and it also includes the DID context file (just for the fun of it...).

(I set you as 'reviewers' just to adequately call your attention. No worries if you do not want to make a full code review, it is really way too much to ask. But a look at the result above may be very helpful.)

iherman commented 8 months ago

B.t.w., if you do want to look at the code, you can ignore most of what is on the change list; all relevant changes are in the .ts files and the single json schema file. Almost everything else is generated (translation to .js, documentations, etc).

iherman commented 8 months ago

@msporny, is it o.k. if I merge (and deploy!) this version? This would be followed by PR-s for all three vocabularies...