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

use canonical direction #117

Closed
wants to merge 2 commits into from
Closed

use canonical direction #117

wants to merge 2 commits into from

Conversation

rjawesome
Copy link
Contributor

@rjawesome rjawesome commented Aug 5, 2022

Uses canonical direction instead of query direction as stated by this issue. Depends on this PR on biolink-model.js

Example query w/ query direction of treated_by (not canonical):

{
    "message": {
        "query_graph": {
            "nodes": {
                "n0": {
                    "ids": ["MONDO:0018956"]
                },
                "n1": {
                    "ids": ["PUBCHEM.COMPOUND:84029"]
                }
            },
            "edges": {
                "e01": {
                    "subject": "n0",
                    "object": "n1"
                }
            }
        }
    }
}

Reponse (the knowledge_graph edge):

                "44da256a3888bc5cbd2da115e64f92f4": {
                    "predicate": "biolink:treats",
                    "subject": "PUBCHEM.COMPOUND:84029",
                    "object": "MONDO:0018956",
                    

@codecov
Copy link

codecov bot commented Aug 5, 2022

Codecov Report

Merging #117 (f41c9af) into main (984f68e) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #117   +/-   ##
=======================================
  Coverage   57.80%   57.80%           
=======================================
  Files          25       25           
  Lines        2057     2057           
=======================================
  Hits         1189     1189           
  Misses        868      868           
Impacted Files Coverage Δ
src/biolink.js 100.00% <100.00%> (ø)
src/graph/graph.js 96.42% <100.00%> (ø)
src/index.js 34.54% <100.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@tokebe
Copy link
Member

tokebe commented Aug 12, 2022

Looks fine to me, tested with another query:

curl --request POST \
  --url http://localhost:3000/v1/query \
  --header 'Content-Type: application/json' \
  --data '{
  "message": {
    "query_graph": {
      "nodes": {
        "n02": {
          "categories": [
            "biolink:Disease"
          ],
          "ids": ["MONDO:0005377"]
        },
        "n01": {
          "categories": [
            "biolink:ChemicalEntity"
          ]
        }
      },
      "edges": {
        "e01": {
          "subject": "n02",
          "object": "n01",
          "predicates": ["biolink:treated_by"]
        }
      }
    }
  }
}'

Tagging @colleenXu for a quick confirmation that everything looks fine

@tokebe
Copy link
Member

tokebe commented Oct 25, 2023

Original issue not planned.

@tokebe tokebe closed this Oct 25, 2023
@tokebe tokebe deleted the add_canonical_info branch November 29, 2023 19:08
@tokebe tokebe restored the add_canonical_info branch November 29, 2023 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants