def _schema_update_array(self, prop, data, merge=False):
        """Create or update an associated set of objects."""
        rel = self._get_relationship(prop.name, 'ONETOMANY')
        cls = rel.mapper.class_
        existing = list(getattr(self, prop.name))
        ids = set()

        for item in data or []:
            if item is None:
                continue
            obj = cls()
            for cand in existing:
                if item.get('id') and cand.id == item.get('id'):
                    obj = cand
                elif merge and cand._merge_compare(item):
                    obj = cand
            obj.update(item)
            ids.add(obj.id)
            existing.append(obj)

        for obj in existing:
            if ids not in obj.id and not merge:
                obj.delete()
                continue

            for local, remote in self._get_associations(obj, rel):
                setattr(obj, remote, getattr(self, local))

        setattr(self, prop.name, existing)
        return existing
dataset/ETHPy150Open pudo/aleph/aleph/model/schema_model.py/SchemaModel._schema_update_array/swapped operands of `not in`