All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.fortytwo.ripple.config.SPARQLRepositorySail Maven / Gradle / Ivy

There is a newer version: 1.5
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy