Skip to content

kevinxin90/BioThings_Explorer_TRAPI

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BioThings Explorer TRAPI API

Test Coveralls Coverage Status ci-cd

Introduction

This GitHub repo serves as the development repo for the TRAPI API implementation of BioThings Explorer.

What's BioThings Explorer

BioThings Explorer aims at helping users querying and linking results from a variety of biomedical relevant APIs through one interface. The project is funded by the NCATS Translator project.

What's TRAPI

TRAPI stands for Translator Reasoner API. It is a standard defined for APIs developed within NCATS Biomedical Translator project to allow easy information exchange among them.

Our TRAPI Interface

Please visit our TRAPI API landing page here.

Some Query Examples

Query Examples can be found here.


Current Development Status

Currently, the BioThings Explorer TRAPI API implements TRAPI v1.0.0 standard, and can be queried at https://api.bte.ncats.io/v1/query endpoint.

The TRAPI v0.9.2 standard is deprecated. But it can still be tested using https://api.bte.ncats.io/query endpoint.


Requirements

For development, you will only need Node.js and a node global package, e.g. npm, installed in your environment.

Node

NOTE: Node version must be higher than v12.

  • Node installation on Windows

    Just go on official Node.js website and download the installer. Also, be sure to have git available in your PATH, npm might need it (You can find git here).

  • Node installation on Ubuntu

    You can install nodejs and npm easily with apt install, just run the following commands.

    $ sudo apt install nodejs
    $ sudo apt install npm
    
  • Other Operating Systems

    You can find more information about the installation on the official Node.js website and the official NPM website.

If the installation was successful, you should be able to run the following command.

$ node --version
v12.*.*

$ npm --version
6.1.0

If you need to update npm, you can make it using npm! Cool right? After running the following command, just open again the command line and be happy.

$ npm install npm -g


Install

$ git clone https://github.com/biothings/BioThings_Explorer_TRAPI`
$ cd BioThings_Explorer_TRAPI`
$ npm install`

Running the project

$ npm start

To enable debug mode, which outputs logging statements to the terminal in real time:

$ DEBUG=biothings-explorer-trapi:* npm start

$ DEBUG=biothings-explorer-trapi:*,smartapi-kg:*,call-apis:*,biomedical-id-resolver:* npm start (also outputs debug statements from dependencies)

Simple build for production

$ npm build

Deploy

A docker file is included in the base directory and can be used to build the customized container

docker build -t bte_reasoner_api .

Container can be built and started using docker-compose

docker-compose up

Public Docker image located at link

Usage

http://<HOST>:3000

Test with local SmartAPI spec

The TRAPI interface has /test/query endpoint which uses a SmartAPI spec stored at test folder named smartapi.json

If you would like to use the /test/query endpoint to test a local SmartAPI spec, you can mount the your local folder containing the SmartAPI spec to the folder /home/node/app/test in the container. [Note: The SmartAPI spec must be named smartapi.json]

You could do so using the following commands:

First pull the biothings/bte_reasoner_api image from Docker Hub: docker pull biothings/bte_reasoner_api

Then, Run the image and mount your local smartapi spec folder

docker run -p 3000:3000 -v [local_folder_contain_smartapi_spec]:/home/node/app/test -d biothings/bte_reasoner_api

Now, you should be able to test your local smartapi using POST queries at:

http://localhost:3000/test/query

About

App perform single hop query for BioThings Explorer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 77.6%
  • HTML 22.1%
  • Dockerfile 0.3%