ranking-agent / aragorn-ranker

Exposes TRAPI functions to add literature co-occurrence edges, convert publications to edge weights, and provide scores for answers.
MIT License
0 stars 1 forks source link

Lookup prefixes dynamically #13

Closed cbizon closed 3 years ago

cbizon commented 3 years ago

Addresses https://github.com/ranking-agent/aragorn-ranker/issues/12

One thing that appears to be happening is that we don't keep the paper counts for nodes in the cache, so those always go to postgres (should update this too)

The postgres omnicorp checked the prefixes against an internal list, but that list needs to be updated regularly. This version checks postgres and just pulls what tables are there, rather than hard coding it.

It also handles that some prefixes have "." in them, which have to be converted to "_" as a table name.

This hasn't been fully tested, can you take a look @PhillipsOwen ?

cbizon commented 3 years ago

i note that NCBITaxon, NCBIGene curies are not getting handled (not in self.prefixes).

You mean in master? Or on the PR? Fixing this was the main goal of the PR (it also wouldn't handle pubchem.compound among others)

PhillipsOwen commented 3 years ago

sorry let me test this again. i didnt pull the branch properly

PhillipsOwen commented 3 years ago

utils.py, line 39

prefix = curie.lower().split(':') prefix = '_'.join(prefix.split('.')) is throwing -> AttributeError: 'list' object has no attribute 'split'

did you mean: prefix = '_'.join(prefix[0].split('.'))

cbizon commented 3 years ago

did you mean: prefix = '_'.join(prefix[0].split('.'))

Oops, yeah. Thanks