{"id":19154554,"url":"https://github.com/bcgsc/pori_graphkb_api","last_synced_at":"2025-10-10T20:06:58.266Z","repository":{"id":37070747,"uuid":"322391456","full_name":"bcgsc/pori_graphkb_api","owner":"bcgsc","description":"REST API for the GraphKB project","archived":false,"fork":false,"pushed_at":"2025-04-29T17:05:47.000Z","size":8296,"stargazers_count":4,"open_issues_count":6,"forks_count":1,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2025-04-29T18:23:22.662Z","etag":null,"topics":["genomics","graphdb","knowledge-base","personalized-medicine","pori"],"latest_commit_sha":null,"homepage":"https://bcgsc.github.io/pori","language":"JavaScript","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":"docs/CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2020-12-17T19:23:36.000Z","updated_at":"2025-04-29T17:05:52.000Z","dependencies_parsed_at":"2023-10-05T01:11:40.559Z","dependency_job_id":"cec080fb-cc9d-43e3-8439-08ac93381a3f","html_url":"https://github.com/bcgsc/pori_graphkb_api","commit_stats":{"total_commits":1369,"total_committers":9,"mean_commits":"152.11111111111111","dds":"0.17457998539079622","last_synced_commit":"c458c24f624169d9d3ff86e63304426bec66b9ae"},"previous_names":[],"tags_count":73,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcgsc%2Fpori_graphkb_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcgsc%2Fpori_graphkb_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcgsc%2Fpori_graphkb_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcgsc%2Fpori_graphkb_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bcgsc","download_url":"https://codeload.github.com/bcgsc/pori_graphkb_api/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252826657,"owners_count":21810161,"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:20.144Z","updated_at":"2025-10-10T20:06:53.234Z","avatar_url":"https://github.com/bcgsc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GraphKB API\n\n![build](https://github.com/bcgsc/pori_graphkb_api/workflows/build/badge.svg?branch=master) [![codecov](https://codecov.io/gh/bcgsc/pori_graphkb_api/branch/master/graph/badge.svg?token=XDTDIQ5793)](https://codecov.io/gh/bcgsc/pori_graphkb_api) ![node versions](https://img.shields.io/badge/node-12%20%7C%2014%20%7C%2016-blue) [![orientdb versions](https://img.shields.io/badge/orientdb-3.0%20%7C%203.1-blue)](https://www.orientdb.org/) ![centos build](https://www.bcgsc.ca/bamboo/plugins/servlet/wittified/build-status/PORI-GA) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5730581.svg)](https://doi.org/10.5281/zenodo.5730581)\n\nThis repository is part of the [platform for oncogenomic reporting and interpretation](https://github.com/bcgsc/pori).\n\nThe GraphKB database is implemented using [orientDB](https://github.com/orientechnologies/orientdb) and [orientjs](https://github.com/orientechnologies/orientjs).\nIt is a graph database which is used to store variants, ontologies, and the relevance of this terms and variants. The KB uses strict controlled vocabulary to provide a parsable and machine-readable interface for other applications to build on. The API is a REST API built on node/express.\n\n## About\n\n### Database Schema\n\nThe [schema](https://github.com/bcgsc/pori_graphkb_schema) is defined in a separate NPM package.\nIn general it consists of four major types of data: ontology terms, variants, evidence, and statements.\n\n### OpenAPI Specification\n\nAll KB API routes are documented with OpenAPI specification. The specification is hosted with the api under `/api/spec`\n\n### Authentication\n\nAuthentication in the KB uses tokens. KB API tokens can be generated using the token route defined in the API specification.\nThe first layer of authentication happens when KB uses [keycloak](https://www.keycloak.org/) to authenticate users against the LDAP. A request is sent\nto keycloak with the users credentials and a token is returned if the user exists and has access to KB.\n\nThe next step happens when KB looks up the username in the KB database. Each user in KB belongs to one or more UserGroups. Each of these UserGroups contains table-level permission schemas.\n\n![KB Authentication Process](docs/authentication.svg)\n\nIn summary, KB Client will send user credentials and receive a token which will be used in the header of all subsequent requests.\n\n## Quick Start\n\nMost of the time you will want the deployment instructions rather than the ones below. For\nthese please see the [contributing guide](./docs/CONTRIBUTING.md).\n\nRequirements\n\n- orientdb 3.0, 3.1, or 3.2\n- node v16, v18 or v20\n\nClone the repository\n\n```bash\ngit clone https://github.com/bcgsc/pori_graphkb_api.git\ncd pori_graphkb_api\ngit checkout develop\n```\n\nInstall the dependencies\n\n```bash\nnpm install\n```\n\nTo actually use the API, the orientDB instance must already be running. To configure where the tests will point to the user can either modify `config/config.js` or set the [environment variables](env.md) which override this config (default values are shown below, this will change depending on how you db server is configured).\n\n```bash\nGKB_DBS_PASS=root\nGKB_DBS_USER=root\nGKB_DB_HOST='HOST NAME'\nGKB_DB_PORT=2424\nGKB_KEY_FILE='id_rsa'  # used in generating the tokens\n```\n\nCreate the keyfile (pick the current directory)\n\n```bash\nyes | ssh-keygen -t rsa -b 4096 -f id_rsa -N ''\n```\n\nAfter these options are configured, the server can be started\n\n```bash\nnpm start\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcgsc%2Fpori_graphkb_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbcgsc%2Fpori_graphkb_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcgsc%2Fpori_graphkb_api/lists"}