def get_publication_year(raw):
    """
    Extract publication year.

    @param raw: json object of a Libris edition
    @type raw: dictionary
    """
    publication = raw["mainEntity"].get("publication")
    primary = [x for x in publication if
               x["@type"] == "PrimaryPublication"]
    if primary:
        return [x["year"] for x in primary][0]
    return None