from typing import Optional


def normalise_ontology_identifier(identifier: str) -> Optional[str]:
    """
    Normalise ontology identifier representation in order to make direct string-to-string comparison possible.
    Ex:
    'http://www.orpha.net/ORDO/Orphanet_178506' --> 'Orphanet_178506'
    'BTO:0000305' --> 'BTO_0000305'
    """

    return identifier.split('/')[-1].replace(':', '_')