{"id":19154548,"url":"https://github.com/bcgsc/pori_graphkb_schema","last_synced_at":"2025-05-07T06:30:16.998Z","repository":{"id":40348063,"uuid":"322391258","full_name":"bcgsc/pori_graphkb_schema","owner":"bcgsc","description":"Shared package between the API and GUI for GraphKB which holds the schema definitions and schema-related functions","archived":false,"fork":false,"pushed_at":"2024-09-06T22:43:33.000Z","size":1137,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2025-04-15T16:35:22.231Z","etag":null,"topics":["genomics","graphdb","knowledge-base","personalized-medicine","pori"],"latest_commit_sha":null,"homepage":"https://bcgsc.github.io/pori","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bcgsc.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-12-17T19:22:43.000Z","updated_at":"2024-09-06T22:43:37.000Z","dependencies_parsed_at":"2024-01-29T20:15:20.518Z","dependency_job_id":"431f0a62-0702-4d07-ad44-d7394a83f853","html_url":"https://github.com/bcgsc/pori_graphkb_schema","commit_stats":{"total_commits":350,"total_committers":5,"mean_commits":70.0,"dds":0.12,"last_synced_commit":"27c7fea9599bb18258003c720280e5775d6c6b20"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcgsc%2Fpori_graphkb_schema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcgsc%2Fpori_graphkb_schema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcgsc%2Fpori_graphkb_schema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcgsc%2Fpori_graphkb_schema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bcgsc","download_url":"https://codeload.github.com/bcgsc/pori_graphkb_schema/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252826573,"owners_count":21810134,"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":["genomics","graphdb","knowledge-base","personalized-medicine","pori"],"created_at":"2024-11-09T08:27:17.949Z","updated_at":"2025-05-07T06:30:16.977Z","avatar_url":"https://github.com/bcgsc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GraphKB Schema\n\n[![codecov](https://codecov.io/gh/bcgsc/pori_graphkb_schema/branch/master/graph/badge.svg?token=0QZTY7RA1R)](https://codecov.io/gh/bcgsc/pori_graphkb_schema) ![build](https://github.com/bcgsc/pori_graphkb_schema/workflows/build/badge.svg?branch=master) [![npm version](https://badge.fury.io/js/%40bcgsc-pori%2Fgraphkb-schema.svg)](https://badge.fury.io/js/%40bcgsc-pori%2Fgraphkb-schema) ![node versions](https://img.shields.io/badge/node-12%20%7C%2014%20%7C%2016-blue) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5730411.svg)](https://doi.org/10.5281/zenodo.5730411)\n\nThis repository is part of the [platform for oncogenomic reporting and interpretation](https://github.com/bcgsc/pori).\n\nThis is the package which defines the schema logic used to create the database, build the API and GUI.\nIt is a dependency of both the API and GUI and uses the parser package.\n\nThis is where all database constraints and swagger metadata associated with a particular database\nmodel is defined\n\n![schema](https://graphkb-api.bcgsc.ca/public/pori-schema-overview.svg)\n\n## Deployment\n\nThis package is installed on our local npm server. To install simply add to your package.json as you\nwould with any other package and supply the registry argument to npm install\n\n\n## Getting Started (For Developers)\n\nInstall the dependencies\n\n```bash\nnpm install\n```\n\nThen run the tests\n\n```bash\nnpm run test\n```\n\n## Using with OrientJS\n\nTo avoid requiring orientjs in this package, the RID class is defaulted to the builtin String class.\nIt is expected that if you want your RID strings cast to RID objects (orientjs.RID or orientjs.RecordID\nfor orientjs 3.X.X) that you will patch this after import. For example\n\n```javascript\nconst {RID} = require('orientjs');\nconst {constants, schema} = require('@bcgsc-pori/graphkb-schema');\n\nconst {PERMISSIONS} = constants;\n\nconstants.RID = RID; // IMPORTANT: Without this all castToRID will do is convert to a string\n```\n\n## Migrating from v3 to v4\n\nTo facilitate more reuseable typing schemes ClassModel and Property classes have been removed and now are simply objects. All interactions with these models should go through the schema class instead of interacting directly with the model and property objects. Return types are given only when they differ.\n\n| v3 (ClassModel methods)                       | v4 equivalent (SchemaDefinition methods)                                                              | Notes                                                    |\n| --------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |\n| `properties`                                  | `getProperties(modelName: string)`                                                                    |                                                          |\n| `required`                                    | `requiredProperties(modelName: string)`                                                               |                                                          |\n| `optional`                                    | `optionalProperties(modelName: string)`                                                               |                                                          |\n| `getActiveProperties()`                       | `activeProperties(modelName: string)`                                                                 |                                                          |\n| `inherits`                                    | `ancestors(modelName: string)`                                                                        |                                                          |\n| `subclasses: ClassModel[]`                    | `children(modelName: string): string[]`                                                               |                                                          |\n| `descendantTree(boolean): ClassModel[]`       | `descendants(modelName: string, opt: { excludeAbstract?: boolean, includeSelf?: boolean }): string[]` | must be called with includeSelf=true to match v3 edition |\n| `queryProperties: Property[]`                 | `queryableProperties(modelName: string): PropertyDefinition[]`                                        |                                                          |\n| `inheritsProperty(propName: string)`          | `inheritsProperty(modelName: string, propName: string)`                                               |                                                          |\n| `toJSON`                                      | N/A                                                                                                   |                                                          |\n| `formatRecord(record: GraphRecord, opt = {})` | `formatRecord(modelName: string, record: GraphRecord, opt = {})`                                      |                                                          |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcgsc%2Fpori_graphkb_schema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbcgsc%2Fpori_graphkb_schema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcgsc%2Fpori_graphkb_schema/lists"}