{"id":15653449,"url":"https://github.com/snvfk1n/validate-web-annotation","last_synced_at":"2026-02-23T13:08:16.998Z","repository":{"id":42752234,"uuid":"279645176","full_name":"snvfk1n/validate-web-annotation","owner":"snvfk1n","description":"Validate JSON objects against the Web Annotation Data Model specification","archived":false,"fork":false,"pushed_at":"2023-03-05T06:02:37.000Z","size":63,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-27T03:24:39.254Z","etag":null,"topics":["annotation","validation","web-annotation"],"latest_commit_sha":null,"homepage":"","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/snvfk1n.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-14T17:03:07.000Z","updated_at":"2025-01-23T14:44:51.000Z","dependencies_parsed_at":"2024-10-23T03:37:01.315Z","dependency_job_id":null,"html_url":"https://github.com/snvfk1n/validate-web-annotation","commit_stats":null,"previous_names":["falafeljan/validate-web-annotation","snvfk1n/validate-web-annotation"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snvfk1n%2Fvalidate-web-annotation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snvfk1n%2Fvalidate-web-annotation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snvfk1n%2Fvalidate-web-annotation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snvfk1n%2Fvalidate-web-annotation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snvfk1n","download_url":"https://codeload.github.com/snvfk1n/validate-web-annotation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251788920,"owners_count":21644075,"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":["annotation","validation","web-annotation"],"created_at":"2024-10-03T12:45:43.649Z","updated_at":"2026-02-23T13:08:11.978Z","avatar_url":"https://github.com/snvfk1n.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Validating Web Annotations\n\nA JavaScript library for validating JSON objects against the [Web Annotation Data Model (WADM) specification](https://www.w3.org/TR/annotation-model/) via [JSON Schema](https://json-schema.org).\n\n`npm install validate-web-annotation`\n\nThis library is still under active development and only partially covers the WADM specification. While most general-purpose properties of an annotation are being properly validated (e.g., `id`, `target`, `body`), more specific properties such as `purpose` and `state` are missing validation. I intend this library to perform efficiently and general-purpose rather than covering the whole WADM specification. I'll explicitly specify the validation coverage in future versions.\n\n## API\n\nThis library exposes a simple function for validating annotations:\n\n`validateAnnotation(annotation, opts = {})`\n\nOptions:\n* `optionalId`: The annotation's ID (`annotation.id`) becomes optional. Suited for validating not-yet-persisted annotations.\n\nReturns a boolean value on whether the input is valid or not.\n\n```js\n// see ./example.js for a full example\nconst validateAnnotation = require(\"validate-web-annotation\");\nconst annotation = {\n  \"@context\": \"http://www.w3.org/ns/anno.jsonld\",\n  id: \"http://example.org/anno1\",\n  type: \"Annotation\",\n  // ...\n};\nconst valid = validateAnnotation(annotation);\n```\n\n## Benchmarks\n\nIn order to collect benchmarks on the schema-based validation approach, run the benchmarking suite (which uses [benchmark.js](https://benchmarkjs.com)) via `npm run bench`.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnvfk1n%2Fvalidate-web-annotation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnvfk1n%2Fvalidate-web-annotation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnvfk1n%2Fvalidate-web-annotation/lists"}