Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
dd7ba56
Merge pull request #152 from biothings/master
kevinxin90 Apr 20, 2021
aeea89c
feat: :sparkles: set rate limit to max 3 queries per min
kevinxin90 Apr 22, 2021
cd40b5a
Merge pull request #156 from biothings/fix_issue_155
kevinxin90 Apr 22, 2021
8686092
feat: :sparkles: allow user to set MAX_QUERIES_PER_MIN as env
kevinxin90 Apr 22, 2021
d26e13e
build: :wrench: set env for jest
kevinxin90 Apr 22, 2021
2c6fbc5
Merge pull request #157 from biothings/fix_issue_155
kevinxin90 Apr 22, 2021
27e4405
Merge pull request #158 from biothings/development
kevinxin90 Apr 22, 2021
8a9325d
docs: :memo: add documentation on how to modify default rate limit fo…
kevinxin90 Apr 22, 2021
c90d4ad
Merge branch 'master' of https://github.com/biothings/BioThings_Explo…
kevinxin90 Apr 22, 2021
d214a4d
fix: :fire: temporarily disable text mining co-occurrence kp
kevinxin90 Apr 23, 2021
4464dfc
fix: :sparkles: re-enable clinical risk kp
kevinxin90 Apr 23, 2021
d8137b2
Merge pull request #160 from biothings/fix_issue_159
kevinxin90 Apr 23, 2021
356bc1c
Merge pull request #161 from biothings/development
kevinxin90 Apr 23, 2021
551e4b1
fix: :bug: fix unable to resolve biocarta id issue
kevinxin90 Apr 23, 2021
ad51fa2
Merge pull request #162 from biothings/fix_issue_159
kevinxin90 Apr 23, 2021
0370f1d
Merge pull request #163 from biothings/development
kevinxin90 Apr 23, 2021
612c943
chore(release): 2.4.0
kevinxin90 Apr 23, 2021
898483a
fix: :bug: fix issue when output ids contain special characters
kevinxin90 Apr 23, 2021
4684138
Merge pull request #165 from biothings/fix_issue_159
kevinxin90 Apr 23, 2021
e2d141f
Merge pull request #166 from biothings/development
kevinxin90 Apr 23, 2021
8fa6fef
chore(release): 2.5.0
kevinxin90 Apr 23, 2021
88d6035
fix: :bug: change from NCBIGENE to NCBIGene
kevinxin90 Apr 27, 2021
f60a0ce
refactor: :recycle: change from NCBIGENE to NCBIGene for all tests
kevinxin90 Apr 27, 2021
a876623
Merge pull request #168 from biothings/master
kevinxin90 Apr 27, 2021
e319442
build(deps): bump redis from 3.0.2 to 3.1.1
dependabot[bot] Apr 27, 2021
7347b55
nodemon to ignore './data/', addresses #170
andrewsu May 7, 2021
ebff947
build: :arrow_up: upgrade smartapi-kg package
newgene May 10, 2021
d8cc553
use nodemon delay option
andrewsu May 11, 2021
e952cca
test: :green_heart: update test to match upstream API
newgene May 11, 2021
3cec3f2
feat: :sparkles: upgrade handler to support trapi 1.1.0
marcodarko May 11, 2021
3109a8a
feat: trapi v1.1.0 support, update handler
marcodarko May 11, 2021
1a8dd3a
chore(release): 2.6.0
marcodarko May 11, 2021
7bca881
build: :arrow_up: upgrade dep, update callapis for trapi 1.1.0
marcodarko May 12, 2021
2a41515
build: :arrow_up: trapi 1.1.0 ready, rename predicate endpoints, doub…
marcodarko May 13, 2021
5087c27
Merge pull request #177 from biothings/up_dep_1
marcodarko May 13, 2021
c1c5011
feat: :sparkles: add handler logics for creating v1 metakg
kevinxin90 May 16, 2021
cd379bc
feat: :sparkles: create route for metakg
kevinxin90 May 16, 2021
7c7b8e1
feat: :sparkles: add metakg routes to index
kevinxin90 May 16, 2021
afe7b37
Merge pull request #179 from biothings/v1_metakg
kevinxin90 May 16, 2021
d92debb
Merge pull request #180 from biothings/v1_metakg
kevinxin90 May 16, 2021
028eb49
chore(release): 2.7.0
kevinxin90 May 16, 2021
5654b42
test: revert v1 examples
newgene May 19, 2021
bbc9f37
test: revert v1 TRAPI test
newgene May 19, 2021
fbd9b81
test: add v1.1 TRAPI test file
newgene May 19, 2021
ec53545
test: add v1.1 examples
newgene May 19, 2021
afc38e4
Merge branch 'master' into development
newgene May 19, 2021
8882df4
feat: :sparkles: added meta_knowledge_graph endpoints by team and ip
newgene May 20, 2021
8ee7ec2
docs: :memo: add RELEASE.md
newgene May 22, 2021
042e162
test: :white_check_mark: skip v1 tests
newgene May 22, 2021
dee3d51
test: :white_check_mark: add v1.1 tests
newgene May 22, 2021
bbd71bb
test: :white_check_mark: updated query examples
newgene May 22, 2021
623fc16
test: :white_check_mark: skip tests for /v1/predicates
newgene May 22, 2021
daea4d0
test: :white_check_mark: updated to use v1.1 examples
newgene May 22, 2021
a9ffbf9
test: :white_check_mark: fix more tests
newgene May 22, 2021
85ff733
fix: :bug: fix meta_kg endpoint for a given API
newgene May 22, 2021
a4a9532
chore: update local cache files
newgene May 22, 2021
e3cba57
build: :arrow_up: upgrade smartapi-kg to 3.8.1
newgene May 22, 2021
81343b4
build: :arrow_up: updated package-lock.json
newgene May 22, 2021
e09da54
ci: updated github actions
newgene May 22, 2021
0cc716d
ci: updated github actions
newgene May 22, 2021
674b35f
ci: updated github actions
newgene May 22, 2021
ee7a98e
Merge branch 'development'
newgene May 25, 2021
d4ca195
build: :hammer: update deploy script
newgene May 25, 2021
9c1d9a0
chore(release): 2.8.0
newgene May 25, 2021
5b2f465
feat: :sparks: update to consume trapi v1.1 apis
marcodarko May 26, 2021
b1d2413
feat: transform graph data from v1.1 to legacy format, uncomment code
marcodarko May 26, 2021
0bd4e3f
revise and update README
andrewsu May 27, 2021
d82a4f9
upload metagraph image
andrewsu May 27, 2021
21d7d9d
Merge pull request #186 from biothings/andrewsu-patch-1-README
andrewsu May 27, 2021
5279145
Add EBI Proteins to APIs BTE uses
colleenXu May 27, 2021
1e180d2
add trailing comma
colleenXu May 28, 2021
1d36a18
fix: add details to meta graph error
marcodarko Jun 3, 2021
af36907
chore: update URLs to biothings
ariutta Jun 4, 2021
4a85561
Merge pull request #192 from biothings/biothings-urls
newgene Jun 5, 2021
ef43b57
build: add debug command
newgene Jun 5, 2021
8014129
build: expose redis port
newgene Jun 5, 2021
2515985
build: updated query_graph_handler version
newgene Jun 5, 2021
b46832b
Merge branch 'master' of github.com:biothings/BioThings_Explorer_TRAPI
newgene Jun 5, 2021
364d21d
Merge pull request #173 from biothings/andrewsu-patch-1-issue-170
newgene Jun 5, 2021
67a2d5e
Merge pull request #169 from biothings/dependabot/npm_and_yarn/redis-…
newgene Jun 5, 2021
2c09d46
Merge branch 'master' of github.com:biothings/BioThings_Explorer_TRAPI
newgene Jun 5, 2021
ae9f364
Merge pull request #187 from colleenXu/add-ebi-pro
newgene Jun 5, 2021
6867302
Merge pull request #188 from biothings/consume_new_trapi
newgene Jun 5, 2021
b420838
Merge branch 'master' of github.com:biothings/BioThings_Explorer_TRAPI
newgene Jun 5, 2021
40d91a9
build: remove unused packages
newgene Jun 5, 2021
686cc2d
test: updated expected values
newgene Jun 5, 2021
cd71ed1
chore: update local cache files
newgene Jun 5, 2021
87089ff
build: synced package-lock.json
newgene Jun 5, 2021
f461152
chore(release): 2.8.1
newgene Jun 5, 2021
ef19a70
chore: create CONTRIBUTING.md
ariutta Jun 8, 2021
f3a1240
Merge pull request #198 from biothings/ariutta-contributingmd
newgene Jun 8, 2021
06c29d5
chore: add no-op build script
ariutta Jun 8, 2021
8917774
Merge pull request #199 from biothings/ariutta-noop-build-script
newgene Jun 8, 2021
dc2b8fc
chore: clarify CONTRIBUTING.md
ariutta Jun 8, 2021
78c4320
chore: example_foler -> example_folder
ariutta Jun 15, 2021
7e0fe1d
fix: include check to add apis with meta_knowledge_graph paths conati…
marcodarko Jun 15, 2021
5d129cc
update test, upgrade dependency
marcodarko Jun 16, 2021
25602ff
fix: update pkg lock
marcodarko Jun 16, 2021
9ffdc14
Merge pull request #203 from biothings/fix_specs
marcodarko Jun 16, 2021
a6d98f2
Merge pull request #204 from biothings/development
newgene Jun 16, 2021
cb10ee4
build: upgrade handler and dep call executor
marcodarko Jun 17, 2021
b6a16cd
Merge branch 'development'
marcodarko Jun 17, 2021
d148778
chore: ignore built folder
newgene Jun 25, 2021
554b136
chore: add bte prefix to debugger name
newgene Jun 25, 2021
b162a80
build: :hammer: new debug and debug-all scripts
newgene Jun 25, 2021
4d0635c
build: :hammer: remove localhost CORS errors
newgene Jun 25, 2021
701f3d9
build: :hammer: updated package-lock.json
newgene Jun 25, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci-cd
name: deploy to production

