The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
Creating new repository using RepositoryManage!
Hi,
To create new Repository I used the following way:
First run
So, I checked the path where the repository should exist, and I found NO folder called "Repository" after creating the repository. However, the strange thing is I got the new repository in the list returned by getRepositories() method! (shown in the output above)
If I restart Netbeans and RapidMiner, I found the new repositories exist in RapidMiner studio but not in my file system!!!
My question is: how can I save the changes of creating repository (or even delete repository) without closing Netbeans and RapidMiner?
I tried to use save() and load() mothods as they load and save xml configuration files, but it didn't make sense!
To create new Repository I used the following way:
If I run the program twice and display the repositories, I got:
RepositoryAccessor repositoryAccessor = new RepositoryAccessorImplementation();
RepositoryManager repositoryManager = RepositoryManager.getInstance(repositoryAccessor);
File root = new File("Files/");
if (!(new File("Files/Repository").exists())){
System.out.println("*************************");
LocalRepository localRepository = new LocalRepository("Repository", root);
repositoryManager.addRepository(localRepository);
File[] files = root.listFiles();
for (File file : files){
copyFile(file, new File("Files/Repository/"+file.getName()));//copy files from directory to another
}
}
repositoryManager.save();
First run
Second run (immediately after the first run)
Before creation:
com.rapidminer.repository.resource.ResourceRepository@1b186cb
com.rapidminer.repository.db.DBRepository@87a4b
LocalRepository
*************************
After creation:
com.rapidminer.repository.resource.ResourceRepository@1b186cb
com.rapidminer.repository.db.DBRepository@87a4b
LocalRepository
Repository
Even if the folder of repository exists, it keep creating the the repository and ignoring the condition,
Before creation:
com.rapidminer.repository.resource.ResourceRepository@1b186cb
com.rapidminer.repository.db.DBRepository@87a4b
LocalRepository
Repository
*************************
After creation:
com.rapidminer.repository.resource.ResourceRepository@1b186cb
com.rapidminer.repository.db.DBRepository@87a4b
LocalRepository
Repository
Repository
So, I checked the path where the repository should exist, and I found NO folder called "Repository" after creating the repository. However, the strange thing is I got the new repository in the list returned by getRepositories() method! (shown in the output above)
If I restart Netbeans and RapidMiner, I found the new repositories exist in RapidMiner studio but not in my file system!!!
My question is: how can I save the changes of creating repository (or even delete repository) without closing Netbeans and RapidMiner?
I tried to use save() and load() mothods as they load and save xml configuration files, but it didn't make sense!
Tagged:
0
Answers
the existance of a repository is stored in the repositories.xml file in the user_home/.RapidMiner folder. Note that repositories only create folders when needed, e.g. after creating a new repository it is empty, thus needing no actual folders yet. I'd change the condition to asking the RepositoryManager directly if a repository with a given name already exists before creating one. Callling RepositoryManager.getInstance().shutdown() ensures your newly created repository is stored in the aforementioned xml file and exists the next time you start your program.
Regards,
Marco
Is there any way to get the absolute path of an exist repository?
I tried to use the following: but it gave me:
you can check which Repository is of the type LocalRepository and then call getFile() on the LocalRepository instance.
Regards,
Marco
I used this answer to integrate RapidMiner from FAQ: I included all RapidMiner jar files into my application. however, the application still not running on a computer that doesn't have RapidMiner studio already installed!
There are many errors appeared for me like: However, I am creating the repository before setting up the process and run it as follows: So, how can I guarantee that the repository is created in order to copy the processes (built using RapidMiner GUI) to it?
Note: the same code is working in a computer that has RapidMiner already installed on it and the repository is created from RapidMiner GUI.
Sorry for the asking a lot, but there is no detiled documentation to help.
Thanks!
when you debug your code, are you actually entering the if block which requires a "Local Repository" to exist? I suspect not, so you need to first check if it exists, if it does not create it and only after that copy your files.
Regards,
Marco