Coder Social home page Coder Social logo

bcgsc / pori_graphkb_schema Goto Github PK

View Code? Open in Web Editor NEW
4.0 5.0 0.0 1.11 MB

Shared package between the API and GUI for GraphKB which holds the schema definitions and schema-related functions

Home Page: https://bcgsc.github.io/pori

License: GNU General Public License v3.0

JavaScript 0.57% TypeScript 99.43%
genomics personalized-medicine knowledge-base graphdb pori

pori_graphkb_schema's Introduction

GraphKB Schema

codecov build npm version node versions DOI

This repository is part of the platform for oncogenomic reporting and interpretation.

This is the package which defines the schema logic used to create the database, build the API and GUI. It is a dependency of both the API and GUI and uses the parser package.

This is where all database constraints and swagger metadata associated with a particular database model is defined

schema

Deployment

This package is installed on our local npm server. To install simply add to your package.json as you would with any other package and supply the registry argument to npm install

Getting Started (For Developers)

Install the dependencies

npm install

Then run the tests

npm run test

Using with OrientJS

To avoid requiring orientjs in this package, the RID class is defaulted to the builtin String class. It is expected that if you want your RID strings cast to RID objects (orientjs.RID or orientjs.RecordID for orientjs 3.X.X) that you will patch this after import. For example

const {RID} = require('orientjs');
const {constants, schema} = require('@bcgsc-pori/graphkb-schema');

const {PERMISSIONS} = constants;

constants.RID = RID; // IMPORTANT: Without this all castToRID will do is convert to a string

Migrating from v3 to v4

To 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.

v3 (ClassModel methods) v4 equivalent (SchemaDefinition methods) Notes
properties getProperties(modelName: string)
required requiredProperties(modelName: string)
optional optionalProperties(modelName: string)
getActiveProperties() activeProperties(modelName: string)
inherits ancestors(modelName: string)
subclasses: ClassModel[] children(modelName: string): string[]
descendantTree(boolean): ClassModel[] descendants(modelName: string, opt: { excludeAbstract?: boolean, includeSelf?: boolean }): string[] must be called with includeSelf=true to match v3 edition
queryProperties: Property[] queryableProperties(modelName: string): PropertyDefinition[]
inheritsProperty(propName: string) inheritsProperty(modelName: string, propName: string)
toJSON N/A
formatRecord(record: GraphRecord, opt = {}) formatRecord(modelName: string, record: GraphRecord, opt = {})

pori_graphkb_schema's People

Contributors

areisle avatar creisle avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pori_graphkb_schema's Issues

Convert to Typescript

Convert to typescript. In order to support better type-checking we will be moving this and related repositories to typescript. This must be tested with the current implementations of the client and api and should support use in node as a commonjs module still

depends on

Add new Phenotype Class

In order to support loading the Human Phenotype ontology (see https://hpo.jax.org/) and linking these terms from CIViC statements it would be helpful to add a phenotype class to GraphKB. This will require

  • Define the new class in this package
  • Add a migration to GraphKB API to apply/create the new class
  • Ensure this new class is included in the class-based permissions object

This new class should subclass ontology

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.