Skip to content

Tier 0 Transpiler: bug in _filter_with_cascaded_or() #142

@tokebe

Description

@tokebe

The below query returns 3 results from Tier 1. In Tier 0, it returns over 1k results. 3 of those results are identical to the results from Tier 1. The remaining >1k are incomplete results containing only one hop, which shouldn't have survived long enough to be transpiled back into TRAPI.

Something is incorrect in _filter_cascaded_with_or(), as it should have filtered these.

This is a show-stopper level bug and a maximum priority for fixing.

Additionally, it appears that the transpiler is not making use of reverse_qualifier_constraints(), which it MUST use in order to correctly apply qualified symmetric predicates. See its usage in the Tier 1 subquery dispatcher for an example.

curl -X POST \
https://dev.retriever.biothings.io/query \
-H 'Content-Type: application/json' \
--data '{
  "parameters": { "tiers": [ 0 ], "timeout": -1 },
  "bypass_cache": true,
  "submitter": "bte-dev-tester-manual",
  "message": {
    "query_graph": {
      "nodes": {
        "nB": { "categories": [ "biolink:Disease" ], "ids": [ "MONDO:0005147" ] },
        "nI": { "categories": [ "biolink:Gene" ] },
        "nA": { "categories": [ "biolink:Drug" ], "ids": [ "CHEBI:6801" ] }
      },
      "edges": {
        "e1": {
          "subject": "nA",
          "object": "nI",
          "predicates": [ "biolink:affects" ],
          "qualifier_constraints": [
            {
              "qualifier_set": [
                {
                  "qualifier_type_id": "biolink:object_direction_qualifier",
                  "qualifier_value": "decreased"
                },
                {
                  "qualifier_type_id": "biolink:object_aspect_qualifier",
                  "qualifier_value": "activity_or_abundance"
                }
              ]
            }
          ]
        },
        "e2": {
          "subject": "nI",
          "object": "nB",
          "qualifier_constraints": [
            {
              "qualifier_set": [
                {
                  "qualifier_type_id": "biolink:subject_form_or_variant_qualifier",
                  "qualifier_value": "loss_of_function_variant_form"
                }
              ]
            }
          ]
        }
      }
    }
  }
}'

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions