Question

I am quite new to Java Sesame. I have read through the documentation provided for Sesame. Unfortunately lots of things were not very clear to me. I started with creating the repository as in the code below:

import org.openrdf.repository.RepositoryException;
import org.openrdf.repository.manager.RemoteRepositoryManager;
import org.openrdf.repository.sail.SailRepository;
public class RDF{

public void create() throws RepositoryException
{
    File dataDir = new File("myFile");
    Repository repo = new SailRepository(new MemoryStore(dataDir));
    repo.initialize();
    String serverUrl = "http://localhost:8080/openrdf-sesame/repositories/rep";
    RemoteRepositoryManager manager = new RemoteRepositoryManager(serverUrl);
    manager.initialize();
    }
}

I am using Tomcat 6. I run the code in Eclipse. I right click the Dynamic Project and select Run on server. The codes were taken from the documentation itself. My questions are what is creating the file dataDir for?

Is this address http://localhost:8080/openrdf-sesame/repositories/rep of the location where the repository is created? After starting Tomcat, I use the above link but it shows me there is an error.

How can I make sure that the repository has successfully been created and how can I start to use it. Your assistance would be very much appreciated.

Was it helpful?

Solution

You are mixing up two things:

  • creating a local repository (a MemoryStore persisted to dataDir), and
  • a remote repository living on the Sesame server

If you just want to create a persistent repository the first option is sufficient. If you want to also have a full Sesame server with all its UI and services then you have to install it, set it up first and use the second option.

In both cases, you can use the RepositoryManager API. An introduction to RepositoryManager.

You wouldn't typically start the Sesame server and workbench via Eclipse. You would use a standalone installation as described in the documentation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top