Summary
When a CSV has label/name columns but no CURIE column (or a sparsely-populated one), the tool should fall back to a NameRes lookup(label, limit=1) call to fill in the CURIE automatically.
Proposed interface
csv-to-babeltests input.csv \
--label-column "Gene Name" \
--resolve-from-label # use NameRes to fill --curie-column
--target dev
If --label-column is set and --curie-column is absent or the CURIE cell is empty for a given row, call CachedNameRes.lookup(label, limit=1) and use the top result's curie field as the CURIE for that row. Emit a # resolved from label: <label> comment (or a stderr note) for traceability.
Implementation notes
CachedNameRes already exists at src/babel_validation/services/nameres.py; its lookup() method returns a list of {curie, label, score, ...} dicts — take result[0]["curie"] when the list is non-empty.
load_nodenorm_url in csv_to_babeltests.py could be extended to also return the NameResURL from targets.ini (it's already in every target section).
- Should warn to stderr when no result is found (
lookup returns []).
- Useful for workflows where only names/synonyms are available, e.g. spreadsheets exported from literature-mining tools.
Related
This tool is being developed at #77
Summary
When a CSV has label/name columns but no CURIE column (or a sparsely-populated one), the tool should fall back to a NameRes
lookup(label, limit=1)call to fill in the CURIE automatically.Proposed interface
If
--label-columnis set and--curie-columnis absent or the CURIE cell is empty for a given row, callCachedNameRes.lookup(label, limit=1)and use the top result'scuriefield as the CURIE for that row. Emit a# resolved from label: <label>comment (or a stderr note) for traceability.Implementation notes
CachedNameResalready exists atsrc/babel_validation/services/nameres.py; itslookup()method returns a list of{curie, label, score, ...}dicts — takeresult[0]["curie"]when the list is non-empty.load_nodenorm_urlincsv_to_babeltests.pycould be extended to also return theNameResURLfromtargets.ini(it's already in every target section).lookupreturns[]).Related
This tool is being developed at #77