{"id":19338484,"url":"https://github.com/gbv/jskos-cli","last_synced_at":"2025-07-04T03:35:26.512Z","repository":{"id":33739409,"uuid":"160820569","full_name":"gbv/jskos-cli","owner":"gbv","description":"Command Line Applications to process JSKOS data format","archived":false,"fork":false,"pushed_at":"2025-06-18T06:18:01.000Z","size":447,"stargazers_count":4,"open_issues_count":13,"forks_count":1,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-06-18T06:18:58.362Z","etag":null,"topics":["cli","code4lib","coli-conc","jskos"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gbv.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-12-07T12:24:07.000Z","updated_at":"2025-06-17T19:29:55.000Z","dependencies_parsed_at":"2023-01-15T02:17:21.342Z","dependency_job_id":"dbbb2d1e-c043-44c8-9653-ab82b0f787db","html_url":"https://github.com/gbv/jskos-cli","commit_stats":{"total_commits":104,"total_committers":2,"mean_commits":52.0,"dds":0.1923076923076923,"last_synced_commit":"2630c34d80ef9aafd80b9b69f02f2773ecb937d9"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"purl":"pkg:github/gbv/jskos-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbv%2Fjskos-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbv%2Fjskos-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbv%2Fjskos-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbv%2Fjskos-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gbv","download_url":"https://codeload.github.com/gbv/jskos-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbv%2Fjskos-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263440997,"owners_count":23467023,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","code4lib","coli-conc","jskos"],"created_at":"2024-11-10T03:17:36.844Z","updated_at":"2025-07-04T03:35:26.500Z","avatar_url":"https://github.com/gbv.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSKOS Command Line Interface\n\n[![Test](https://github.com/gbv/jskos-cli/actions/workflows/test.yml/badge.svg)](https://github.com/gbv/jskos-cli/actions/workflows/test.yml)\n[![GitHub package version](https://img.shields.io/github/package-json/v/gbv/jskos-cli.svg?label=version)](https://github.com/gbv/jskos-cli)\n[![NPM package name](https://img.shields.io/badge/npm-jskos--cli-blue.svg)](https://www.npmjs.com/package/jskos-cli)\n[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg)](https://github.com/RichardLitt/standard-readme)\n\n\u003e Command Line Applications to process JSKOS data format.\n\nThis repository contains command client applications for working with the [JSKOS data format for knowledge organization systems](http://gbv.github.io/jskos/). The applications are basically wrappers around [jskos-validate](https://www.npmjs.com/package/jskos-validate) and [jskos-tools](https://www.npmjs.com/package/jskos-tools).\n\n## Table of Contents\n\n- [Install](#install)\n- [Usage](#usage)\n  - [jskos-validate](#jskos-validate)\n  - [jskos-convert](#jskos-convert)\n  - [jskos-enrich](#jskos-enrich)\n- [Data flow](#data-flow)\n- [Maintainers](#maintainers)\n- [Publish](#publish)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Install\n\nInstall globally to provide commands `jskos-validate` and `jskos-convert`:\n\n```bash\nnpm install -g jskos-cli\n```\n\n## Usage\n\n### jskos-validate\n\nValidate a set of ndjson files in JSKOS format.\n\n~~~\n\nUsage: jskos-validate [options] [type] files...\n\nOptions:\n  -V, --version  output the version number\n  -q, --quiet    suppress status messages\n  --list-types   list JSKOS object types\n  -v, --verbose  show error messages\n  -u, --unknown  allow unknown fields\n  -h, --help     output usage information\n\nExamples:\n  $ jskos-validate -v concepts concepts.ndjson\n  $ jskos-validate -u mappings mappings.ndjson\n  $ jskos-validate schemes.ndjson concepts.ndjson\n~~~\n\nValidation result is emitted in [TAP format](https://testanything.org/). Errors are reported as diagnostic lines with record number. If JSKOS is read from standard input, only invalid records are reported. Exit code is the number of errors (up to 100).\n\n### jskos-convert\n\nConvert between JSKOS and other formats (by now only CSV and RDF/N-Triples).\n\n~~~\nUsage: jskos-convert [options] [type] [files...]\n\nOptions:\n  -V, --version                          output the version number\n  -q, --quiet                            suppress status messages\n  --list-types                           list JSKOS object types\n  -f, --from \u003cformat\u003e                    input format (ndjson or csv)\n  -t, --to \u003cformat\u003e                      output format (ndjson, csv, nt)\n  -c, --clean                            cleanup input data\n  -v, --validate                         validate and omit invalid records\n  -l, --language \u003clang\u003e                  include labels (use '-' for any language)\n  -r, --registry \u003cfile\u003e                  registry file with schemes, types... to look up\n  -s, --scheme \u003curi|notation|file\u003e       concept scheme to convert concepts or mappings\n  -d, --destination \u003curi|notation|file\u003e  target scheme to convert mappings\n  -p, --partof \u003curi\u003e                     concordance URI\n  -m, --marktop                          explicitly mark concepts without broader as top concepts\n  --creator \u003curi and/or name\u003e            add creator to mappings\n  -h, --help                             display help for command\n\nExamples:\n  $ jskos-convert mappings -t csv mappings.ndjson\n  $ jskos-convert concepts -r registry.json -s example http://example.org/jskos.csv\n~~~\n\nConcepts in CSV format can be specified with:\n\n* `notation` to build URIs from\n* `prefLabel` (if default language is specified) and `prefLabel@xx` (with explicit language code `xx`)\n* `altLabel` (if default language is specified) and `altLabel@xx` (with explicit language code `xx`)\n* `scopeNote` (if default language is specified) and `scopeNote@xx` (with explicit language code `xx`)\n* `level` and/or `broaderNotation` for hierarchies. CSV output uses `broaderNotation`.\n\nMulti-hierarchies are not supported when converting from and/or to CSV.\n\nMappings in CSV format can be specified with:\n\n* `fromNotation`\n* `fromLabel` (if a language is specified, ignored when converting from CSV)\n* `toNotation`\n* `toLabel` (if a language is specified, ignored when converting from CSV)\n* `type`\n* `creator` (URI and/or name, separated by a space, in that order; e.g: \"https://github.com/stefandesu Stefan Peters\")\n* `created` (Date of creation)\n* `uri` (URI of a mapping)\n\n1-to-n mappings are not supported yet.\n\n\n### jskos-enrich\n\n~~~\nUsage: jskos-enrich [options] [input.ndjson] [output.ndjson]\n\nOptions:\n  -V, --version                  Output the version number\n  -q, --quiet                    Suppress enrichment warnings (default)\n  -v, --verbose                  Show detailed warning and error messages\n  --properties \u003clist\u003e            Comma-separated JSKOS properties to enrich\n                                 (default: all set-type props:\n                                 creator, contributor, source, publisher,\n                                 partOf, startPlace, endPlace, place,\n                                 replacedBy, basedOn, subject, subjectOf)\n  --schemes \u003cfile\u003e               Path to a custom configuration file\n                                 (default: ./config/default_config.json)\n  -h, --help                     Output usage information\n\nExamples:\n  # Enrich subjects, creators, etc., using default config, no warnings\n  $ jskos-enrich input.ndjson output_enriched.ndjson\n\n  # Enrich only subject and creator fields\n  $ jskos-enrich input.ndjson output_enriched.ndjson --properties subject,creator\n\n  # Use a custom scheme configuration and see warnings\n  $ jskos-enrich -v input.ndjson output_enriched.ndjson  --schemes ../config/custom_config.json\n~~~\n\nThe **jskos-enrich** command reads newline-delimited JSKOS records (NDJSON), iterates over specified array-properties (e.g. `subject`, `creator`, `publisher`, etc.), and enriches each entry by adding a `prefLabel` from external concept registries (e.g. DDC, EuroVoc, ILC) via the configured APIs given in `--schemes`.\n\n- **Input:** one JSKOS record per line in `input.ndjson`\n\n- **Output:** enriched records written line-by-line to `output.ndjson`\n\n- **`--properties \u003clist\u003e`**  \n  Target which JSKOS `set-type` properties to enrich. Provide names separated by commas. Default: \"creator,contributor,source,publisher,partOf,startPlace,endPlace,place,replacedBy,basedOn,subject,subjectOf\".\n  \n- **`--schemes \u003cfile\u003e`**  \n  Path to a JSON configuration file that exports an array of scheme definitions, each with:\n  \n  - `uriPattern` for matching URIs\n  - `API` endpoints for enrichment  \n    Defaults to `./config/default_config.json`.\n\nFor each record and property, `uri` or `url` values are collected, skipping entries already having `prefLabel`, and corresponding concepts are fetched in parallel via cocoda-sdk. If no `prefLabel` was found, warnings are emitted in verbose mode.\n\n## Data flow\n\n```mermaid\ngraph TD\n   jskosin(JSKOS)\n    csvin(CSV)\n    report(report)\n    jskosout(JSKOS)\n    csvout(CSV)\n    \n    jskosin --\u003e jskos-validate\n    jskosin -- schemes, mappings \u0026 concepts --\u003e jskos-convert\n    csvin -- mappings \u0026 concepts --\u003e jskos-convert\n    jskosin --\u003e jskos-enrich\n\n    jskos-convert -- mappings \u0026 concepts --\u003e csvout\n    jskos-convert -- mappings \u0026 concepts --\u003e jskosout\n\n    subgraph jskos-cli [ ]\n        jskos-validate[**jskos-validate**]\n        jskos-convert[**jskos-convert**]\n        jskos-enrich[**jskos-enrich**]\n    end\n    jskos-validate --\u003e report\n    jskos-enrich --\u003e JSKOS\n```\n\n## Maintainers\n\n- [@nichtich](https://github.com/nichtich)\n- [@rodolv-commons](https://github.com/rodolv-commons)\n\n## Publish\n\nPlease work on the `dev` branch during development (or better yet, develop in a feature branch and merge into `dev` when ready).\n\nWhen a new release is ready (i.e. the features are finished, merged into `dev`, and all tests succeed), run the included release script (replace \"patch\" with \"minor\" or \"major\" if necessary):\n\n```bash\nnpm run release:patch # or minor, or major\n```\n\nThis will:\n- Check that we are on `dev`\n- Run tests and build to make sure everything works\n- Make sure `dev` is up-to-date\n- Run `npm version patch` (or \"minor\"/\"major\")\n- Push changes to `dev`\n- Switch to `main`\n- Merge changes from `dev`\n- Push `main` with tags\n- Switch back to `dev`\n\nAfter running this, GitHub Actions will **automatically publish the new version to npm**. It will also create a new GitHub Release draft. Please **edit and publish the release draft manually**.\n\n## Contributing\n\nContributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for details!\n\n## License\n\nMIT (c) 2020 Verbundzentrale des GBV (VZG)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbv%2Fjskos-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgbv%2Fjskos-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbv%2Fjskos-cli/lists"}