net.fortytwo.ripple.config.SPARQLRepositorySailFactory 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.ripple.Ripple;
import net.fortytwo.ripple.RippleException;
import net.fortytwo.ripple.URIMap;
import org.openrdf.sail.Sail;
import org.openrdf.sail.SailException;
/**
* @author Joshua Shinavier (http://fortytwo.net)
*/
public class SPARQLRepositorySailFactory implements SailFactory {
@Override
public Class getSailClass() {
return SPARQLRepositorySail.class;
}
@Override
public Sail createSail(URIMap uriMap, SailConfiguration config) throws RippleException {
String endpoint = Ripple.getConfiguration().getString(Ripple.SPARQL_ENDPOINTURL);
try {
return new SPARQLRepositorySail(endpoint);
} catch (SailException e) {
throw new RippleException(e);
}
}
}