@jmk-org-pl/vocab
v0.1.1
Published
Access your vocabularies as datasets or n-quads
Downloads
4
Maintainers
Readme
@zazuko/build-your-vocabularies
Roll your own vocabularies package which will export your ontologies/vocabularies as n-quads and code modules.
Preparation
Having created a repository from this template, follow the instructions below to create a package with your vocabularies.
- Adjust
package.json, at the least by:- changing the name
- changing the
binname - changing the
indexBaseinfetchscript - possibly remove
private: true
- Prepare your vocabularies:
- add their prefix/namespace pairs in src/prefixes.ts
- if necessary, set up their fetch routine in
build/overrides.ts - see here for examples of various overrides
- local vocabularies can be created in src/vocabulary as RDF sources
npm run fetch- optionally call as
npm run fetch -- <prefix>to fetch+process only one
- optionally call as
- Customise this readme
- Commit the result
- Bump version and publish your package
- Might consider setting CI automation
Check the example branch for inspiration
Usage
The final product will be an extension to the @zazuko/rdf-vocabularies, albeit with side effects. Simply import in your project the to have you prefixes added to the default selection.
// replace with your package name
import '@zazuko/build-your-vocabularies'Additionally, modules exporting @rdfjs/namespace builders will be generated.
// default builders
import { prefixA } from '@zazuko/build-your-vocabularies/builders'
// strict builders prevent constructing terms which are not defined in vocabulary
import { prefixB } from '@zazuko/build-your-vocabularies/builders/strict'Check @zazuko/rdf-vocabularies readme for detailed usage instructions.
