def same_entries(a, b):
    """ checks if entries a and b represent the same publication """
    for key in ['ID', 'doi', 'hal_id', 'title', 'chapter']:
        if key in a and key in b and a[key].lower() == b[key].lower():
            return True
    if 'title' in a and 'chapter' in b and a['title'].lower() == b['chapter'].lower():
        return True
    if 'title' in b and 'chapter' in a and b['title'].lower() == a['chapter'].lower():
        return True
    return False