def format_ontology_term_with_colon(str_value):
    """
    Used for ontology terms, to convert underscore-formatted term ids to
    colon-formatted term ids. Also converts term IDs to uppercase.
    Example input: 'hp_0000124'
    Example output: 'HP:0000124'
    """
    if not isinstance(str_value, str):
        raise ValueError('String value expected.')
    return str_value.upper().replace('_', ':')