def map_category(output_db, scraper_id, scraper_category):
    """Get the canonical category corresponding to the
    given category in the scraper data."""
    select_sql = (
        'SELECT category FROM scraper_category_map WHERE scraper_id = ? AND scraper_category = ?'
        )
    rows = list(output_db.execute(select_sql, [scraper_id, scraper_category]))
    if rows:
        return rows[0][0]
    else:
        return None
