public function import(string $namespace, int $singleOutNmsp): array {
        $dict = array(self::SKIP, self::CREATE);
        if (!in_array($singleOutNmsp, $dict)) {
            throw new InvalidArgumentException('singleOutNmsp parameters must be one of MetadataCollection::SKIP, MetadataCollection::CREATE');
        }
        $this->autoCommitCounter = 0;

        $this->removeLiteralIds();
        $this->promoteUrisToIds();
        $toBeImported    = $this->filterResources($namespace, $singleOutNmsp);
        $fedoraResources = $this->assureUuids($toBeImported);

        foreach ($toBeImported as $n => $res) {
            $uri       = $res->getUri();
            $fedoraRes = $fedoraResources[$uri];

            echo self::$debug ? "Importing " . $uri . " (" . ($n + 1) . "/" . count($toBeImported) . ")\n" : "";
            $this->sanitizeResource($res, $namespace);

            echo self::$debug ? "\tupdating " . $fedoraRes->getUri(true) . "\n" : "";
            $meta = $fedoraRes->getMetadata();
            $meta->merge($res, array(RC::idProp()));
            $fedoraRes->setMetadata($meta, false);
            $fedoraRes->updateMetadata();
            $this->handleAutoCommit();
        }
        return array_values($fedoraResources);
    }