TranslatorSRI / SRI_testing

MIT License
0 stars 1 forks source link

Biolink 2.x - predicates flagged as non-canonical #55

Closed CaseyTa closed 1 year ago

CaseyTa commented 1 year ago

I'm not sure whether this is an issue or user error. I'm trying to set up test triples for COHD: https://github.com/WengLab-InformaticsResearch/cohd_api/blob/f01938d3b36aeb4eb86eade8186894743ab89410/cohd/translator/sri_testing_triples.json

I'm running the onehop script as: pytest test_onehops.py::test_trapi_kps --triple_source="test_triples/KP/Clinical_Data_Provider/Columbia_Open_Health_Data_(COHD).json" --Biolink_Version="2.4.8" --one

But all tests get skipped with the following Biolink error (from cohd-0.json test result file)

{
    "subject_category": "biolink:SmallMolecule",
    "object_category": "biolink:SmallMolecule",
    "predicate": "biolink:has_real_world_evidence_of_association_with",
    "subject": "PUBCHEM.COMPOUND:2157",
    "object": "PUBCHEM.COMPOUND:135565674",
    "idx": 0,
    "biolink_errors": [
        "2.4.8",
        [
            "BLM Version 2.4.8 Error in Input Edge: Input predicate 'biolink:has_real_world_evidence_of_association_with' is non-canonical?"
        ]
    ],
    "kp_test_data_location": "test_triples/KP/Clinical_Data_Provider/Columbia_Open_Health_Data_(COHD).json",
    "url": "https://cohd-api.transltr.io/api",
    "kp_api_name": "Columbia_Open_Health_Data_(COHD)",
    "trapi_version": "1.3.0",
    "biolink_version": "2.4.8",
    "kp_source": "infores:cohd",
    "kp_source_type": "original",
    "query_opts": {},
    "results": {
        "by_subject": {
            "outcome": "skipped",
            "errors": [
                "test case S-P-O triple '(PUBCHEM.COMPOUND:2157$biolink:SmallMolecule)--[biolink:has_real_world_evidence_of_association_with]->(PUBCHEM.COMPOUND:135565674$biolink:SmallMolecule)', since it is not Biolink Model compliant: BLM Version 2.4.8 Error in Input Edge: Input predicate 'biolink:has_real_world_evidence_of_association_with' is non-canonical?"
            ]
        },
        "inverse_by_new_subject": {
            "outcome": "skipped",
            "errors": [
                "test case S-P-O triple '(PUBCHEM.COMPOUND:2157$biolink:SmallMolecule)--[biolink:has_real_world_evidence_of_association_with]->(PUBCHEM.COMPOUND:135565674$biolink:SmallMolecule)', since it is not Biolink Model compliant: BLM Version 2.4.8 Error in Input Edge: Input predicate 'biolink:has_real_world_evidence_of_association_with' is non-canonical?"
            ]
        },
        "by_object": {
            "outcome": "skipped",
            "errors": [
                "test case S-P-O triple '(PUBCHEM.COMPOUND:2157$biolink:SmallMolecule)--[biolink:has_real_world_evidence_of_association_with]->(PUBCHEM.COMPOUND:135565674$biolink:SmallMolecule)', since it is not Biolink Model compliant: BLM Version 2.4.8 Error in Input Edge: Input predicate 'biolink:has_real_world_evidence_of_association_with' is non-canonical?"
            ]
        },
        "raise_subject_entity": {
            "outcome": "skipped",
            "errors": [
                "test case S-P-O triple '(PUBCHEM.COMPOUND:2157$biolink:SmallMolecule)--[biolink:has_real_world_evidence_of_association_with]->(PUBCHEM.COMPOUND:135565674$biolink:SmallMolecule)', since it is not Biolink Model compliant: BLM Version 2.4.8 Error in Input Edge: Input predicate 'biolink:has_real_world_evidence_of_association_with' is non-canonical?"
            ]
        },
        "raise_object_by_subject": {
            "outcome": "skipped",
            "errors": [
                "test case S-P-O triple '(PUBCHEM.COMPOUND:2157$biolink:SmallMolecule)--[biolink:has_real_world_evidence_of_association_with]->(PUBCHEM.COMPOUND:135565674$biolink:SmallMolecule)', since it is not Biolink Model compliant: BLM Version 2.4.8 Error in Input Edge: Input predicate 'biolink:has_real_world_evidence_of_association_with' is non-canonical?"
            ]
        },
        "raise_predicate_by_subject": {
            "outcome": "skipped",
            "errors": [
                "test case S-P-O triple '(PUBCHEM.COMPOUND:2157$biolink:SmallMolecule)--[biolink:has_real_world_evidence_of_association_with]->(PUBCHEM.COMPOUND:135565674$biolink:SmallMolecule)', since it is not Biolink Model compliant: BLM Version 2.4.8 Error in Input Edge: Input predicate 'biolink:has_real_world_evidence_of_association_with' is non-canonical?"
            ]
        }
    },
    "document_key": "KP/cohd/cohd-0"
}

I have bmt version 0.8.12 installed.

CaseyTa commented 1 year ago

Update: COHD is now moving to the biolink:correlated_with predicates for Biolink 3.0. We've updated our test triples accordingly (the link to the test triples data file above has been updated to show the previous version using the biolink:has_real_world_evidence_of_association_with predicate), so this Biolink 2.x issue is no longer relevant to us. This issue may still may be relevant to others, so I will leave the issue open for now.

sierra-moxon commented 1 year ago

Hi @CaseyTa - thanks for pointing this issue out; Biolink Model Toolkit is by default, opinionated about the version of Biolink Model it uses. It looks like maybe the local version of bmt isn't getting the biolink-model version you specified in the test. Good to keep open; it's definitely on mine and Richard's radar to try and reconcile biolink-model+bmt versions coherently by default.

RichardBruskiewich commented 1 year ago

Hi @CaseyTa, BMT version 0.8.12 doesn't properly validate Biolink 2.. biolink model predicates. This is due to the coding inside BMT itself, invoked by the reasoner-validator module called by SRI Testing.

Prior to the September Relay, we pinned SRI_Testing to reasoner-validator 2.2.14, which pins to BMT 0.8.4 (which limits validation to Biolink<=2.4.8) so that this error would not crop up.

For the not-too-distant future, we are aiming for an iteration of SRI_Testing using reasoner-validator 3.1., which links to BMT 0.8.12 which will have the bias of validating Biolink 3. knowledge graphs.

RichardBruskiewich commented 1 year ago

Alas, @CaseyTa, practical considerations have forced upgrade of the SRI Testing harness to BMT 0.8.12 which means that canonical predicates in Biolink Model release<=2.4.8 will be erroneously flagged as 'non_canonical'. This is unavoidable without creative recoding of the BMT itself (not SRI Testing harness nor reasoner-validator). Since Translator is moving to Biolink Model 3.0.*, this is simply a limitation with which which we'll have to live. Since the validation message is a 'warning' not a show stopping 'error', you would simply ignore the message - your test should otherwise 'pass' unless it has more serious problems.