public SailRepositoryConnection getConnection() throws RepositoryException {
try {
final SailConnection con = getSail().getConnection();
// a wrapper so we can access the SPARQL implementations without needing to replicate their code
final BigdataSailRepositoryConnection wrapped = new BigdataSailRepositoryConnection(null,getBaseSailConnection(con));
return new SailRepositoryConnection(this, con) {
@Override
public SailBooleanQuery prepareBooleanQuery(QueryLanguage ql, String queryString, String baseURI) throws MalformedQueryException {
return wrapped.prepareBooleanQuery(ql, queryString, baseURI);
}
@Override
public SailGraphQuery prepareGraphQuery(QueryLanguage ql, String queryString, String baseURI) throws MalformedQueryException {
return wrapped.prepareGraphQuery(ql, queryString, baseURI);
}
@Override
public SailQuery prepareQuery(QueryLanguage ql, String queryString, String baseURI) throws MalformedQueryException {
return wrapped.prepareQuery(ql,queryString,baseURI);
}
@Override
public SailTupleQuery prepareTupleQuery(QueryLanguage ql, String queryString, String baseURI) throws MalformedQueryException {
return wrapped.prepareTupleQuery(ql, queryString, baseURI);
}
@Override
public Update prepareUpdate(QueryLanguage ql, String update, String baseURI) throws RepositoryException, MalformedQueryException {
return wrapped.prepareUpdate(ql, update, baseURI);
}
};
} catch (SailException e) {
throw new RepositoryException("could not create repository connection",e);
}