Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

losing all results on diamond query #368

Open
cbizon opened this issue May 5, 2022 · 0 comments
Open

losing all results on diamond query #368

cbizon opened this issue May 5, 2022 · 0 comments

Comments

@cbizon
Copy link
Contributor

cbizon commented May 5, 2022

If I query (V)-[p1]-(?gene)-[p2]-(C) where V and C are pinned, I get results
If I query (C)-[p1]-(?gene)-[p2]-(V) (same endpoints but swapped around) I get results

If I include both paths in the same query (2 gene nodes) I get 0 results.


This TRAPI query produces 0 results:

{
  "message": {
    "query_graph": {
      "edges": {
        "e00": {
          "subject": "n02",
          "object": "n01",
         "predicates":["biolink:degradation_increased_by", "biolink:is_substrate_of"]
        },
        "e01": {
          "subject": "n01",
          "object": "n00",
         "predicates":["biolink:activity_decreased_by","biolink:entity_negatively_regulated_by_entity"]
        },
       "e02": {
          "subject": "n00",
          "object": "n03",
          "predicates":["biolink:degradation_increased_by", "biolink:is_substrate_of"]
        },
        "e03": {
          "subject": "n03",
          "object": "n02",
          "predicates":["biolink:activity_decreased_by","biolink:entity_negatively_regulated_by_entity"]
        }
      },
      "nodes": {
        "n00": {
          "ids": ["PUBCHEM.COMPOUND:644019"],
          "categories": ["biolink:SmallMolecule"]
        },
        "n01": {
          "categories": ["biolink:Gene"]
        },
        "n02": {
          "ids": ["PUBCHEM.COMPOUND:3121"],
          "categories": ["biolink:SmallMolecule"]
        },
        "n03": {
          "categories": ["biolink:Gene"]
        },
      }
    }
  }
}

It is 2 independent paths connecting the same anchors.

If I run only one of those paths by dropping e02, e03, n03 then I get 8 results

{
  "message": {
    "query_graph": {
      "edges": {
        "e00": {
          "subject": "n02",
          "object": "n01",
         "predicates":["biolink:degradation_increased_by", "biolink:is_substrate_of"]
        },
        "e01": {
          "subject": "n01",
          "object": "n00",
         "predicates":["biolink:activity_decreased_by","biolink:entity_negatively_regulated_by_entity"]
        }
      },
      "nodes": {
        "n00": {
          "ids": ["PUBCHEM.COMPOUND:644019"],
          "categories": ["biolink:SmallMolecule"]
        },
        "n01": {
          "categories": ["biolink:Gene"]
        },
        "n02": {
          "ids": ["PUBCHEM.COMPOUND:3121"],
          "categories": ["biolink:SmallMolecule"]
        }
      }
    }
  }
}

If I instead delete the other two edges and gene node, I get 6 results

{
  "message": {
    "query_graph": {
      "edges": {
       "e02": {
          "subject": "n00",
          "object": "n03",
          "predicates":["biolink:degradation_increased_by", "biolink:is_substrate_of"]
        },
        "e03": {
          "subject": "n03",
          "object": "n02",
          "predicates":["biolink:activity_decreased_by","biolink:entity_negatively_regulated_by_entity"]
        }
      },
      "nodes": {
        "n00": {
          "ids": ["PUBCHEM.COMPOUND:644019"],
          "categories": ["biolink:SmallMolecule"]
        },
        "n02": {
          "ids": ["PUBCHEM.COMPOUND:3121"],
          "categories": ["biolink:SmallMolecule"]
        },
        "n03": {
          "categories": ["biolink:Gene"]
        },
      }
    }
  }
}

Because these two paths only intersect at bound nodes, I should get the cartesian join back (48 results)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant