is_known_identifier

is_known_identifier(prefix, identifier)[source]

Check that an identifier can be normalized and also matches a prefix’s local unique identifier pattern.

Parameters
  • prefix (str) – The prefix in the CURIE

  • identifier (str) – The identifier in the CURIE

Return type

Optional[bool]

Returns

Whether this identifier passes validation, after normalization

See also

The is_valid_identifier() does not perform normalization before checking validity

>>> is_known_identifier("chebi", "1234")
True
>>> is_known_identifier("chebi", "CHEBI:12345")
True
>>> is_known_identifier("chebi", "CHEBI:ABCD")
False