def uniquify(model):
    '''
    Remove all duplicate relationships
    '''
    seen = set()
    to_remove = set()
    for ix, (o, r, t, a) in model:
        hashable_link = (o, r, t) + tuple(sorted(a.items()))
        #print(hashable_link)
        if hashable_link in seen:
            to_remove.add(ix)
        seen.add(hashable_link)

    model.remove(to_remove)
    return