def _validate_term(term_text: str, allowed_ids: list):
    """
    Check term is a valid format.

    :param term_text: text to validate, e.g. "NCBITaxon:9606" or "UBERON:12391203".
    :param allowed_ids: a list of allowed identifier prefixes, e.g. ['GO', 'UBERON'] or None if dont' want to restrict.
    :return: bool True=valid, False=not
    """
    assert(isinstance(term_text, str))
    if not allowed_ids:
        assert(isinstance(allowed_ids, list))
    if ':' not in term_text:
        return False
    elif (allowed_ids and (term_text.split(':')[0] in allowed_ids)):
        return True