broadinstitute / molecular-data-provider

Molecular Data Provider
MIT License
11 stars 8 forks source link

TRAPI 1.4 validation issues #306

Closed maximusunc closed 4 months ago

maximusunc commented 1 year ago

I'm hitting dev molepro and upon validation of the responses, it looks like there are a few errors:

codewarrior2000 commented 1 year ago

Thank you @maximusunc for your issue #306. To help our team get a better understanding of the problem please give the query and URL you had used to get that response with errors.

Many thanks, Larry

maximusunc commented 1 year ago

Hi Larry, sure thing.

URL: https://translator.broadinstitute.org/molepro/trapi/v1.4/query QUERY:

{
  "message": {
    "query_graph": {
      "nodes": {
        "chemical": {
          "ids": null,
          "categories": [
            "biolink:ChemicalEntity"
          ],
          "is_set": false,
          "constraints": []
        },
        "h": {
          "ids": [
            "UMLS:C1415478",
            "UMLS:C1415477",
            "UMLS:C1415477"
          ],
          "categories": [
            "biolink:Gene",
            "biolink:Protein"
          ],
          "is_set": false,
          "constraints": []
        }
      },
      "edges": {
        "edge_2": {
          "subject": "chemical",
          "object": "h",
          "knowledge_type": null,
          "predicates": [
            "biolink:affects"
          ],
          "attribute_constraints": [],
          "qualifier_constraints": [
            {
              "qualifier_set": [
                {
                  "qualifier_type_id": "biolink:object_aspect_qualifier",
                  "qualifier_value": "activity_or_abundance"
                },
                {
                  "qualifier_type_id": "biolink:object_direction_qualifier",
                  "qualifier_value": "increased"
                }
              ]
            }
          ]
        }
      }
    }
  }
}
codewarrior2000 commented 1 year ago

Thank you @maximusunc ! We will have our best minds working on the errors right away.

Many thanks, Larry

marcdubybroad commented 1 year ago

Fixed the analysis portion on branch md_trapi-1.4.0.1

marcdubybroad commented 1 year ago

For the biolink: prefix for the resource role, I can pull it out in the code or the DB has to be modified; the latter should be simple.

maximusunc commented 1 year ago

I'm getting another TRAPI validation error now: knowledge_graph.edge.qualifiers.qualifier_type_id does not have a biolink: prefix. This is the query I sent to https://translator.broadinstitute.org/molepro/trapi/v1.4/query:

{
  "message": {
    "query_graph": {
      "nodes": {
        "e": {
          "ids": [
            "PUBCHEM.COMPOUND:5284373",
            "PUBCHEM.COMPOUND:1102"
          ],
          "categories": [
            "biolink:ChemicalEntity"
          ],
          "is_set": false,
          "constraints": []
        },
        "i": {
          "ids": null,
          "categories": [
            "biolink:BiologicalEntity"
          ],
          "is_set": false,
          "constraints": []
        }
      },
      "edges": {
        "edge_2": {
          "subject": "i",
          "object": "e",
          "knowledge_type": null,
          "predicates": [
            "biolink:affects"
          ],
          "attribute_constraints": [],
          "qualifier_constraints": [
            {
              "qualifier_set": [
                {
                  "qualifier_type_id": "biolink:object_aspect_qualifier",
                  "qualifier_value": "activity_or_abundance"
                },
                {
                  "qualifier_type_id": "biolink:object_direction_qualifier",
                  "qualifier_value": "decreased"
                }
              ]
            }
          ]
        }
      }
    }
  }
}
codewarrior2000 commented 1 year ago

@marcdubybroad I ran Max's query above on https://translator.broadinstitute.org/molepro/trapi/v1.4/query and I did see a few knowledge_graph.edge.qualifiers.qualifier_type_id are missing the biolink: prefix. Below is just an excerpt of the response knowledge graph.

But it is likely a recency issue. The version of TRAPI hosted on https://translator.broadinstitute.org/ (the Development deployment on Broad's server) is outdated and defective while the version of TRAPI hosted on https://molepro-trapi.transltr.io (the Production deployment on the Translator server) does not produce responses that are missing biolink prefixes.

…
        "e2-wEwtNV10fz": {
          "attributes": [
            {   
              "attribute_source": "infores:ctd",
              "attribute_type_id": "biolink:OrganismTaxon",
              "attributes": [],
              "description": "Rattus norvegicus",
              "original_attribute_name": "TaxonID",
              "value": "NCBITaxon:10116"
            },
            {
              "attribute_source": "infores:ctd",
              "attribute_type_id": "biolink:relation",
              "attributes": [],
              "original_attribute_name": "Relation",
              "value": "abundance increased by",
              "value_type_id": "string"
            },
            { 
              "attribute_type_id": "biolink:publications",
              "value": [
                "PMID:1644166"
              ],
              "value_type_id": "linkml:Uriorcurie"
            }
          ],
          "object": "PUBCHEM.COMPOUND:1102",
          "predicate": "biolink:affects",
          "qualifiers": [
            { 
              "qualifier_type_id": "qualified_predicate",
              "qualifier_value": "biolink:causes"
            },
            { 
              "qualifier_type_id": "subject_direction_qualifier",
              "qualifier_value": "increased"
            },
            { 
              "qualifier_type_id": "subject_aspect_qualifier",
              "qualifier_value": "abundance"
            } 
          ],  
          "sources": [
            {
              "resource_id": "infores:ctd",
              "resource_role": "primary_knowledge_source"
            },
            {   
              "resource_id": "infores:molepro",
              "resource_role": "aggregator_knowledge_source",
              "upstream_resource_ids": [
                "infores:ctd"
              ]
            }
          ],
          "subject": "NCBIGene:2520"
        }  
 …
vdancik commented 4 months ago

All qualifiers returned by MolePro now have biolink: prefix.