# trapi-client

> Translator Application Programming Interface Client

Latest version **0.0.3** (published 2021-01-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install trapi-client
pnpm add trapi-client
yarn add trapi-client
bun add trapi-client
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2021-01-08 |
| First published | 2020-12-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 28.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Richard Bruskiewich |
| Maintainers | rbruskiewich |
| Keywords | Translator, API, client |

## Links

- npm: https://www.npmjs.com/package/trapi-client
- Repository: https://github.com/STARInformatics/trapi-client-js
- Homepage: https://github.com/STARInformatics/trapi-client-js#readme
- Issues: https://github.com/STARInformatics/trapi-client-js/issues
- npm.io page: https://npm.io/package/trapi-client

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2021-01-08
- 0.0.2 — 2021-01-08
- 0.0.1 — 2020-12-09

## README

# TRAPI Javascript Client

This project is a lightweight Javascript client library for the [Translator Reasoner API (TRAPI)](https://github.com/NCATSTranslator/ReasonerAPI/) web services. TRAPI is a standard web service specification for the Biomedical Data Translator project of the National Center for Advancing Translational Science (NCATS; https://ncats.nih.gov/).

## Version

This client is current compatible with [TRAPI Release 1.0](https://github.com/NCATSTranslator/ReasonerAPI/releases/tag/v1.0.0-beta).

# Overview

The [Translator Reasoner API (TRAPI)](https://github.com/NCATSTranslator/ReasonerAPI/) 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.

# Getting Started

This project uses Javascript and uses `npm` for managing module dependencies and running the system which needs to be installed. Instructions for installing `npm` are [here](https://www.npmjs.com/get-npm}).

## 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:

```shell
$ npm install trapi-client
```

or using yarn

```shell
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](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git):

```shell
git clone https://github.com/STARInformatics/trapi-client-js.git
```

### Installing Javascript Dependencies

After cloning the project, you need to install the project's Javascript module dependencies locally, by typing the following from within your root project directory (i.e. inside /path/to/your/project/trapi-client-js):

```shell
$ npm install
```

# Using the Client

## trapi.js

The `trapi.js` script may be run directly by typing:

```shell
$ node trapi.js
```

This script has very simple functionality for quick testing purposes.

## client.js

The `trapi.js` script actually calls the underlying TRAPI `client.js` module to do its work.  This client module may be directly invoked within other Javascript execution contexts by importing the module and running its functions directly, as illustrated by the code within the `trapi.js` script.

```javascript
var client = require("./src/client.js");

var predicates = client.predicates();

var results = client.query();
```

# Implementation

Aside from basic Javascript, this project uses the [openapitools openapi-generator-cli](https://www.npmjs.com/package/@openapitools/openapi-generator-cli) module.

---
_Source: https://npm.io/package/trapi-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
