use of org.openrdf.repository.Repository in project gocd by gocd.
the class InMemoryRepositoryFactory method emptyRepository.
public static Repository emptyRepository() {
try {
Repository repo = new SailRepository(new MemoryStore());
repo.initialize();
return repo;
} catch (RepositoryException ex) {
throw new ShineRuntimeException(ex);
}
}
use of org.openrdf.repository.Repository in project gocd by gocd.
the class SesameGraph method createTempGraph.
public Graph createTempGraph() {
try {
if (!conn.isOpen()) {
throw new IllegalStateException("Cannot create a temp graph on a closed graph!");
}
Repository inMemRepos = InMemoryRepositoryFactory.emptyRepository();
String contextURI = null;
if (contextResource.length > 0) {
contextURI = contextResource[0].stringValue();
}
Graph tempGraph = new SesameGraph(inMemRepos.getConnection(), contextURI);
tempGraphs.add(tempGraph);
return tempGraph;
} catch (RepositoryException ex) {
throw new ShineRuntimeException("Unable to create temp graph!", ex);
}
}
use of org.openrdf.repository.Repository in project incubator-rya by apache.
the class CbSailTest method createRegistry.
@Override
protected JndiRegistry createRegistry() throws Exception {
store = new MockRdfCloudStore();
// store.setDisplayQueryPlan(true);
// store.setInferencing(false);
NamespaceManager nm = new NamespaceManager(store.getRyaDAO(), store.getConf());
store.setNamespaceManager(nm);
repository = new RyaSailRepository(store);
repository.initialize();
JndiRegistry registry = super.createRegistry();
registry.bind(Repository.class.getName(), repository);
return registry;
}
use of org.openrdf.repository.Repository in project incubator-rya by apache.
the class AbstractRyaCommand method doExecute.
@Override
protected Object doExecute() throws Exception {
ServiceTracker serviceTracker = new ServiceTracker(getBundleContext(), Repository.class.getName(), null);
serviceTracker.open();
repository = (Repository) serviceTracker.getService();
serviceTracker.close();
if (repository == null) {
System.out.println("Sail Repository not available");
return null;
}
serviceTracker = new ServiceTracker(getBundleContext(), RyaDAO.class.getName(), null);
serviceTracker.open();
rdfDAO = (RyaDAO) serviceTracker.getService();
serviceTracker.close();
if (rdfDAO == null) {
System.out.println("Rdf DAO not available");
return null;
}
return doRyaExecute();
}
use of org.openrdf.repository.Repository in project incubator-rya by apache.
the class CbSailComponent method createEndpoint.
@Override
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
String sailRepoNameParam = Repository.class.getName();
if (parameters.containsKey(sailRepoNameParam)) {
sailRepoNameParam = getAndRemoveParameter(parameters, SAILREPONAME, String.class);
}
Repository sailRepository = getCamelContext().getRegistry().lookup(sailRepoNameParam, Repository.class);
checkNotNull(sailRepository, "Sail Repository must exist within the camel registry. Using lookup name[" + sailRepoNameParam + "]");
CbSailEndpoint sailEndpoint = new CbSailEndpoint(uri, this, sailRepository, remaining);
setProperties(sailEndpoint, parameters);
return sailEndpoint;
}
Aggregations