try {
connection.setAutoCommit(false);
final SparqlToSQLMapper mapper = new SparqlToSQLMapper(connection,dialect,expr, castType);
final Select query = mapper.getQuery();
if(log.isDebugEnabled() || configurationService.getBooleanConfiguration("sparql.native.logsql",true)) {
log.info("SQL query from SPARQL transformation:\n{}", query.getSQL());
}
final EntityManager em = persistenceService.getEntityManager();
return new CloseableIteration<BindingSet, QueryEvaluationException>() {
private Cursor cursor = query.fetchLazy(50);
private UrlValidator urlValidator = new UrlValidator(UrlValidator.ALLOW_ALL_SCHEMES | UrlValidator.ALLOW_LOCAL_URLS);
// in case we need to split one SQL query row into several SPARQL query rows, we do it by creating
// a temporary iterator