Skip to content

Commit

Permalink
fix: fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
marcodarko committed Jun 15, 2021
2 parents 56382e3 + 1f7ec7f commit 6cb4767
Show file tree
Hide file tree
Showing 8 changed files with 16,777 additions and 16,007 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

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.

### [1.17.2](https://github.com/kevinxin90/bte_trapi_query_graph_handler/compare/v1.17.1...v1.17.2) (2021-06-15)


### Bug Fixes

* :bug: change type to value_type_id in TRAPI response ([4f34d5f](https://github.com/kevinxin90/bte_trapi_query_graph_handler/commit/4f34d5f922c1914d550a1a9a22662f73282424fd))

### [1.17.1](https://github.com/kevinxin90/bte_trapi_query_graph_handler/compare/v1.17.0...v1.17.1) (2021-06-04)


Expand Down
32,613 changes: 16,688 additions & 15,925 deletions package-lock.json

Large diffs are not rendered by default.

120 changes: 60 additions & 60 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
{
"name": "@biothings-explorer/query_graph_handler",
"version": "1.17.1",
"description": "A nodejs module to query TRAPI Query Graph",
"main": "built/index.js",
"scripts": {
"test": "jest",
"test-cov": "jest --coverage",
"build": "tsc",
"coveralls": "jest --coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage",
"format": "prettier --write \"src/**/*.*s\" \"built/**/*.js\"",
"lint": "tslint -p tsconfig.json",
"prepare": "npm run build",
"prepublishOnly": "npm test",
"version": "npm run format && git add -A src",
"postversion": "git push && git push --tags",
"release": "npm run format && standard-version",
"release:minor": "npm run format && standard-version --release-as minor",
"release:patch": "npm run format && standard-version --release-as patch",
"release:major": "npm run format && standard-version --release-as major"
},
"repository": {
"type": "git",
"url": "git+https://github.com/kevinxin90/bte_trapi_query_graph_handler.git"
},
"keywords": [
"id",
"conversion",
"biomedical"
],
"author": "jiwen xin",
"license": "ISC",
"bugs": {
"url": "https://github.com/kevinxin90/bte_trapi_query_graph_handler/issues"
},
"homepage": "https://github.com/kevinxin90/bte_trapi_query_graph_handler#readme",
"devDependencies": {
"@types/debug": "^4.1.5",
"@types/jest": "^26.0.22",
"@types/node": "^14.14.37",
"coveralls": "^3.1.0",
"jest": "^26.6.3",
"prettier": "^2.2.1",
"redis-mock": "^0.56.3",
"standard-version": "^9.1.0",
"ts-jest": "^26.5.4",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0",
"typedoc": "^0.20.34",
"typescript": "^4.2.3"
},
"dependencies": {
"@biothings-explorer/call-apis": "^1.23.1",
"@biothings-explorer/smartapi-kg": "^3.8.1",
"biolink-model": "^0.3.0",
"biomedical_id_resolver": "^3.9.0",
"debug": "^4.3.1",
"lodash": "^4.17.21",
"ms": "^2.1.3",
"redis": "^3.0.2"
}
"name": "@biothings-explorer/query_graph_handler",
"version": "1.17.2",
"description": "A nodejs module to query TRAPI Query Graph",
"main": "built/index.js",
"scripts": {
"test": "jest",
"test-cov": "jest --coverage",
"build": "tsc",
"coveralls": "jest --coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage",
"format": "prettier --write \"src/**/*.*s\" \"built/**/*.js\"",
"lint": "tslint -p tsconfig.json",
"prepare": "npm run build",
"prepublishOnly": "npm test",
"version": "npm run format && git add -A src",
"postversion": "git push && git push --tags",
"release": "npm run format && standard-version",
"release:minor": "npm run format && standard-version --release-as minor",
"release:patch": "npm run format && standard-version --release-as patch",
"release:major": "npm run format && standard-version --release-as major"
},
"repository": {
"type": "git",
"url": "git+https://github.com/kevinxin90/bte_trapi_query_graph_handler.git"
},
"keywords": [
"id",
"conversion",
"biomedical"
],
"author": "jiwen xin",
"license": "ISC",
"bugs": {
"url": "https://github.com/kevinxin90/bte_trapi_query_graph_handler/issues"
},
"homepage": "https://github.com/kevinxin90/bte_trapi_query_graph_handler#readme",
"devDependencies": {
"@types/debug": "^4.1.5",
"@types/jest": "^26.0.22",
"@types/node": "^14.14.37",
"coveralls": "^3.1.0",
"jest": "^26.6.3",
"prettier": "^2.2.1",
"redis-mock": "^0.56.3",
"standard-version": "^9.1.1",
"ts-jest": "^26.5.4",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0",
"typedoc": "^0.20.34",
"typescript": "^4.2.3"
},
"dependencies": {
"@biothings-explorer/call-apis": "^1.23.1",
"@biothings-explorer/smartapi-kg": "^3.8.1",
"biolink-model": "^0.3.1",
"biomedical_id_resolver": "^3.9.0",
"debug": "^4.3.1",
"lodash": "^4.17.21",
"ms": "^2.1.3",
"redis": "^3.1.1"
}
}
8 changes: 4 additions & 4 deletions src/batch_edge_query.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = class BatchEdgeQueryHandler {
* @private
*/
_expandBTEEdges(bteEdges) {
debug(`BTE EDGE ${JSON.stringify(this.qEdges)}`)
debug(`BTE EDGE ${JSON.stringify(this.qEdges)}`);
return bteEdges;
}

Expand All @@ -57,13 +57,13 @@ module.exports = class BatchEdgeQueryHandler {
//add query predicate to the expanded list
predicate_filters.concat(item['$edge_metadata']['trapi_qEdge_obj']['qEdge']['predicate'])
//remove prefix from filter list to match predicate name format
predicate_filters = predicate_filters.map(item => utils.removeBioLinkPrefix(item))
predicate_filters = predicate_filters.map((item) => utils.removeBioLinkPrefix(item));
//compare edge predicate to filter list
this.logs.push(
new LogEntry('DEBUG', null, `query_graph_handler: Current edge post-query predicate restriction includes: ${JSON.stringify(predicate_filters)}`).getLog()
);
if (predicate_filters.includes(edge_predicate)) {
return item
return item;
}
});
debug(`Filtered results from ${response.length} down to ${filtered.length} results`);
Expand All @@ -76,7 +76,7 @@ module.exports = class BatchEdgeQueryHandler {
return filtered
} catch (error) {
debug(`Failed to filter ${response.length} results due to ${error}`);
return response
return response;
}
}

Expand Down
22 changes: 11 additions & 11 deletions src/graph/knowledge_graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,41 +22,41 @@ module.exports = class KnowledgeGraph {

_createNode(kgNode) {
const res = {
category: 'biolink:' + kgNode._semanticType,
categories: ['biolink:' + kgNode._semanticType],
name: kgNode._label,
attributes: [
{
attribute_type_id: 'equivalent_identifiers',
value: kgNode._curies,
type: 'biolink:id',
value_type_id: 'biolink:id',
},
{
attribute_type_id: 'num_source_nodes',
value: kgNode._sourceNodes.size,
type: 'bts:num_source_nodes',
value_type_id: 'bts:num_source_nodes',
},
{
attribute_type_id: 'num_target_nodes',
value: kgNode._targetNodes.size,
type: 'bts:num_target_nodes',
value_type_id: 'bts:num_target_nodes',
},
{
attribute_type_id: 'source_qg_nodes',
value: Array.from(kgNode._sourceQGNodes),
type: 'bts:source_qg_nodes',
value_type_id: 'bts:source_qg_nodes',
},
{
attribute_type_id: 'target_qg_nodes',
value: Array.from(kgNode._targetQGNodes),
type: 'bts:target_qg_nodes',
value_type_id: 'bts:target_qg_nodes',
},
],
};
for (const key in kgNode._nodeAttributes) {
res.attributes.push({
attribute_type_id: key,
value: kgNode._nodeAttributes[key],
type: 'bts:' + key,
value_type_id: 'bts:' + key,
});
}
return res;
Expand All @@ -67,24 +67,24 @@ module.exports = class KnowledgeGraph {
{
attribute_type_id: 'provided_by',
value: Array.from(kgEdge.sources),
type: 'biolink:provided_by',
value_type_id: 'biolink:provided_by',
},
{
attribute_type_id: 'api',
value: Array.from(kgEdge.apis),
type: 'bts:api',
value_type_id: 'bts:api',
},
{
attribute_type_id: 'publications',
value: Array.from(kgEdge.publications),
type: 'biolink:publication',
value_type_id: 'biolink:publication',
},
];
for (const key in kgEdge.attributes) {
attributes.push({
attribute_type_id: key,
value: kgEdge.attributes[key],
type: 'bts:' + key,
value_type_id: 'bts:' + key,
});
}
return attributes;
Expand Down
6 changes: 3 additions & 3 deletions src/qedge2bteedge.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ module.exports = class QEdge2BTEEdgeHandler {
new LogEntry(
'DEBUG',
null,
`BTE is trying to find SmartAPI edges connecting from ${qEdge
.getSubject()
.getCategories()} to ${qEdge.getObject().getCategories()} with predicate ${qEdge.getPredicate()}`,
`BTE is trying to find SmartAPI edges connecting from ${qEdge.getSubject().getCategories()} to ${qEdge
.getObject()
.getCategories()} with predicate ${qEdge.getPredicate()}`,
).getLog(),
);
let filterCriteria = {
Expand Down
6 changes: 3 additions & 3 deletions src/query_edge.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ module.exports = class QEdge {
this.predicate = info.predicates;
this.subject = info.subject;
this.object = info.object;
this.expanded_predicates = []
this.init()
this.expanded_predicates = [];
this.init();
}

init() {
this.expanded_predicates = this.getPredicate()
this.expanded_predicates = this.getPredicate();
}

getID() {
Expand Down
2 changes: 1 addition & 1 deletion src/query_graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ module.exports = class QueryGraphHandler {
`BTE identified your query graph as a ${Object.keys(paths).length}-depth query graph`,
).getLog(),
);
debug(`ALL PATHS ${JSON.stringify(paths)}`)
debug(`ALL PATHS ${JSON.stringify(paths)}`);
return paths;
}

Expand Down

0 comments on commit 6cb4767

Please sign in to comment.