def get_id_map(database: dict) -> dict:
    """Make a Name to ID mapping from the database."""
    mapping = {}
    for _id in database:
        name = database[_id]['name']
        if _id in mapping.values():
            raise ValueError(f'Duplicate tag ID: {_id}')
        if name in mapping.keys():
            raise ValueError(f'Duplicate tag name: {name}')
        mapping[name] = _id
    return mapping