This client is current compatible with TRAPI Release 1.0.
The Translator Reasoner API (TRAPI) is a web services protocol for querying metadata and data in knowledge graphs which represent networks of biomedical concepts and relationships imported by so-called Translator Knowledge Provider ("KP") components from external biomedical knowledge sources (i.e. public bioinformatics databases, literature or data sources) or constructed by machine learning algorithms inferring from said imported knowledge sources by so-called Translator Autonomous Relay Agent ("ARA") components.
TRAPI 1.0 currently consists of two endpoints:
/predicates: returns web service metadata consisting of a simple map Biolink Model relationship predicates and concept category values used in knowledge graphs returned by the service (note: future TRAPI releases will significantly elaborate further on the functionality of this endpoint, which will also likely be renamed)
/query: executes a knowledge graph templated query on the underlying KP or ARA to return a relevant knowledge graph and a set of 'results' mapping of the seed concepts and edges of the knowledge graph templated query, against that knowledge graph.
npm for managing module dependencies and running the system which needs to be installed. Instructions for installing
npm are here.
Installing the Client from the Public Module Repository
Assuming that your npm is properly configured, the latest public npm package release of the module may be installed as follows:
$ npm install trapi-client
or using yarn
yarn add trapi-client
Locally Installing and Developing with the Client Project
If you wish to directly modify or add to the client software, the project may be directly installed as follows.
Obtaining the Source Code
The first step is to clone the project source code from the Github project repository, into a suitable location on your computer using a copy of Git installed on your operating system:
git clone https://github.com/STARInformatics/trapi-client-js.git
$ npm install
Using the Client
trapi.js script may be run directly by typing:
$ node trapi.js
This script has very simple functionality for quick testing purposes.
trapi.js script actually calls the underlying TRAPI
var client = require("./src/client.js"); var predicates = client.predicates(); var results = client.query();