-
Notifications
You must be signed in to change notification settings - Fork 14
Closed
Description
Right now, we are using the bioregistry bimap, and old bioregistry tooling for getting from CU:RIE string to URIs and back.
@cthoyt has now introduced the concept of "extended prefix maps" which are much more powerful for guessing and standardising prefixes then the bimap.
Here is a snippet:
import curies
#: OBO context's extended prefix map
url = "https://github.com/biopragmatics/bioregistry/raw/main/exports/contexts/obo.epm.json"
converter = curies.Converter.from_extended_prefix_map(url)
>>> converter.expand("GO:1234567")
'http://purl.obolibrary.org/obo/GO_1234567'
>>> converter.compress("http://purl.obolibrary.org/obo/GO_1234567")
'GO:1234567'
>>> converter.compress("http://amigo.geneontology.org/amigo/term/GO:1234567")
'GO:1234567'
>>> converter.standardize_prefix("gomf")
'GO'
>>> converter.standardize_curie"gomf:1234567")
'GO:1234567'
>>> converter.standardize_uri("http://amigo.geneontology.org/amigo/term/GO:1234567")
'http://purl.obolibrary.org/obo/GO_1234567'We should replace the old way of doing this with the new one.
For now, I still want to mirror the prefix map as part of the package rather than relying on bioregistry to doing the hosting/versioning.
Metadata
Metadata
Assignees
Labels
No labels