def get_node_edge_attrib_mappers(root):
    """
    Reads the graphml root and gets the id to attribute maps

    :param root: ElementTree.root
    :return: n_id_to_attrib, e_id_to_attrib, attribute ID to name mapper dicts
    """
    n_id_to_attrib = dict()
    e_id_to_attrib = dict()
    for child in root:
        # Desired attributes either have names, or 'yfiles.type' (typically graphical elements from yEd)
        attrib = child.attrib.get('attr.name', child.attrib.get('yfiles.type'))
        if attrib and child.attrib.get('for') == 'node':
            n_id_to_attrib[child.attrib.get('id')] = attrib
        elif attrib and child.attrib.get('for') == 'edge':
            e_id_to_attrib[child.attrib.get('id')] = attrib
    return n_id_to_attrib, e_id_to_attrib