public function import($source, core_kernel_classes_Class $destination = null, $namespace = null)
    {
        /** @var UploadService $uploadService */
        $uploadService = ServiceManager::getServiceManager()->get(UploadService::SERVICE_ID);
        if (!$source instanceof File) {
            $file = $uploadService->getUploadedFlyFile($source);
        } else {
            $file = $source;
        }

        $returnValue = false;

        if ($file->exists()) {
            $api = core_kernel_impl_ApiModelOO::singleton();
            if ($destination !== null) {
                $targetNamespace = substr($destination->getUri(), 0, strpos($destination->getUri(), '#'));
            } elseif ($namespace !== null) {
                $targetNamespace = $namespace;
            } else {
                $targetNamespace = rtrim(common_ext_NamespaceManager::singleton()->getLocalNamespace()->getUri(), '#');
            }
            $returnValue = $api->importXmlRdf($targetNamespace, $file);
        }

        $uploadService->remove($file);

        return $returnValue;
    }