Get a subgraph of items reachable from the given set of items through
        the 'parent' relation.

        Args:
            item_ids (list): items which are taken as roots for the reachability
            language (str): if specified, filter out items which are not
                available in the given language

        Returns:
            dict: item id -> list of items (parent items), root items are
            referenced by None key

def get_parents_graph(self, item_ids, language=None):
        """
        Get a subgraph of items reachable from the given set of items through
        the 'parent' relation.

        Args:
            item_ids (list): items which are taken as roots for the reachability
            language (str): if specified, filter out items which are not
                available in the given language

        Returns:
            dict: item id -> list of items (parent items), root items are
            referenced by None key
        """
        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)