normalize_curie

normalize_curie(curie, sep=':')[source]

Normalize a CURIE.

Parameters
  • curie (str) – A compact URI (CURIE) in the form of <prefix:identifier>

  • sep (str) – The separator for the CURIE. Defaults to the colon “:” however the slash “/” is sometimes used in Identifiers.org and the underscore “_” is used for OBO PURLs.

Return type

Optional[str]

Returns

A normalized CURIE, if possible using the colon as a separator

>>> normalize_curie('pdb:1234')
'pdb:1234'

Fix commonly mistaken prefix >>> normalize_curie(‘pubchem:1234’) ‘pubchem.compound:1234’

Address banana problem >>> normalize_curie(’GO:GO:1234’) ‘go:1234’ >>> normalize_curie(’go:GO:1234’) ‘go:1234’ >>> normalize_curie(’go:go:1234’) ‘go:1234’ >>> normalize_curie(’go:1234’) ‘go:1234

Address banana problem with OBO banana >>> normalize_curie(‘fbbt:FBbt:1234’) ‘fbbt:1234’ >>> normalize_curie(‘fbbt:fbbt:1234’) ‘fbbt:1234’ >>> normalize_curie(‘fbbt:1234’) ‘fbbt:1234’

Address banana problem with explit banana >>> normalize_curie(‘go.ref:GO_REF:1234’) ‘go.ref:1234’ >>> normalize_curie(‘go.ref:1234’) ‘go.ref:1234’

Parse OBO PURL curies >>> normalize_curie(‘GO_1234’, sep=”_”) ‘go:1234