public function getResourceByIds(array $ids, bool $checkIfExist = true): FedoraResource {
        echo self::$debug ? "[Fedora] searching for " . implode(', ', $ids) . "\n" : '';

        $matches = array();
        foreach ($ids as $id) {
            try {
                $res                         = $this->getResourceById($id, $checkIfExist);
                $matches[$res->getUri(true)] = $res;
            } catch (NotFound $e) {
                
            }
        }

        switch (count($matches)) {
            case 0:
                echo self::$debug ? "  not found\n" : '';
                throw new NotFound();
            case 1:
                echo self::$debug ? "  found\n" : '';
                return array_pop($matches);
            default:
                echo self::$debug ? "  ambiguosus match: " . implode(', ', array_keys($matches)) . "\n" : '';
                throw new AmbiguousMatch();
        }
    }