Skip to content

geneontology/curie-util-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Curie Util

Python Library to translate CURIEs to IRIs and vice versa. Python version based on the Java Implementation: https://github.com/prefixcommons/curie-util and the JavaScript Implementation: https://github.com/geneontology/curie-util-es5

Install

pip install curieutil

Usage

Retrieve a JSON-LD file such as: https://github.com/prefixcommons/biocontext/blob/master/registry/go_context.jsonld

import requests
url = 'https://raw.githubusercontent.com/prefixcommons/biocontext/master/registry/go_context.jsonld'
r = requests.get(url)

Then create a CurieUtil object:

from src.curieutil import CurieUtil
mapping = CurieUtil.parseContext(r.json())
curie = CurieUtil(mapping)

Get IRI

curie.getIri("ZFIN:ZDB-GENE-031112-7")
curie.getIri("MGI:MGI:34340")

Get CURIE

curie.getCurie("http://identifiers.org/zfin/ZDB-GENE-031112-7")
curie.getCurie("http://identifiers.org/mgi/MGI:34340")

Notes

About

Python Library to translate CURIEs to IRIs and vice versa

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages