MaastrichtU-IDS / knowledge-collaboratory

🔬 Website to help browse and publish Nanopublications
https://collaboratory.semanticscience.org
MIT License
6 stars 6 forks source link

500 error when biolink:DiseaseOrPhenotypicFeature in QNode categories #18

Open CaseyTa opened 3 months ago

CaseyTa commented 3 months ago

I ran a query in UI-Test for what drugs may treat rheuamtoid arthritis to check ARAX's interaction with Knowledge Collaboratory.

Test run from UI: https://ui.test.transltr.io/main/results?l=Rheumatoid%20Arthritis&i=MONDO:0008383&t=0&r=0&q=6909142a-5150-42e9-aeef-523ee7cf6d10

Here are the specific results from ARAX: https://arax.ncats.io/?r=7a6a3b30-78e6-4a6a-8f9b-a2a5ae1ba613

Results from ARAX UI show that Knowledge Collab responded with HTTP error 500.

ARAX UI says this is the query sent to Knowledge Collab:

{
  "message": {
    "query_graph": {
      "edges": {
        "t_edge": {
          "knowledge_type": "lookup",
          "object": "on",
          "predicates": [
            "biolink:treats"
          ],
          "subject": "sn"
        }
      },
      "nodes": {
        "on": {
          "categories": [
            "biolink:PhenotypicFeature",
            "biolink:DiseaseOrPhenotypicFeature",
            "biolink:Disease"
          ],
          "ids": [
            "MONDO:0008383"
          ],
          "is_set": false,
          "set_interpretation": "BATCH"
        },
        "sn": {
          "categories": [
            "biolink:ChemicalEntity"
          ],
          "is_set": true,
          "set_interpretation": "BATCH"
        }
      }
    }
  },
  "submitter": "infores:arax"
}

I sent that query directly to Knowledge Collab in ITRB-Test and can replicate the 500 error.

After testing several variations of the query, it seems like it's the inclusion of biolink:DiseaseOrPhenotypicFeature that induces the 500 error. Removing just biolink:DiseaseOrPhenotypicFeature allows Knowledge Collab to return a successful response, e.g.,:

{
  "message": {
    "query_graph": {
      "edges": {
        "t_edge": {
          "knowledge_type": "lookup",
          "object": "on",
          "predicates": [
            "biolink:treats"
          ],
          "subject": "sn"
        }
      },
      "nodes": {
        "on": {
          "categories": [
            "biolink:PhenotypicFeature",
            "biolink:Disease"
          ],
          "ids": [
            "MONDO:0008383"
          ],
          "is_set": false,
          "set_interpretation": "BATCH"
        },
        "sn": {
          "categories": [
            "biolink:ChemicalEntity"
          ],
          "is_set": true,
          "set_interpretation": "BATCH"
        }
      }
    }
  },
  "submitter": "infores:arax"
}

Conversely, having only biolink:DiseaesOrPhenotypicFeature causes the error.

{
  "message": {
    "query_graph": {
      "edges": {
        "t_edge": {
          "knowledge_type": "lookup",
          "object": "on",
          "predicates": [
            "biolink:treats"
          ],
          "subject": "sn"
        }
      },
      "nodes": {
        "on": {
          "categories": [
            "biolink:DiseaseOrPhenotypicFeature"
          ],
          "ids": [
            "MONDO:0008383"
          ],
          "is_set": false,
          "set_interpretation": "BATCH"
        },
        "sn": {
          "categories": [
            "biolink:ChemicalEntity"
          ],
          "is_set": true,
          "set_interpretation": "BATCH"
        }
      }
    }
  },
  "submitter": "infores:arax"
}
CaseyTa commented 3 weeks ago

@micheldumontier This issue is ongoing, and I believe is the cause of the following issue created by @isbluis (ARAX) https://github.com/NCATSTranslator/Feedback/issues/946

From their example, the query they're sending is:

{
  "message": {
    "query_graph": {
      "edges": {
        "e0": {
          "knowledge_type": "inferred",
          "object": "un",
          "predicates": [
            "biolink:related_to"
          ],
          "subject": "sn"
        }
      },
      "nodes": {
        "sn": {
          "categories": [
            "biolink:DiseaseOrPhenotypicFeature",
            "biolink:PhenotypicFeature",
            "biolink:Disease"
          ],
          "ids": [
            "MONDO:0005180"
          ],
          "is_set": false,
          "set_interpretation": "BATCH"
        },
        "un": {
          "categories": [
            "biolink:NamedThing"
          ],
          "is_set": true,
          "set_interpretation": "BATCH"
        }
      }
    }
  },
  "submitter": "infores:arax"
}
micheldumontier commented 2 weeks ago

i tried these queries on our locally deployed services, and i don't get the error. without access to the docker containers to see the errors, i can't fix this.

CaseyTa commented 2 weeks ago

@micheldumontier This seems to be better, but not fully resolved yet.

This query still produces the 500 error, but at least it does so within a couple seconds (not 30 seconds anymore):

{
  "message": {
    "query_graph": {
      "edges": {
        "t_edge": {
          "knowledge_type": "lookup",
          "object": "on",
          "predicates": [
            "biolink:treats"
          ],
          "subject": "sn"
        }
      },
      "nodes": {
        "on": {
          "categories": [
            "biolink:DiseaseOrPhenotypicFeature"
          ],
          "ids": [
            "MONDO:0008383"
          ]
        },
        "sn": {
          "categories": [
            "biolink:ChemicalEntity"
          ]
        }
      }
    }
  },
  "submitter": "infores:arax"
}

The same query with ID MONDO:0005180 now returns 200 OK status response.

Will message you with the log file in Slack