{"id":22266298,"url":"https://github.com/vsm/vsm-dictionary-remote-demo","last_synced_at":"2026-07-03T10:33:38.239Z","repository":{"id":39577412,"uuid":"123614068","full_name":"vsm/vsm-dictionary-remote-demo","owner":"vsm","description":"Small demo implementation of how a VSM-dictionary could interface with a server's API","archived":false,"fork":false,"pushed_at":"2023-01-03T23:52:03.000Z","size":1852,"stargazers_count":0,"open_issues_count":22,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T14:22:50.145Z","etag":null,"topics":["api","dictionary","identifiers","interface","ontology-search","server","terms","vsm"],"latest_commit_sha":null,"homepage":"https://github.com/vsm/vsm-dictionary","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vsm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-02T18:14:01.000Z","updated_at":"2020-08-27T20:42:03.000Z","dependencies_parsed_at":"2023-02-01T14:15:39.981Z","dependency_job_id":null,"html_url":"https://github.com/vsm/vsm-dictionary-remote-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vsm/vsm-dictionary-remote-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsm%2Fvsm-dictionary-remote-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsm%2Fvsm-dictionary-remote-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsm%2Fvsm-dictionary-remote-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsm%2Fvsm-dictionary-remote-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vsm","download_url":"https://codeload.github.com/vsm/vsm-dictionary-remote-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsm%2Fvsm-dictionary-remote-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35083008,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-03T02:00:05.635Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api","dictionary","identifiers","interface","ontology-search","server","terms","vsm"],"created_at":"2024-12-03T10:18:15.746Z","updated_at":"2026-07-03T10:33:38.220Z","avatar_url":"https://github.com/vsm.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vsm-dictionary-remote-demo\n\n\u003cbr\u003e\n\n## Summary\n\n`vsm-dictionary-remote-demo` is a tiny, partial example-implementation\nof the 'VsmDictionary' parent-class/interface (from the package\n[`vsm-dictionary`](https://github.com/vsm/vsm-dictionary)),\nto demonstrate communication with a hypothetical server API.\n\nA demo of this demo connects to a real server (see at end).\n\n\u003cbr\u003e\n\n## Background\n\n- [VSM-sentences](http://scicura.org/vsm/vsm.html)\n  are built from terms that are linked to identifiers.\n- The '[`vsm-dictionary`](https://github.com/vsm/vsm-dictionary)'\n  package defines a standardized interface,\n  for VSM-related tools to communicate with services\n  that provide terms+IDs (e.g. a webserver API).\n- It also includes the small 'VsmDictionary' parent class (/interface) that\n  provides shared functionality for concrete subclasses (like this package).\n\n\u003cbr\u003e\n\n## A web-connected implementation of a VsmDictionary\n\nThis is VsmDictionaryRemoteDemo:\n\n- The name 'VsmDictionary-_Remote_-Demo' is meant to contrast with the name of\n  the sibling package\n  '[VsmDictionary-_Local_](https://github.com/vsm/vsm-dictionary-local)'.\n- Unlike VsmDictionaryLocal which stores the data locally (=in-memory),\n  VsmDictionaryRemoteDemo communicates with a remote (=online) webserver that\n  stores the data and makes it accessible through an API.\n- VsmDictionaryRemoteDemo extends the VsmDictionary parent class, and provides\n  a bare-minimum implementation that follows the vsm-dictionary\n  [specification](https://github.com/vsm/vsm-dictionary/blob/master/Dictionary.spec.md).\n  - It simply makes the assumption that the webserver has a REST API that\n    literally supports all the spec options, and that the server returns data\n    in the exact same way as a VsmDictionary is supposed to pass it onwards.\n- It has tests:  \n  these shows how to make automated tests, based on mocking how\n  the webserver's API would respond, using a fake-server module.\n- It has a demo:  \n  see the interactive demo section.\n\n\u003cbr\u003e\n\n## What to use VsmDictionaryRemoteDemo for\n\nBecause of the above,\n\n- VsmDictionaryRemoteDemo should only be used as inspiration for\n  developing a VsmDictionary-subclass that interfaces with a real server API,\n- and for creating automated tests for it.\n- The demo (see at end) gives a live impression of how the returned\n  string-search match-objects look like.\n\n\u003cbr\u003e\n\n## Specification\n\nLike all VsmDictionary subclass implementations, this package follows\nthe parent class\n[specification](https://github.com/vsm/vsm-dictionary/blob/master/Dictionary.spec.md),\nalthough _only a fraction of it_, without adding much more.  \n\u0026bull; \u003cspan style=\"font-size: smaller;\"\u003e\n(Note: we simply use the name 'DictionaryRemoteDemo' for VsmDictionaryRemoteDemo,\nin the source code).\u003c/span\u003e  \n\n\u003cbr\u003e\n\n## Caveat\n\nBe advised to read the comments at the `_getReqObj()` method, near the end of\n[src/DictionaryRemoteDemo.js](src/DictionaryRemoteDemo.js).  \nIt explains how to make API requests in a way that works under Node.js,\nas well as in the browser (where `XMLHttpRequest` isn't/is available, resp.).\n\n\u003cbr\u003e\n\n## Tests\n\nRun `npm test`, which runs tests with Mocha.  \nRun `npm run testw`, which automatically reruns tests on any file change.\n\n\u003cbr\u003e\n\n## Interactive demo in the browser\n\nThe demo makes a further subclass of VsmDictionaryRemoteDemo,\nand adds code to parse the specific data that the dictionary-webservice\n'[PubDictionaries.org](http://pubdictionaries.org/)' returns.  \nThe demo includes _only_ string-search functionality, on a single\ndictionary of PubDictionaries at a time, and without support for any options.\n\nRun `npm run demo` to start the interactive demo.\nThis opens a browser page with an input-field to search on PubDictionaries data,\nplus a field to choose one of its ('sub'-)dictionaries.\n\nThe demo works by making a Webpack dev-server bundle all source code \n(VsmDictionaryRemoteDemo and its dependencies) and serve it to the browser.\n\nThis is useful during development, to see immediate effects of changes\nto the source code (excl. the demo code).\n\n\u003cbr\u003e\n\n## 'Build' configuration \u0026 demo\n\nTo use a VsmDictionary in Node.js, one can simply run `npm install` and then\nuse `require()`.  \nBut it is also convenient to have a version of the code that can just\nbe loaded via a \u0026lt;script\u0026gt;-tag in the browser.\n\nTherefore, we included `webpack.config.js` (note: the one in the root folder,\n_not_ the one in the 'demo' folder), which is a Webpack configuration file for\ngenerating such a browser-ready package.  \n\nBy running `npm build`, the built file will appear in a 'dist' subfolder.  \nA demo-use of this file can then be seen by opening `demo-build.html`\n(in the 'demo' folder). (It includes a\n`\u003cscript src=\"../dist/vsm-dictionary-remote-demo.min.js\"\u003e\u003c/script\u003e` tag).  \nSo after the build step, `demo-build.html` does not need Webpack to run.\n\nNote: at the time of writing (Feb. 2019), there seems to be an issue\nwith conflicting Webpack-dependencies when running a fresh `npm install`.  \nTherefore, in order to build your own VsmDictionary, it is recommended that\nyou copy the `package-lock.json` and `package.json` files from this package\nand use them as a starting point for your own project, because these files refer\nto a set of non-conflicting versions of the dependencies.\n\n\u003cbr\u003e\n\n## License\n\nThis project is licensed under the AGPL license - see [LICENSE.md](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvsm%2Fvsm-dictionary-remote-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvsm%2Fvsm-dictionary-remote-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvsm%2Fvsm-dictionary-remote-demo/lists"}