linkml / prefixmaps

Semantic prefix map registry
https://linkml.io/prefixmaps/
Apache License 2.0
10 stars 3 forks source link

Add prefix synonyms from the Bioregistry #48

Closed cthoyt closed 8 months ago

cthoyt commented 8 months ago

Closes #47 by adding prefix synonyms from the Bioregistry.

There's a slight issue related to Wikidata (see #49) so there's a special case for leaving out the problematic synonyms.

import prefixmaps
import pandas as pd

def main():
    converter = prefixmaps.load_converter("merged")
    curies = ["pmid:1234", "PMID:1234", "pubmed:1234", "PubMed:1234", "PUBMED:1234", "MEDLINE:1234"]
    rows = [(curie, converter.standardize_curie(curie)) for curie in curies]
    df = pd.DataFrame(rows, columns=["raw", "standardized"])
    print(df.to_markdown(index=False))

if __name__ == "__main__":
    main()
raw standardized
pmid:1234
PMID:1234 PUBMED:1234
pubmed:1234
PubMed:1234
PUBMED:1234 PUBMED:1234
MEDLINE:1234 PUBMED:1234

We can deal with the non-uppercase ones in a follow-up