Builds a dict mapping to lists of OwnershipPeriods, from a db table.

def build_ownership_map(table, key_from_row, value_from_row):
    """
    Builds a dict mapping to lists of OwnershipPeriods, from a db table.
    """
    return _build_ownership_map_from_rows(
        sa.select(table.c).execute().fetchall(),
        key_from_row,
        value_from_row,
    )