net.fortytwo.ripple.config.SPARQLRepositorySail Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ripple-demo Show documentation
Show all versions of ripple-demo Show documentation
Ripple demo at the command-line
package net.fortytwo.ripple.config;
import net.fortytwo.sesametools.reposail.RepositorySail;
import org.openrdf.repository.Repository;
import org.openrdf.repository.RepositoryException;
import org.openrdf.repository.sparql.SPARQLRepository;
import org.openrdf.sail.SailException;
/**
* @author Joshua Shinavier (http://fortytwo.net)
*/
public class SPARQLRepositorySail extends RepositorySail {
public SPARQLRepositorySail(final String endpoint) throws SailException {
super(createRepo(endpoint));
}
private static Repository createRepo(final String endpoint) throws SailException {
Repository repo = new SPARQLRepository(endpoint);
try {
repo.initialize();
} catch (RepositoryException e) {
throw new SailException(e);
}
return repo;
}
}