{"id":23009868,"url":"https://github.com/openactive/data-models","last_synced_at":"2025-07-30T01:03:09.869Z","repository":{"id":37789892,"uuid":"141424819","full_name":"openactive/data-models","owner":"openactive","description":"Data models used to drive OpenActive validator and developer documentation","archived":false,"fork":false,"pushed_at":"2025-05-27T13:26:54.000Z","size":1406,"stargazers_count":1,"open_issues_count":17,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-07-06T17:05:12.194Z","etag":null,"topics":["validators"],"latest_commit_sha":null,"homepage":"http://openactive.io/data-models/","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/openactive.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":"2018-07-18T11:20:06.000Z","updated_at":"2025-02-25T11:03:39.000Z","dependencies_parsed_at":"2023-09-21T20:31:24.591Z","dependency_job_id":"bfce49cc-5544-43ea-8ca0-31e161dacb39","html_url":"https://github.com/openactive/data-models","commit_stats":{"total_commits":977,"total_committers":12,"mean_commits":81.41666666666667,"dds":0.3039918116683725,"last_synced_commit":"61e0ddb7166bec36cee53c9fb5a1882282abc78a"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/openactive/data-models","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openactive%2Fdata-models","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openactive%2Fdata-models/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openactive%2Fdata-models/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openactive%2Fdata-models/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openactive","download_url":"https://codeload.github.com/openactive/data-models/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openactive%2Fdata-models/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267790255,"owners_count":24144816,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"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":["validators"],"created_at":"2024-12-15T09:16:15.089Z","updated_at":"2025-07-30T01:03:09.772Z","avatar_url":"https://github.com/openactive.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenActive Data Models\n\nData models used to drive the OpenActive validator and developer documentation.\n\n[![Tests](https://github.com/openactive/data-models/actions/workflows/npm-test.yml/badge.svg?branch=master)](https://github.com/openactive/data-models/actions/workflows/npm-test.yml)\n[![Known Vulnerabilities](https://snyk.io/test/github/openactive/data-models/badge.svg)](https://snyk.io/test/github/openactive/data-models)\n\n## Introduction\n\nThis library provides all the JSON representations of the models in the `versions/\u003cversion\u003e/models` directory. It is capable of storing multiple versions of the spec.\n\n## API\n\nThe library provides various exports:\n\n#### getExamples([version])\n\nReturns a list of examples relating to the specification version supplied.\n\nEach object in the list should contain the following keys:\n\n* **name** - A human-readable name describing the example.\n* **file** - The file the example is in.\n\n##### Example\n\n```js\n\nconst { getExamples } = require('@openactive/data-models');\n\nconst examples = getExamples('2.0');\n\n// [\n//   {\n//     \"file\": \"event_example_1.json\",\n//     \"name\": \"Example Event\"\n//   },\n//   // ...\n// ]\n\n```\n\n#### getExamplesWithContent([version])\n\nReturns a list of examples relating to the specification version supplied, that includes the JSON content of these examples.\n\nEach object in the list should contain the following keys:\n\n* **name** - A human-readable name describing the example.\n* **file** - The file the example is in.\n* **data** - The JSON data of the example file.\n\n##### Example\n\n```js\n\nconst { getExamplesWithContent } = require('@openactive/data-models');\n\n(async () =\u003e {\n  const examples = await getExamplesWithContent('2.0');\n\n  // [\n  //   {\n  //     \"file\": \"event_example_1.json\",\n  //     \"name\": \"Example Event\",\n  //     \"data\": { ... }\n  //   },\n  //   // ...\n  // ]\n})();\n\n\n```\n\n#### getFullyQualifiedProperty(name [, version [, contexts]])\n\nReturns a resolved version of a property, indicating its namespace, prefix and alias. It will by default insert the OpenActive context for the provided specification version at the top of the context tree.\n\n##### Example\n\n```js\n\nconst { getFullyQualifiedProperty } = require('@openactive/data-models');\n\nlet info = getFullyQualifiedProperty('type');\n\n// {\n//   \"prefix\": null,\n//   \"namespace\": null,\n//   \"label\": \"@type\",\n//   \"alias\": \"type\",\n// }\n\nlet info = getFullyQualifiedProperty('meetingPoint', '2.0');\n\n// {\n//   \"prefix\": \"oa\",\n//   \"namespace\": \"https://openactive.io/\",\n//   \"label\": \"meetingPoint\",\n//   \"alias\": \"meetingPoint\",\n// }\n\nlet info = getFullyQualifiedProperty('schema:name', '2.0');\n\n// {\n//   \"prefix\": \"schema\",\n//   \"namespace\": \"https://schema.org/\",\n//   \"label\": \"name\",\n//   \"alias\": null,\n// }\n\nlet info = getFullyQualifiedProperty('beta:field', '2.0');\n\n// {\n//   \"prefix\": null,\n//   \"namespace\": null,\n//   \"label\": \"beta:field\",\n//   \"alias\": null,\n// }\n\n```\n\n#### getMetaData([version])\n\nReturns the meta data relating to the specification version supplied.\n\nThe meta data should contain the following keys:\n\n* **defaultPrefix** - The default prefix that is used in the `@vocab` field of the OpenActive JSON-LD definition.\n* **openActivePrefix** - The prefix used for OpenActive fields\n* **contextUrl** - The URL that the JSON context of this specification is published at\n* **specUrl** - The URL that the human-readable version of this specification is published at\n* **defaultActivityLists** - An array of activity list URLs that accompany this spec\n* **baseGraph** - A base object used when generating the `@graph` property of the OpenActive JSON-LD definition.\n* **keywords** - A map of aliases for JSON-LD keywords.\n* **namespaces** - A map of prefixes to namespaces used in the OpenActive JSON-LD definition.\n* **feedConfigurations** - A map of feed configurations, to be used by the Dataset Site generators.\n\n##### Example\n\n```js\n\nconst { getMetaData } = require('@openactive/data-models');\n\nconst metaData = getMetaData('2.0');\n\n// {\n//   \"defaultPrefix\": \"schema\",\n//   \"openActivePrefix\": \"oa\",\n//   \"contextUrl\": \"https://openactive.io/\",\n//   \"specUrl\": \"https://openactive.io/modelling-opportunity-data/EditorsDraft/\",\n//   \"defaultActivityLists\": [\n//     \"https://openactive.io/activity-list\"\n//   ],\n//   \"baseGraph\": {},\n//   \"keywords\": {\n//     \"type\": \"@type\",\n//     \"id\": \"@id\"\n//   },\n//   \"namespaces\": {\n//     \"oa\": \"https://openactive.io/\",\n//     \"dc\": \"http://purl.org/dc/terms/\",\n//     \"owl\": \"http://www.w3.org/2002/07/owl#\",\n//     \"rdf\": \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\",\n//     \"rdfa\": \"http://www.w3.org/ns/rdfa#\",\n//     \"rdfs\": \"http://www.w3.org/2000/01/rdf-schema#\",\n//     \"schema\": \"https://schema.org/\",\n//     \"skos\": \"http://www.w3.org/2004/02/skos/core#\",\n//     \"xsd\": \"http://www.w3.org/2001/XMLSchema#\",\n//     \"pending\": \"https://pending.schema.org/\"\n//   }\n// }\n```\n\n#### loadModel(modelName [, version])\n\nReturns the model definition, augmented based on model inheritance, for a particular version of the spec.\n\n##### Example\n\n```js\n\nconst { loadModel } = require('@openactive/data-models');\n\n// Returns the latest version of this model\nconst eventModel = loadModel('Event');\n\n// Returns the 2.0 version of this model\nconst eventModel2 = loadModel('Event', '2.0');\n\n```\n\n#### getModels( [version] )\n\nReturns a map of raw model definitions for a particular version of the spec.\n\n##### Example\n\n```js\n\nconst { getModels } = require('@openactive/data-models');\n\n// Returns the latest version of the models map\nconst models = getModels();\n\n// Returns the 2.0 version of  the models map\nconst models2 = getModels('2.0');\n\n```\n\n\n#### getProperties( [version] )\n\nReturns a Set containing the fully qualified property names within the version\n\n##### Example\n\n```js\n\nconst { getProperties } = require('@openactive/data-models');\n\n// Returns the latest version of the properties Set\nconst models = getProperties();\n\n// Returns the 2.0 version of the properties Set\nconst models2 = getProperties('2.0');\n\n```\n\n#### getSchemaOrgVocab()\n\nReturns the bundled JSON-LD version of the schema.org vocabulary.\n\n#### versions\n\nA hash of available versions. This includes some named aliases. You can pass the keys of this hash to any of the above methods in the `version` parameter.\n\n##### Example\n\n```js\n\nconst { versions } = require('@openactive/data-models');\n\n// {\n//   \"latest\": \"2.x\",\n//   \"2.0\": \"2.x\"\n// }\n\n```\n\n\n## Development\n\n### Getting started\n\n```shell\n$ git clone git@github.com:openactive/data-models.git\n$ cd data-models\n$ npm install\n```\n### Running tests\n\nThis project uses [Jasmine](https://jasmine.github.io/) for its tests. All spec files are located alongside the files that they target.\n\nTo run tests locally, run:\n\n```shell\n$ npm test\n```\n\nThe test run will also include a run of [eslint](https://eslint.org/). To run the tests without these, use:\n\n```shell\n$ npm run test-no-lint\n```\n\n### Adding models\n\nAdd new models to the `versions/models` directory.\n\nFind more on the models, see the [model reference](MODELS.md)\n\n\n### Releasing\n\nTo release after pushing changes to git run the following:\n- `npm test` - check tests pass\n- `npm version patch` - to bump the patch version (see [semver](https://docs.npmjs.com/getting-started/semantic-versioning))\n- `npm publish` - to publish to npm\n- `git push` - to push the repo, as npm will have created git tags with the last command that need to be pushed\n- Redeploy `data-model-validator-site` in Heroku, and it will auto update (for patch and minor version bumps only, major versions are breaking changes by definition so require code changes to the other projects).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenactive%2Fdata-models","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenactive%2Fdata-models","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenactive%2Fdata-models/lists"}