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

Add the canonical label and Biolink type to NameRes results #43

Closed
gaurav opened this issue Mar 3, 2023 · 4 comments · Fixed by #46
Closed

Add the canonical label and Biolink type to NameRes results #43

gaurav opened this issue Mar 3, 2023 · 4 comments · Fixed by #46
Assignees

Comments

@gaurav
Copy link
Contributor

gaurav commented Mar 3, 2023

At the moment, the Translator UI queries NameRes to find identifiers to display, then queries NodeNorm for the canonical label, Biolink type and other information. Both the canonical label and the Biolink type (as needed for #39 anyway) would be great to include in the NodeNorm results so that a second NodeNorm query is not needed.

@cbizon
Copy link
Contributor

cbizon commented Mar 3, 2023

Of course the downside here is that it makes the solr documents even that much bigger

@cbizon
Copy link
Contributor

cbizon commented Mar 3, 2023

The current docs look like this, I think:

{
  "curie": "CHEBI:74925",
  "length": 42,
  "id": 192534,
  "name": "beta-site APP-cleaving enzyme 1 inhibitors"
 },
 {
  "curie": "CHEBI:74925",
  "length": 22,
  "id": 192535,
  "name": "EC 3.4.23.46 inhibitor"
 },
 {
  "curie": "CHEBI:74925",
  "length": 23,
  "id": 192536,
  "name": "EC 3.4.23.46 inhibitors"
 },
 {
  "curie": "CHEBI:74925",
  "length": 36,
  "id": 192537,
  "name": "EC 3.4.23.46 (memapsin 2) inhibitors"
 },

If we need to add the type and preferred name to every element, then oof.

I wonder if we could transform the docs to something more like

{ 
  curie: ....
  names: [ "name1", "name2", "name3"]
  type: ""
  preferred name:
}

That way the percent diff of adding the new info is paid for in the reduction of curie repetition.

@gaurav
Copy link
Contributor Author

gaurav commented Mar 3, 2023

If we need to add the type and preferred name to every element, then oof.

The other option would be for NameRes to include a Redis table that has id to canonical name + biolink type mappings, but that would complicate the backend.

I wonder if we could transform the docs to something more like

I like this! NameRes is loaded from the synonym file, which is currently in the format:

id [tab] synonym type [tab] synonym

I think we if modify this to:

id [tab] biolink type [tab] canonical label [tab] synonym type [tab] synonym

We could use Solr updates to load it in the format you suggest. The synonym files would then get much larger, but the Solr database -- which is the piece we have to transfer from RENCI to ITRB -- might end up being smaller because it has fewer documents in it.

Is it okay to drop the length field? Is it currently being used?

@cbizon
Copy link
Contributor

cbizon commented Mar 4, 2023

I think it is being used to order the synonyms when they get grouped by curie. But I think if we put all the names in one document we wouldn't need to do that (and could therefore lose it). I think that it's worth giving this a shot and seeing whether it works or not.

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 a pull request may close this issue.

2 participants