def get_parents_graph(self, item_ids, language=None):
        def _parents(item_ids):
            if item_ids is None:
                items = Item.objects.filter(active=True).prefetch_related('parents')
            else:
                item_ids = [ii for iis in item_ids.values() for ii in iis]
                items = Item.objects.filter(id__in=item_ids, active=True).prefetch_related('parents')
            return {item.id: sorted([_item.id for _item in item.parents.all()]) for item in items}
        return self._reachable_graph(item_ids, _parents, language=language)
        if item_ids is None:
            return self._reachable_graph(None, _parents, language=language)
        else:
            graph = self.get_parents_graph(None, language)
            return self._subset_graph(graph, item_ids)