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

Feature request: Add extended prefix map artifact to custom context generation #792

Closed
matentzn opened this issue Apr 3, 2023 · 2 comments · Fixed by #793
Closed

Feature request: Add extended prefix map artifact to custom context generation #792

matentzn opened this issue Apr 3, 2023 · 2 comments · Fixed by #793

Comments

@matentzn
Copy link
Collaborator

matentzn commented Apr 3, 2023

The world should rejoice at you https://github.com/cthoyt/curies#standardization

It would be great if we had the full extended prefix map for custom context generation.

(I still think we should discuss distinguishing preferred URI expansion from GUPRI expansion, but these issues are parallel)

cthoyt added a commit that referenced this issue Apr 3, 2023
cthoyt added a commit that referenced this issue Apr 4, 2023
@matentzn
Copy link
Collaborator Author

matentzn commented Apr 4, 2023

@cthoyt awesome thanks a ton!

@cthoyt
Copy link
Member

cthoyt commented Apr 4, 2023

Example usage:

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'

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