Ejemplo n.º 1
0
        public static void RunTestParametred(int count = 100)
        {
            var Store = new Store("../../../Databases/int based/");

            //   Store.ClearAll();
            // Store.ReloadFrom(10*1000*1000, Config.Source_data_folder_path + "10M.ttl");
            //  SparqlQueryParser.Parse(Store, sq5);
            Store.Start();
            Store.ActivateCache();
            for (int i = 0; i < 12; i++)
            {
                BSBmParams bsBmParams = new BSBmParams(Store);

                var paramvaluesFilePath =
                    string.Format(@"..\..\examples\bsbm\queries\parameters\param values for{0}m {1} query.txt", 1, i + 1);
                var qFile =
                    string.Format(@"..\..\examples\bsbm\queries\parameters\{0}.rq", i + 1);
                using (StreamReader streamParameters = new StreamReader(paramvaluesFilePath))
                    using (StreamReader streamQuery = new StreamReader(qFile))
                    {
                        string    qparams = streamQuery.ReadToEnd();
                        Stopwatch timer   = new Stopwatch();
                        for (int j = 0; j < count; j++)
                        {
                            string q             = BSBmParams.QueryReadParameters(qparams, streamParameters);
                            var    sparqlResults = SparqlQueryParser.Parse(Store, q).Run();

                            timer.Start();
                            sparqlResults.Results.Count();
                            timer.Stop();
                        }

                        using (StreamWriter r = new StreamWriter(@"..\..\output.txt", true))
                        {
                            r.WriteLine();
                            r.WriteLine("one query {0}, {1} times", i + 1, count);
                            r.WriteLine("milions " + 1);
                            r.WriteLine("date time " + DateTime.Now);
                            r.WriteLine("total ms " + timer.ElapsedMilliseconds);
                            double l = ((double)timer.ElapsedMilliseconds) / count;
                            r.WriteLine("ms " + l);

                            r.WriteLine("qps " + (int)(1000.0 / l));
                            string q = BSBmParams.QueryReadParameters(qparams, streamParameters);
                            r.WriteLine("next results count: {0}",
                                        SparqlQueryParser.Parse(Store, q).Run().Results.Count());
                        }
                    }
            }
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Stopwatch timer;
            Store     store = new Store("../../../Databases/");

            timer = new Stopwatch();
            timer.Start();
            store.ReloadFrom(10 * 1000 * 1000, @"C:\deployed\10M.ttl");
            timer.Stop();
            Console.WriteLine(timer.Elapsed.TotalSeconds);
            store.ActivateCache();

            foreach (var tripleOvStruct in store.GetTriplesWithTextObject(new OV_string("prayers")))
            {
                Console.WriteLine(tripleOvStruct.Subject.ToString());
                Console.WriteLine(tripleOvStruct.Predicate.ToString());
                Console.WriteLine(tripleOvStruct.Object.ToString());
                Console.WriteLine();
            }

            SparqlTesting.OneBerlinParametrized(store, 6, 100);
        }