biothings / biothings_explorer

TRAPI service for BioThings Explorer
https://explorer.biothings.io
Apache License 2.0
10 stars 11 forks source link

TRAPI 1.4 validation warnings: listing them #702

Open colleenXu opened 1 year ago

colleenXu commented 1 year ago

UPDATED:

Noticed while testing templates for https://github.com/biothings/bte_trapi_query_graph_handler/pull/169

Not doing a full analysis of them right now. These likely won't cause any problems in the near-future.

two edge-attribute's type_id issues, from Automat KPs Occurs when running some "chem affects gene" queries * Magnesium `PUBCHEM.COMPOUND:5462224` decreases activity/abundance of what genes? [new_mgDecreased.txt](https://github.com/biothings/biothings_explorer/files/12384226/new_mgDecreased.txt) * Magnesium `PUBCHEM.COMPOUND:5462224` increases activity/abundance of what genes? [new_mgIncreased.txt](https://github.com/biothings/biothings_explorer/files/12384267/new_mgIncreased.txt) (1) `biolink:Attribute` warning error code: [warning.knowledge_graph.edge.attribute.type_id.not_association_slot](https://ncatstranslator.github.io/reasoner-validator/validation_codes_dictionary.html#warning-knowledge-graph-edge-attribute-type-id-not-association-slot) Analysis: seems like warning raised when Automat KPs use `'biolink:Attribute'` as the edge-attribute's type_id. Comes from multiple Automat KPs: CTD, Pharos, Drug-Central, Example snippets ``` {'warning.knowledge_graph.edge.attribute.type_id.not_association_slot': {'infores:ctd -> infores:automat-ctd -> infores:biothings-explorer': {'biolink:Attribute': [{'edge_id': 'PUBCHEM.COMPOUND:5462224[biolink:SmallMolecule]--biolink:affects->NCBIGene:1786[biolink:Gene]'}, {'warning.knowledge_graph.edge.attribute.type_id.not_association_slot': {'infores:pharos -> infores:automat-pharos -> infores:biothings-explorer': {'biolink:Attribute': [{'edge_id': 'PUBCHEM.COMPOUND:3446[biolink:SmallMolecule]--biolink:affects->NCBIGene:3786[biolink:Gene]'}, 'infores:gtopdb -> infores:drugcentral -> infores:automat-drug-central -> infores:biothings-explorer': {'biolink:Attribute': [{'edge_id': 'PUBCHEM.COMPOUND:3446[biolink:SmallMolecule]--biolink:affects->NCBIGene:3786[biolink:Gene]'}, {'edge_id': 'PUBCHEM.COMPOUND:3446[biolink:SmallMolecule]--biolink:affects->NCBIGene:3786[biolink:Gene]'}]}}} ``` (2) `dct:description` warning error code: [warning.knowledge_graph.edge.attribute.type_id.non_biolink_prefix](https://ncatstranslator.github.io/reasoner-validator/validation_codes_dictionary.html#warning-knowledge-graph-edge-attribute-type-id-non-biolink-prefix) Analysis: seems like warning raised when Automat KPs use `'dct:description'` as the edge-attribute's type_id. Comes from Automat KP: CTD Example snippets ``` {'infores:ctd -> infores:automat-ctd -> infores:biothings-explorer': {'dct:description': [{'edge_id': 'PUBCHEM.COMPOUND:5462224[biolink:SmallMolecule]--biolink:affects->NCBIGene:1786[biolink:Gene]'}, ```
warning raised for x-bte-derived edge-attributes: has_count, has_quotient, has_total Occurs when running creative-mode treats for Timothy syndrome `MONDO:0010979`: [timothy-syndrome.txt](https://github.com/biothings/biothings_explorer/files/12366746/timothy-syndrome.txt) error code: [warning.knowledge_graph.edge.attribute.type_id.not_association_slot](https://ncatstranslator.github.io/reasoner-validator/validation_codes_dictionary.html#warning-knowledge-graph-edge-attribute-type-id-not-association-slot) Analysis: Edges that raise error should basically be from MyDisease's disease-phenotype operations and their response-mapping. Easy to address by removing those fields from parameters + response-mapping. Snippets of warnings: ``` {'warning.knowledge_graph.edge.attribute.type_id.not_association_slot': {'infores:hpo-annotations -> infores:mydisease-info -> infores:biothings-explorer': {'biolink:has_count': [{'edge_id': 'MONDO:0010979[biolink:Disease]--biolink:has_phenotype->HP:0002045[biolink:PhenotypicFeature]'}, {'edge_id': 'MONDO:0010979[biolink:Disease]--biolink:has_phenotype->MONDO:0005027[biolink:Disease]'}, 'biolink:has_quotient': [{'edge_id': 'MONDO:0010979[biolink:Disease]--biolink:has_phenotype->HP:0002045[biolink:PhenotypicFeature]'}, {'edge_id': 'MONDO:0010979[biolink:Disease]--biolink:has_phenotype->MONDO:0005027[biolink:Disease]'}, 'biolink:has_total': [{'edge_id': 'MONDO:0010979[biolink:Disease]--biolink:has_phenotype->HP:0002045[biolink:PhenotypicFeature]'}, {'edge_id': 'MONDO:0010979[biolink:Disease]--biolink:has_phenotype->MONDO:0005027[biolink:Disease]'}, {'edge_id': 'MONDO:0010979[biolink:Disease]--biolink:has_phenotype->HP:0001252[biolink:PhenotypicFeature]'}, ```
warning raised whenever ChemicalEntity ID is DRUGBANK Occurs when running creative-mode "what chem decreases activity/abundance of CYP27B1 `NCBIGene:1594`": [CYP27B1decreased.txt](https://github.com/biothings/biothings_explorer/files/12366808/CYP27B1decreased.txt) error code: [warning.knowledge_graph.node.id.unmapped_prefix](https://ncatstranslator.github.io/reasoner-validator/validation_codes_dictionary.html#warning-knowledge-graph-node-id-unmapped-prefix) Analysis: Same as ChemicalEntity + CHEMBL.COMPOUND warning [discussed in Translator Slack](https://ncatstranslator.slack.com/archives/C014B3JAX36/p1691521555677929), with the same way of addressing it (adding it as allowed prefix for the semantic type in biolink-model). Warning: ``` {'warning.knowledge_graph.node.id.unmapped_prefix': {'global': {"['biolink:ChemicalEntity']": [{'node_id': 'DRUGBANK:DB11639'}, {'node_id': 'CHEMBL.COMPOUND:CHEMBL2108518'}]}}} ```
colleenXu commented 1 year ago

Noting that our "empty responses" due to timeout trigger a TRAPI warning. I'm not sure if this response is built by ARS or by us...

Warning text

``` Reasoner Validator version '3.9.1' validating against TRAPI version 'v1.4.2'and Biolink Model version '3.5.3'. Warnings: * Trapi Response Status: => TRAPI Response has unrecognized status code $ global # Failed ```

The "raw JSON" from ARAX

https://arax.ncats.io/api/arax/v1.4/response/57083821-4778-48f5-9aef-78c6e3b414b3 ``` { "description": "TimeoutError: Promise timed out after 300000 milliseconds", "message": { "knowledge_graph": { "edges": {}, "nodes": {} }, "query_graph": { "edges": { "t_edge": { "knowledge_type": "inferred", "object": "on", "predicates": [ "biolink:treats" ], "subject": "sn" } }, "nodes": { "on": { "categories": [ "biolink:Disease" ], "ids": [ "MONDO:0009410" ] }, "sn": { "categories": [ "biolink:ChemicalEntity" ] } } }, "results": [] }, "status": "Failed", "validation_result": { "message": "", "n_edges": 0, "n_nodes": 0, "provenance_summary": { "n_sources": 0, "predicate_counts": {}, "provenance_counts": {} }, "size": "2 kB", "status": "PASS", "validation_messages": { "critical": {}, "errors": {}, "information": {}, "warnings": { "warning.trapi.response.status.unknown": { "global": { "Failed": null } } } }, "validation_messages_text": "Reasoner Validator version '3.9.1' validating against TRAPI version 'v1.4.2'and Biolink Model version '3.5.3'.\n\n\nWarnings:\n* Trapi Response Status:\n=> TRAPI Response has unrecognized status code\n\t$ global\n\t\t# Failed", "version": "1.4.2" } } ```

From the ARS

https://ars-dev.transltr.io/ars/api/messages/57083821-4778-48f5-9aef-78c6e3b414b3 ``` { "model": "tr_ars.message", "pk": "57083821-4778-48f5-9aef-78c6e3b414b3", "fields": { "name": "ara-bte", "code": 200, "status": "Done", "actor": 3, "timestamp": "2023-08-28T20:08:45.277Z", "updated_at": "2023-08-28T20:13:45.836Z", "data": { "status": "Failed", "message": { "results": [], "query_graph": { "edges": { "t_edge": { "object": "on", "subject": "sn", "predicates": [ "biolink:treats" ], "knowledge_type": "inferred" } }, "nodes": { "on": { "ids": [ "MONDO:0009410" ], "categories": [ "biolink:Disease" ] }, "sn": { "categories": [ "biolink:ChemicalEntity" ] } } }, "knowledge_graph": { "edges": {}, "nodes": {} } }, "description": "TimeoutError: Promise timed out after 300000 milliseconds" }, "url": null, "ref": "e59275b8-0c4e-44d0-abb5-d0554ba503ac", "result_count": 500, "result_stat": { "mean": 0.9446674560603612, "stdev": 0.046354629045763755, "median": 0.9640275800758168, "maximum": 0.9999797400180384, "minimum": 0.8482836399575131 }, "retain": false, "merge_semaphore": false, "merged_version": null, "merged_versions_list": null } } ```