on:
push:
Expand All @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [12.x]
node-version: [14.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -33,12 +33,12 @@ jobs:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

-
-
name: Cache Docker layers
uses: actions/cache@v2
with:
Expand All @@ -52,7 +52,7 @@ jobs:
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
-
-
name: Get the version
id: vars
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10})
Expand All @@ -70,7 +70,7 @@ jobs:
builder: ${{ steps.buildx.outputs.name }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
-
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

Expand All @@ -87,7 +87,7 @@ jobs:
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd opt/single-hop-app.js
cd ~/opt/BioThings_Explorer_TRAPI
git stash && git pull
rm docker-compose.yml
cp docker-compose-prod.yml docker-compose.yml
Expand All @@ -99,7 +99,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
node-version: [14.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -122,5 +122,5 @@ jobs:
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
source: "performance-test/report.html"
target: "opt/single-hop-app.js/performance-test"
target: "~/opt/BioThings_Explorer_TRAPI/performance-test"
strip_components: 1
16 changes: 11 additions & 5 deletions .github/workflows/development-deploy-revert.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: deploy to dev server with git ref

on:
on:
workflow_dispatch:
inputs:
git-ref:
description: Git Ref (Optional)
description: Git Ref (Optional)
required: false
branches:
- development
Expand All @@ -22,7 +22,13 @@ jobs:
key: ${{ secrets.SSH_KEY_DEV }}
port: ${{ secrets.SSH_PORT }}
script: |
cd opt/BioThings_Explorer_TRAPI
cd ~/opt/BioThings_Explorer_TRAPI
git fetch
git reset ${{ github.event.inputs.git-ref }}
npm i --production
pm2 restart all
cp docker-compose-dev.yml docker-compose.yml
docker-compose up --force-recreate --build -d
docker image prune -f

# alternative way to start the app:
# npm i --production
# pm2 restart all
6 changes: 3 additions & 3 deletions .github/workflows/development-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
node-version: [13.x]
node-version: [14.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -37,7 +37,7 @@ jobs:
key: ${{ secrets.SSH_KEY_DEV }}
port: ${{ secrets.SSH_PORT }}
script: |
cd opt/BioThings_Explorer_TRAPI
cd ~/opt/BioThings_Explorer_TRAPI
rm docker-compose.yml
git stash
git pull
Expand All @@ -50,7 +50,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
node-version: [14.x]

steps:
- uses: actions/checkout@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

on:
push:
branches:
branches:
- "**"
pull_request:
branches: [ master ]
Expand All @@ -19,10 +19,10 @@ jobs:

- uses: actions/checkout@v1

- name: Use Node.js 12.x
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x

- name: npm install, generate coverage report
run: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,5 @@ processed*.txt
report*.json

.DS_Store

built
1 change: 1 addition & 0 deletions .jest/setEnvVars.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
process.env.MAX_QUERIES_PER_MIN = 20;
69 changes: 69 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,75 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [2.8.1](https://github.com/biothings/BioThings_Explorer_TRAPI/compare/v2.8.0...v2.8.1) (2021-06-05)


### Features

* :sparks: update to consume trapi v1.1 apis ([5b2f465](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/5b2f465483b7e817a0d75721ea16e6655b4bd215))
* transform graph data from v1.1 to legacy format, uncomment code ([b1d2413](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/b1d24135c7831041a17eda277bfb6264959d957a))


### Bug Fixes

* add details to meta graph error ([1d36a18](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/1d36a18694e4ca291afda8d25ddc878e33bf1b16))

## [2.8.0](https://github.com/biothings/BioThings_Explorer_TRAPI/compare/v2.7.0...v2.8.0) (2021-05-25)


### Features

* :sparkles: added meta_knowledge_graph endpoints by team and ip ([8882df4](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/8882df487e7348918e437fa6f971fadd7b24cb3f))


### Bug Fixes

* :bug: fix meta_kg endpoint for a given API ([85ff733](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/85ff733bbaefec91c55d36b9bf62bc4bc16259de))

## [2.7.0](https://github.com/biothings/BioThings_Explorer_TRAPI/compare/v2.6.0...v2.7.0) (2021-05-16)


### Features

* :sparkles: add handler logics for creating v1 metakg ([c1c5011](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/c1c50116dcec2c131c36c8c3ec52502f49e65d2d))
* :sparkles: add metakg routes to index ([7c7b8e1](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/7c7b8e1fed0f195c8ab5854b8a49d0cf9b71ae96))
* :sparkles: create route for metakg ([cd379bc](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/cd379bc8f16c491090c2982f5c0fb5fbbc4dda3d))

## [2.6.0](https://github.com/biothings/BioThings_Explorer_TRAPI/compare/v2.5.0...v2.6.0) (2021-05-11)


### Features

* :sparkles: upgrade handler to support trapi 1.1.0 ([3cec3f2](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/3cec3f2868864cd4a6501ba441ac4927b8034250))
* trapi v1.1.0 support, update handler ([3109a8a](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/3109a8a14071198ae038c5001f0d1bd76c566ad2))


### Bug Fixes

* :bug: change from NCBIGENE to NCBIGene ([88d6035](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/88d6035d9c9e76451be5514409f3a416da062c55))

## [2.5.0](https://github.com/biothings/BioThings_Explorer_TRAPI/compare/v2.4.0...v2.5.0) (2021-04-23)


### Bug Fixes

* :bug: fix issue when output ids contain special characters ([898483a](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/898483a89d678e7fc4c95dd43ab607e3bbc4ae46))

## [2.4.0](https://github.com/biothings/BioThings_Explorer_TRAPI/compare/v2.3.0...v2.4.0) (2021-04-23)


### Features

* :sparkles: allow user to set MAX_QUERIES_PER_MIN as env ([8686092](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/8686092a8cbeedacbc38f8670a7be6470eeafc9d))
* :sparkles: set rate limit to max 3 queries per min ([aeea89c](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/aeea89c867eace66ba485b1c8b146af2a4328912))


### Bug Fixes

* :bug: fix unable to resolve biocarta id issue ([551e4b1](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/551e4b1f938eb08054f303ec6d2460f558e32d08))
* :fire: temporarily disable text mining co-occurrence kp ([d214a4d](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/d214a4dbec36a60d6df7d150f89835a6ea32bac8))
* :sparkles: re-enable clinical risk kp ([4464dfc](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/4464dfcffcb470ee7478cd16b2d93d712367ebd7))

## [2.3.0](https://github.com/biothings/BioThings_Explorer_TRAPI/compare/v2.2.0...v2.3.0) (2021-04-20)


Expand Down
26 changes: 26 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# How to Contribute

See the [main README](https://github.com/biothings/BioThings_Explorer_TRAPI#biothings-explorer-trapi-api). This file just has additional details.

## Set up Dev Environment

### Small Updates

If you're just updating one package and your changes won't affect other packages, you don't have to worry about any of this. If your changes will affect multiple packages but primarily affect just one, you may be able to get away with just using [`npm link`](https://docs.npmjs.com/cli/v7/commands/npm-link).

### Larger Updates

If your updates will affect multiple packages, you may find it helpful to use [NPM workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces). This feature is better than just `npm link` for handling the case of simultaneously updating multiple linked packages. Note it requires NPM v7+. Steps to get this working:

1. Create a new directory and `cd` into it
2. Add a top-level package.json with all the packages and their dependencies hoisted up to the top level ([something like this](https://www.dropbox.com/s/izsofa7r5alwwfd/package.json?dl=0) - notice the `workspaces` key)
3. For each package to be affected by your updates, clone its repo into subdirectory `./packages` ([demo bash script](https://www.dropbox.com/s/upggzaby7b978z8/clone_packages.sh?dl=0) to do this).
4. From the top-level directory, run the following:

- `npm install`
- `npm run build --workspaces`
- `npm run test --workspaces`

5. To run an NPM script for a specific package, try `npm run <script-name> --workspace=package-a` from the top-level directory, e.g., to start the BioThings_Explorer_TRAPI endpoint: `npm run start --workspace='@biothings-explorer/single-hop-app'`.
6. From the directories in `./packages`, you can edit code and run git commands, e.g., `cd './packages/@biothings-explorer/single-hop-app'` and `git pull`.
7. For now, you still need to run the build step for each package affected by your updates: `npm run build --workspaces` from the top-level directory. If it doesn't work immediately, try running it again. (We can automate this in the future.)
67 changes: 32 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,29 @@

## Introduction

This GitHub repo serves as the development repo for the TRAPI API implementation of BioThings Explorer.
This GitHub repo serves as the development repo for the TRAPI API implementation of **BioThings Explorer (BTE)**. BTE is an engine for autonomously querying a distributed knowledge graph. The distributed knowledge graph is made up of biomedical APIs that have been annotated with semantically-precise descriptions of their inputs and outputs in the [SmartAPI registry](https://smart-api.info/). This project is primarily funded by the [NCATS Translator project](https://ncats.nih.gov/translator). There is also an older [python version of BioThings Explorer](https://github.com/biothings/biothings_explorer) that is currently not being actively developed.

### What's BioThings Explorer
An older version of the meta knowledge graph that is consumed by BTE is in this figure (which, although older, gives a nice conceptual visualization of API interoperability):

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](https://ncats.nih.gov/translator).
![BTE Meta-KG](diagrams/smartapi_metagraph.png "BioThings Explorer metagraph")

### What's TRAPI
### What's TRAPI?

TRAPI stands for [Translator Reasoner API](https://github.com/NCATSTranslator/ReasonerAPI). It is a standard defined for APIs developed within NCATS Biomedical Translator project to allow easy information exchange among them.
TRAPI stands for [Translator Reasoner API](https://github.com/NCATSTranslator/ReasonerAPI). It is a standard defined for APIs developed within NCATS Biomedical Translator project to facilitate information exchange between resources. BTE exports results via TRAPI to maintain interoperability with other Translator tools. BTE can also _consume_ knowledge resources that expose the TRAPI interface, but it also can consume APIs that have been annotated in the [SmartAPI registry](https://smart-api.info/) using the [x-bte extension](https://x-bte-extension.readthedocs.io/en/latest/index.html) to the OpenAPI specification.

### Our TRAPI Interface
### Live TRAPI Instance

Please visit our TRAPI API landing page [here](http://bte_trapi.smart-api.info/).
We maintain a live instance of this application at https://api.bte.ncats.io/ that can be used for testing. Query Examples can be found [here](/examples).


### Some Query Examples

Query Examples can be found [here](https://github.com/kevinxin90/BioThings_Explorer_TRAPI/tree/master/examples).

---


## 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.
## Local installations

### Node
### Requirements

NOTE: Node version must be higher than v12.
For development, you will only need Node.js and a node global package, e.g. npm, installed in your environment. Your Node version must be higher than v12.


- #### Node installation on Windows
Expand Down Expand Up @@ -75,14 +60,14 @@ If you need to update `npm`, you can make it using `npm`! Cool right? After runn

---

## Install
### Installation

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


## Running the project
### Running the project

$ npm start

Expand All @@ -92,11 +77,15 @@ To enable debug mode, which outputs logging statements to the terminal in real t

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

## Simple build for production
By default, the `/v1/query` endpoint only supports 3 queries per min, you could modify this behavior by setting MAX_QUERIES_PER_MIN environment variable when starting the service

`$ MAX_QUERIES_PER_MIN=5 npm start`

### Simple build for production

$ npm build

## Deploy
### Deploy

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

Expand All @@ -112,11 +101,14 @@ docker-compose up

Public Docker image located at [link](https://hub.docker.com/repository/docker/biothings/bte_reasoner_api)

## Usage
### Usage

You now can POST queries to `http://<HOST>:3000/v1/query`.

`http://<HOST>:3000`
Query Examples can be found [here](/examples).

## Test with local SmartAPI spec

### Test with local SmartAPI spec

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

Expand All @@ -134,3 +126,8 @@ Then, Run the image and mount your local smartapi spec folder
Now, you should be able to test your local smartapi using POST queries at:

`http://localhost:3000/test/query`

### Testing on a specific SmartAPI API

By default, BTE queries all APIs specified in the the[ config.js file](https://github.com/biothings/BioThings_Explorer_TRAPI/blob/master/src/routes/v1/config.js). In some cases, you may want to override that default to specifically query a single API. For example, the SmartAPI record for the "EBI Proteins API) is [43af91b3d7cae43591083bff9d75c6dd](https://smart-api.info/registry?q=43af91b3d7cae43591083bff9d75c6dd). To instruct BTE to query that API only, you can POST your query to http://localhost:3000/v1/smartapi/43af91b3d7cae43591083bff9d75c6dd/query

Loading