<commit_before>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using Slp.Evi.Endpoint.Controllers;
using Slp.Evi.Storage;
using Slp.Evi.Storage.Bootstrap;
using Slp.Evi.Storage.Database.Vendor.MsSql;
using TCode.r2rml4net;
using TCode.r2rml4net.Mapping.Fluent;
using VDS.RDF;

namespace Slp.Evi.Endpoint.Sparql
{
    public class StorageWrapper
        : IStorageWrapper
    {
        private readonly EviQueryableStorage _storage;

        public StorageWrapper(IOptions<StorageConfiguration> configuration, IHostingEnvironment environment, ILoggerFactory loggerFactory)
        {
            var connectionString = configuration.Value.ConnectionString;
            var mappingFilePath = configuration.Value.MappingFilePath;
            var path = Path.Combine(environment.ContentRootPath, mappingFilePath);

            IR2RML mapping;
            using (var fs = new FileStream(path, FileMode.Open))
            {
                mapping = R2RMLLoader.Load(fs);
            }

            var sqlFactory = new MsSqlDbFactory();
            _storage = new EviQueryableStorage(sqlFactory.CreateSqlDb(connectionString), mapping, new DefaultEviQueryableStorageFactory(loggerFactory));
        }

        public void Query(IRdfHandler rdfHandler, ISparqlResultsHandler sparqlResultsHandler, string query)
        {
            _storage.Query(rdfHandler, sparqlResultsHandler, query);
        }
    }
}<commit_msg>Use the query timeout from<commit_after>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using Slp.Evi.Endpoint.Controllers;
using Slp.Evi.Storage;
using Slp.Evi.Storage.Bootstrap;
using Slp.Evi.Storage.Database.Vendor.MsSql;
using TCode.r2rml4net;
using TCode.r2rml4net.Mapping.Fluent;
using VDS.RDF;

namespace Slp.Evi.Endpoint.Sparql
{
    public class StorageWrapper
        : IStorageWrapper
    {
        private readonly EviQueryableStorage _storage;

        public StorageWrapper(IOptions<StorageConfiguration> configuration, IHostingEnvironment environment, ILoggerFactory loggerFactory)
        {
            var connectionString = configuration.Value.ConnectionString;
            var mappingFilePath = configuration.Value.MappingFilePath;
            var path = Path.Combine(environment.ContentRootPath, mappingFilePath);

            IR2RML mapping;
            using (var fs = new FileStream(path, FileMode.Open))
            {
                mapping = R2RMLLoader.Load(fs);
            }

            var sqlFactory = new MsSqlDbFactory();
            _storage = new EviQueryableStorage(sqlFactory.CreateSqlDb(connectionString, configuration.Value.QueryTimeout), mapping, new DefaultEviQueryableStorageFactory(loggerFactory));
        }

        public void Query(IRdfHandler rdfHandler, ISparqlResultsHandler sparqlResultsHandler, string query)
        {
            _storage.Query(rdfHandler, sparqlResultsHandler, query);
        }
    }
}
{'fraction_non_alphanumeric': 0.07747965028640337, 'fraction_numerical': 0.0036177268616219473, 'mean_word_length': 3.435828877005348, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4625459', 'n_tokens_mistral': 904, 'n_tokens_neox': 906, 'n_words': 185}