{"id":19338283,"url":"https://github.com/gbv/coli-ana","last_synced_at":"2025-04-23T01:31:24.255Z","repository":{"id":98903583,"uuid":"278105929","full_name":"gbv/coli-ana","owner":"gbv","description":"API to analyze DDC numbers","archived":false,"fork":false,"pushed_at":"2024-12-12T08:04:33.000Z","size":2001,"stargazers_count":4,"open_issues_count":20,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-02T06:21:58.766Z","etag":null,"topics":["code4lib","coli-conc","ddc"],"latest_commit_sha":null,"homepage":"https://coli-conc.gbv.de/coli-ana/app/","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":null,"contributing":null,"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}},"created_at":"2020-07-08T14:06:00.000Z","updated_at":"2024-12-12T08:04:37.000Z","dependencies_parsed_at":"2023-12-08T13:23:48.893Z","dependency_job_id":"8bbce4ab-3613-49fc-8616-e702801201e2","html_url":"https://github.com/gbv/coli-ana","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbv%2Fcoli-ana","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbv%2Fcoli-ana/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbv%2Fcoli-ana/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbv%2Fcoli-ana/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gbv","download_url":"https://codeload.github.com/gbv/coli-ana/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250352277,"owners_count":21416462,"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":["code4lib","coli-conc","ddc"],"created_at":"2024-11-10T03:16:55.053Z","updated_at":"2025-04-23T01:31:22.911Z","avatar_url":"https://github.com/gbv.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# coli-ana\n\n[![Test](https://github.com/gbv/coli-ana/actions/workflows/test.yml/badge.svg)](https://github.com/gbv/coli-ana/actions/workflows/test.yml)\n\n\u003e API to analyze DDC numbers\n\nThis repository contains an implementation of an API to analyze synthesized DDC numbers. The algorithm to split DDC numbers is not included. See \u003chttps://coli-conc.gbv.de/coli-ana/\u003e for more information.\n\n## Table of Contents \u003c!-- omit in toc --\u003e\n- [Install](#install)\n- [Usage](#usage)\n  - [`vc_day_srv` Backend Configuration](#vc_day_srv-backend-configuration)\n  - [Data dumps and statistics](#data-dumps-and-statistics)\n  - [Development](#development)\n  - [Production](#production)\n  - [K10plus enrichment](#k10plus-enrichment)\n- [Configuration](#configuration)\n- [API](#api)\n  - [GET /](#get-)\n  - [GET /analyze?notation=notations](#get-analyzenotationnotations)\n- [Maintainers](#maintainers)\n- [Publish](#publish)\n- [Contribute](#contribute)\n- [License](#license)\n\n## Install\n\nYou will need Node.js version 18 or later (20 is recommended).\n\n~~~bash\ngit clone https://github.com/gbv/coli-ana.git\ncd coli-ana\nnpm ci\n~~~\n\n## Usage\n\nThe server provides a HTTP API at port 11033 by default. (Fun fact: 11033 = Octal 025431 (025.431=Dewey Decimal Classification))\n\nIt requires access to an instance of the `vc_day_srv` backend.\n\n### `vc_day_srv` Backend Configuration\n\n`vc_day_srv` is a server component developed as part of project colibri (currently closed source) that can analyze DDC numbers and return the analyses to a client. It can be configured via `.env`:\n\n```env\n# These are the default values\nBACKEND_INTERPRETER=\"/usr/bin/awk -f\"\nBACKEND_CLIENT=./bin/vc_day_cli2\nBACKEND_HOST=localhost\nBACKEND_PORT=7070\n```\n\nThat requests are performed via the corresponding client component `vc_day_cli2` which is shipped in this repository. So no protocol should be given for host. The backend is required for the service to work. Multiple backends (for `BACKEND_HOST` and `BACKEND_PORT`) can be given and will be rotated either on connection error or on stale requests. Note that the number of hosts and ports given must match (even if the same value needs to be repeated).\n\nNote that GNU awk is required. On macOS, this can be installed with [Homebrew](https://brew.sh/) - `brew install gawk` - and configured as `BACKEND_INTERPRETER=\"/opt/homebrew/bin/gawk -f\"` (Apple Silicon) or `BACKEND_INTERPRETER=\"/usr/local/bin/gawk -f\"` (Intel).\n\n### Data dumps and statistics\n\nThe script `./bin/stats.sh` creates a database dump (unless the file already exists, so it is not updated) and calculates some statistics into `public/stats.json`.\n\n### Development\n```bash\nnpm run dev\n```\n\n### Production\n```bash\n# Bundle Vue files\nnpm run build\n# Run server in production\nnpm run serve\n```\n\nIf you use a process manager like [pm2](https://pm2.keymetrics.io/) and need to run server.js directly, make sure to append the necessary flags:\n\n```bash\nNODE_ENV=production node --experimental-json-modules -r dotenv/config server\n```\n\n### K10plus enrichment\n\n*See \u003chttps://github.com/gbv/k10plus-ddc\u003e!*\n\nDirectory `k10plus` contains legacy scripts to enrich K10plus library catalog with analyzed DDC notations. See [README.md](k10plus/README.md) in this directory.\n\nThe script `bin/labels.sh` created one text file for each DDC number in directory `labels` for full text indexing.\n\n## Configuration\n\nYou can adjust a few configuration options in `.env`. Here are the available options and default values:\n\n```bash\n# Configuration for backend service `vc_day_srv` (see above)\nBACKEND_INTERPRETER=\"/usr/bin/awk -f\"\nBACKEND_CLIENT=./bin/vc_day_cli2\nBACKEND_HOST=localhost\nBACKEND_PORT=7070\n# URL to Cocoda instance\nCOCODA=https://coli-conc.gbv.de/cocoda/app/\n# Port for Express server\nPORT=11033\n# Base for URL (e.g. when not running under root of domain)\nBASE=/\n# Verbosity for log output (log/info/warn/error)\nVERBOSITY=info\n# Settings for retries\nMAX_RETRIES=3\nRETRY_WAIT=1000\n# Timeouts in milliseconds for long (will be logged) and stale (will be killed) commands to the backend\nTIMEOUT_LONG=1000\nTIMEOUT_STALE=3000\n```\n\n## API\n\n### GET /\n\nShows a landing page with a web interface, general information, and a list of examples.\n\n### GET /analyze?notation=notations\n\nAnalyzes a DDC number in parameter `notation` and returns an array with zero or one [JSKOS concepts](https://gbv.github.io/jskos/jskos.html#concept) by default.\n\nOptional parameter `complete` with a truthy value enables filtering for completely analyzed numbers.\n\nParameter `atomic` with a truthy value returns only atomic numbers. Atomic numbers are always marked with non-standard JSKOS field `ATOMIC` having value `true`.\n\nParameter `format` can be used to chose another format (deprecated, may be removed in a later version):\n\n* `picajson` returns a [PICA/JSON](https://format.gbv.de/pica/json) record\n* `pp` returns a [PICA Plain](https://format.gbv.de/pica/plain) record; **note:** only one record can be requested at the time.\n\n## Maintainers\n- [@stefandesu](https://github.com/stefandesu)\n- [@nichtich](https://github.com/nichtich)\n\n## Publish\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\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- **Ask you to confirm the version**\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 create a new GitHub Release draft. Please edit and publish the release manually.\n\n## Contribute\nPRs accepted.\n\nSmall note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.\n\n## License\nMIT Copyright (c) 2023 Verbundzentrale des GBV (VZG)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbv%2Fcoli-ana","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgbv%2Fcoli-ana","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbv%2Fcoli-ana/lists"}