Skip to content

Commit

Permalink
Merge 5c1dc8a into 919bb1b
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinxin90 committed Apr 2, 2021
2 parents 919bb1b + 5c1dc8a commit 11fd8f3
Show file tree
Hide file tree
Showing 19 changed files with 18,409 additions and 46 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@

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.1.0](https://github.com/biothings/BioThings_Explorer_TRAPI/compare/v2.0.1...v2.1.0) (2021-04-02)


### Features

* :sparkles: add /test/query endpoint to support user specified smartapi spec ([c75e44d](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/c75e44db6b79ccd2ef7b3f6f5cfd2cc448fd2814))
* :sparkles: add additional node attributes to knowledge graph ([4fb93e3](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/4fb93e37c8a16bc2ae9381747ba56a4e13aa33ed))
* :sparkles: add cron job to periodically pull from /predicates endpoint ([94461b1](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/94461b1a7c96b9b7ea66b4f5eb41f55b1a87dcb9))
* :sparkles: add num_of_participants property for pathway ([3d9f820](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/3d9f8209134a5625f2940500a65bf0fd277cb457))
* :sparkles: have bte only use a specified number of APIs ([7fa1732](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/7fa17323faa8e457a60a6df4dea508cc0489a061))
* :sparkles: support restricting /predicates to only api names provide ([9260ec9](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/9260ec969b4244f878f8a0a6c360b04a7dfde8dd))
* :sparkles: update local predicates file and smartapi specs ([425093e](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/425093ee3e96af0b969620805bf796ffe592a6fc))


### Bug Fixes

* :bug: add support for resolving protein ids ([500161a](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/500161ac8357cb89739da58189f73afd1f91cb58))
* :bug: fix api_response_transform bug ([4d911d6](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/4d911d6aa91120775b3d2b70c71fbd1a8e2feefb))
* :bug: fix cache related bug causing query failure ([3bd87ae](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/3bd87aec0283b12dfe1676e9fc7e2b57dd51c41e))
* :bug: fix id resolver failure issue ([eecbe4f](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/eecbe4f163d535a3a0f589d98fbdc0d76d8dd86d))
* :bug: fix missing biolink prefix issue ([153b601](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/153b6011641263bd1d420defa0c881b62b0741a2))
* :bug: fix typo ([5b32009](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/5b320097664afb438f6b9e2fc11b7dc232069b3e))
* :bug: fix wrong edge id in query results ([4bb1aa7](https://github.com/biothings/BioThings_Explorer_TRAPI/commits/4bb1aa7e3e98da8cd713f89236840f91439d00cb))

### [2.0.1](https://github.com/biothings/BioThings_Explorer_TRAPI/compare/v2.0.0...v2.0.1) (2021-03-12)


Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,13 @@ Public Docker image located at [link](https://hub.docker.com/repository/docker/b
## 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/nodde/app/test** in the container. [Note: The SmartAPI spec must be named **smartapi.json**]

You could do so using the following command:

`docker run -p 3000:3000 -v [local_folder_contain_smartapi_spec]:/home/node/app/test -d biothings/bte_reasoner_api`
3 changes: 1 addition & 2 deletions __test__/integration/controllers/predicates.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ describe("Test Predicates Module", () => {

test("If invalid team name is provided, should return an empty list", async () => {
const handler = new pred();
const res = await handler._loadMetaKG(undefined, 'Multiomics Provider1');
expect(res.ops).toEqual([])
await expect(handler._loadMetaKG(undefined, 'Multiomics Provider1')).rejects.toThrow('Failed to Load MetaKG');
})

test("By default, should return all ops", async () => {
Expand Down
12 changes: 12 additions & 0 deletions __test__/integration/routes/metakg.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,16 @@ describe("Test /metakg endpoint", () => {
expect(subjs).toEqual(['ChemicalSubstance']);
})
})

test("Should return info from TRAPI /predicates endpoint", async () => {
await request(app)
.get("/metakg")
.expect(200)
.expect('Content-Type', /json/)
.then((response) => {
expect(response.body).toHaveProperty("associations");
const apis = Array.from(new Set(response.body.associations.map(item => item.api.name)));
expect(apis).toContain("Automat Pharos");
})
})
})
7 changes: 5 additions & 2 deletions __test__/integration/routes/v1predicates_by_team.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ describe("Test /v1/team/{team_name}/predicates endpoint", () => {
test("Query to Invalid team Should return 200 with empty response", async () => {
await request(app)
.get("/v1/team/wrong team/predicates")
.expect(200)
.expect(404)
.expect('Content-Type', /json/)
.then((response) => {
expect(response.body).toEqual({});
expect(response.body).toEqual({
"error": "Unable to load predicates",
"more_info": "Failed to Load MetaKG",
});
})
})

Expand Down
Loading

0 comments on commit 11fd8f3

Please sign in to comment.