def get_rid_dict(contrib_element):
    """ For an individual contributor, get the list of their associated rids.
    More about rids: https://jats.nlm.nih.gov/archiving/tag-library/1.1/attribute/rid.html
    Used in get_contrib_info().
    :param contrib_element: An article XML element with the tag <contrib>
    :return: dictionary matching each type of rid to its value for that contributor
    """
    rid_dict = {}
    contrib_elements = contrib_element.getchildren()
    # get list of ref-types
    rid_type_list = [el.attrib.get('ref-type', 'fn') for el in contrib_elements if el.tag == 'xref']

    # make dict of ref-types to the actual ref numbers (rids)
    for rid_type in set(rid_type_list):
        rid_list = [el.attrib.get('rid', None) for el in contrib_elements if el.tag == 'xref' and el.attrib.get('ref-type', 'fn') == rid_type]
        rid_dict[rid_type] = rid_list

    return rid_dict