Skip to content

Commit

Permalink
Merge pull request #177 from biothings/up_dep_1
Browse files Browse the repository at this point in the history
  • Loading branch information
marcodarko committed May 13, 2021
2 parents 7bca881 + 2a41515 commit 5087c27
Show file tree
Hide file tree
Showing 31 changed files with 87 additions and 87 deletions.
8 changes: 4 additions & 4 deletions __test__/integration/TRAPIv1.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ describe("Testing endpoints", () => {
const query_without_category = JSON.parse(fs.readFileSync(path.join(example_foler, 'query_without_input_category.json')))
const expand_node = JSON.parse(fs.readFileSync(path.join(example_foler, 'query_with_node_to_be_expanded.json')))

test("GET /v1/predicates", async () => {
test("GET /v1/meta_knowledge_graph", async () => {
await request(app)
.get("/v1/predicates")
.get("/v1/meta_knowledge_graph")
.expect(200)
.expect('Content-Type', /json/)
.then((response) => {
Expand All @@ -28,9 +28,9 @@ describe("Testing endpoints", () => {
})
})

test("GET /v1/smartapi/{smartapi_id}/predicates", async () => {
test("GET /v1/smartapi/{smartapi_id}/meta_knowledge_graph", async () => {
await request(app)
.get("/v1/smartapi/978fe380a147a8641caf72320862697b/predicates")
.get("/v1/smartapi/978fe380a147a8641caf72320862697b/meta_knowledge_graph")
.expect(200)
.expect('Content-Type', /json/)
.then((response) => {
Expand Down
2 changes: 1 addition & 1 deletion __test__/integration/routes/metakg.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe("Test /metakg endpoint", () => {
})
})

test("Should return info from TRAPI /predicates endpoint", async () => {
test("Should return info from TRAPI /meta_knowledge_graph endpoint", async () => {
await request(app)
.get("/metakg")
.expect(200)
Expand Down
4 changes: 2 additions & 2 deletions __test__/integration/routes/v1predicates.test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const app = require("../../../src/app");
const request = require('supertest');

describe("Test /v1/predicates endpoint", () => {
describe("Test /v1/meta_knowledge_graph endpoint", () => {
test("Should return 200 with valid response", async () => {
await request(app)
.get("/v1/predicates")
.get("/v1/meta_knowledge_graph")
.expect(200)
.expect('Content-Type', /json/)
.then((response) => {
Expand Down
6 changes: 3 additions & 3 deletions __test__/integration/routes/v1predicates_by_api.test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const app = require("../../../src/app");
const request = require('supertest');

describe("Test /v1/smartapi/{smartapi_id}/predicates endpoint", () => {
describe("Test /v1/smartapi/{smartapi_id}/meta_knowledge_graph endpoint", () => {
test("Query to Text Mining Targeted Association API Should return 200 with valid response", async () => {
await request(app)
.get("/v1/smartapi/978fe380a147a8641caf72320862697b/predicates")
.get("/v1/smartapi/978fe380a147a8641caf72320862697b/meta_knowledge_graph")
.expect(200)
.expect('Content-Type', /json/)
.then((response) => {
Expand All @@ -15,7 +15,7 @@ describe("Test /v1/smartapi/{smartapi_id}/predicates endpoint", () => {

test("Query to Invalid API Should return 404 with error message included", async () => {
await request(app)
.get("/v1/smartapi/78fe380a147a8641caf72320862697b/predicates")
.get("/v1/smartapi/78fe380a147a8641caf72320862697b/meta_knowledge_graph")
.expect(404)
.expect('Content-Type', /json/)
.then((response) => {
Expand Down
6 changes: 3 additions & 3 deletions __test__/integration/routes/v1predicates_by_team.test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const app = require("../../../src/app");
const request = require('supertest');

describe("Test /v1/team/{team_name}/predicates endpoint", () => {
describe("Test /v1/team/{team_name}/meta_knowledge_graph endpoint", () => {
test("Query to Text Mining team Should return 200 with valid response", async () => {
await request(app)
.get("/v1/team/Text Mining Provider/predicates")
.get("/v1/team/Text Mining Provider/meta_knowledge_graph")
.expect(200)
.expect('Content-Type', /json/)
.then((response) => {
Expand All @@ -15,7 +15,7 @@ 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")
.get("/v1/team/wrong team/meta_knowledge_graph")
.expect(404)
.expect('Content-Type', /json/)
.then((response) => {
Expand Down
4 changes: 2 additions & 2 deletions __test__/unittest/routes/predicates.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ jest.mock('../../../src/controllers/predicates');



describe("Test /v1/predicates endpoint", () => {
describe("Test /v1/meta_knowledge_graph endpoint", () => {


test("Should return 404 with valid response", async () => {
pred.mockImplementation(() => {
throw new PredicatesLoadingError();
})
await request(app)
.get("/v1/predicates")
.get("/v1/meta_knowledge_graph")
.expect(404)
.expect('Content-Type', /json/)
.then(res => {
Expand Down
4 changes: 2 additions & 2 deletions __test__/unittest/routes/predicates_team.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ jest.mock('../../../src/controllers/predicates');



describe("Test /v1/predicates endpoint", () => {
describe("Test /v1/meta_knowledge_graph endpoint", () => {


test("Should return 404 with valid response", async () => {
pred.mockImplementation(() => {
throw new PredicatesLoadingError();
})
await request(app)
.get("/v1/team/Text Mining Provider/predicates")
.get("/v1/team/Text Mining Provider/meta_knowledge_graph")
.expect(404)
.expect('Content-Type', /json/)
.then(res => {
Expand Down
8 changes: 4 additions & 4 deletions docs/smartapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ paths:
return all associations
tags:
- metadata
/predicates:
/meta_knowledge_graph:
get:
responses:
'200':
Expand All @@ -139,7 +139,7 @@ paths:
tags:
- metadata
- 0.9.2
/v1/predicates:
/v1/meta_knowledge_graph:
get:
tags:
- predicates
Expand All @@ -166,7 +166,7 @@ paths:
'biolink:Gene':
- biolink:directly_interacts_with
- biolink:decreases_activity_of
/v1/smartapi/{smartapi_id}/predicates:
/v1/smartapi/{smartapi_id}/meta_knowledge_graph:
get:
tags:
- predicates
Expand Down Expand Up @@ -201,7 +201,7 @@ paths:
'biolink:Gene':
- biolink:directly_interacts_with
- biolink:decreases_activity_of
/v1/team/{team_name}/predicates:
/v1/team/{team_name}/meta_knowledge_graph:
get:
tags:
- predicates
Expand Down
8 changes: 4 additions & 4 deletions examples/v1/branched_query.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"query_graph": {
"nodes": {
"n0": {
"category": "biolink:Disease",
"id": "MONDO:0005737"
"categories": "biolink:Disease",
"ids": "MONDO:0005737"
},
"n1": {
"category": "biolink:Gene"
"categories": "biolink:Gene"
},
"n2": {
"category": "biolink:ChemicalSubstance"
"categories": "biolink:ChemicalSubstance"
}
},
"edges": {
Expand Down
6 changes: 3 additions & 3 deletions examples/v1/invalid/query_graph_with_edges_not_specified.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"query_graph": {
"nodes": {
"n0": {
"category": "biolink:Gene",
"id": "NCBIGene:1017"
"categories": "biolink:Gene",
"ids": "NCBIGene:1017"
},
"n1": {
"category": "biolink:ChemicalSubstance"
"categories": "biolink:ChemicalSubstance"
}
},
"edges": {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
"query_graph": {
"nodes": {
"n0": {
"category": "biolink:Gene",
"id": "NCBIGene:1017"
"categories": "biolink:Gene",
"ids": "NCBIGene:1017"
},
"n2": {
"category": "biolink:ChemicalSubstance"
"categories": "biolink:ChemicalSubstance"
}
},
"edges": {
"e01": {
"subject": "n0",
"object": "n1",
"predicate": "biolink:physically_interacts_with"
"predicates": "biolink:physically_interacts_with"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"e01": {
"subject": "n0",
"object": "n1",
"predicate": "biolink:physically_interacts_with"
"predicates": "biolink:physically_interacts_with"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"query_graph": {
"nodes": {
"n0": {
"category": "biolink:Attribute",
"id": "NCIT:C28421"
"categories": "biolink:Attribute",
"ids": "NCIT:C28421"
},
"n3": {
"category": "biolink:DiseaseOrPhenotypicFeature"
"categories": "biolink:DiseaseOrPhenotypicFeature"
}
},
"edges": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"query_graph": {
"nodes": {
"n0": {
"category": "biolink:DiseaseOrPhenotypicFeature",
"id": "MONDO:0005015"
"categories": "biolink:DiseaseOrPhenotypicFeature",
"ids": "MONDO:0005015"
},
"n3": {
"category": "biolink:DiseaseOrPhenotypicFeature"
"categories": "biolink:DiseaseOrPhenotypicFeature"
}
},
"edges": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"query_graph": {
"nodes": {
"n0": {
"category": "biolink:Drug",
"id": "CHEBI:86990"
"categories": "biolink:Drug",
"ids": "CHEBI:86990"
},
"n3": {
"category": "biolink:Disease"
"categories": "biolink:Disease"
}
},
"edges": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"query_graph": {
"nodes": {
"n0": {
"category": "biolink:Observation",
"id": "NCIT:C110935"
"categories": "biolink:Observation",
"ids": "NCIT:C110935"
},
"n3": {
"category": "biolink:DiseaseOrPhenotypicFeature"
"categories": "biolink:DiseaseOrPhenotypicFeature"
}
},
"edges": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
"query_graph": {
"nodes": {
"n0": {
"category": "biolink:Gene",
"id": "NCBIGene:1017"
"categories": "biolink:Gene",
"ids": "NCBIGene:1017"
},
"n1": {
"category": "biolink:ChemicalSubstance"
"categories": "biolink:ChemicalSubstance"
}
},
"edges": {
"e01": {
"subject": "n0",
"object": "n1",
"predicate": "biolink:physically_interacts_with"
"predicates": "biolink:physically_interacts_with"
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions examples/v1/query_disease_has_phenotype.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
"query_graph": {
"nodes": {
"n0": {
"category": "biolink:Disease",
"id": "MONDO:0016575"
"categories": "biolink:Disease",
"ids": "MONDO:0016575"
},
"n1": {
"category": "biolink:PhenotypicFeature"
"categories": "biolink:PhenotypicFeature"
}
},
"edges": {
"e01": {
"subject": "n0",
"object": "n1",
"predicate": "biolink:has_phenotype"
"predicates": "biolink:has_phenotype"
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions examples/v1/query_genes_relate_to_disease.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"query_graph": {
"nodes": {
"n0": {
"category": "biolink:Disease",
"id": "MONDO:0005737"
"categories": "biolink:Disease",
"ids": "MONDO:0005737"
},
"n1": {
"category": "biolink:Gene"
"categories": "biolink:Gene"
}
},
"edges": {
Expand Down
8 changes: 4 additions & 4 deletions examples/v1/query_multihop_disease_gene_chemical.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"query_graph": {
"nodes": {
"n0": {
"category": "biolink:Disease",
"id": "MONDO:0005737"
"categories": "biolink:Disease",
"ids": "MONDO:0005737"
},
"n1": {
"category": "biolink:Gene"
"categories": "biolink:Gene"
},
"n2": {
"category": "biolink:ChemicalSubstance"
"categories": "biolink:ChemicalSubstance"
}
},
"edges": {
Expand Down
6 changes: 3 additions & 3 deletions examples/v1/query_with_category_as_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"query_graph": {
"nodes": {
"n0": {
"id": "UMLS:C0008780",
"category": "biolink:PhenotypicFeature"
"ids": "UMLS:C0008780",
"categories": "biolink:PhenotypicFeature"
},
"n1": {
"category": [
"categories": [
"biolink:Disease",
"biolink:BiologicalProcess",
"biolink:Pathway"
Expand Down
Loading

0 comments on commit 5087c27

Please sign in to comment.