def split_dbxref(dbxref: str) ->(str, str, str):
    """Splits a database cross reference string in the format db:accession:version into its constituents"""
    split_id = dbxref.split(':')
    if len(split_id) < 2 or len(split_id) > 3:
        raise AttributeError(
            'dbxref must consist of 2 or 3 elements, separated by semicolon')
    db = split_id[0]
    accession = split_id[1]
    version = ''
    if len(split_id) == 3:
        version = split_id[2]
    return db, accession, version
