RDFSharp.Query.RDFAskQuery.ApplyToStore C# (CSharp) Метод

ApplyToStore() публичный Метод

Applies the query to the given store
public ApplyToStore ( RDFStore store ) : RDFAskQueryResult
store RDFStore
Результат RDFAskQueryResult
        public RDFAskQueryResult ApplyToStore(RDFStore store)
        {
            if (store != null) {
                this.PatternGroupResultTables.Clear();
                this.PatternResultTables.Clear();

                RDFAskQueryResult askResult    = new RDFAskQueryResult();
                if (this.PatternGroups.Any()) {

                    //Iterate the pattern groups of the query
                    foreach (RDFPatternGroup patternGroup in this.PatternGroups) {

                        //Step 1: Get the intermediate result tables of the current pattern group
                        RDFQueryEngine.EvaluatePatterns(this, patternGroup, store);

                        //Step 2: Get the result table of the current pattern group
                        RDFQueryEngine.CombinePatterns(this, patternGroup);

                        //Step 3: Apply the filters of the current pattern group to its result table
                        RDFQueryEngine.ApplyFilters(this, patternGroup);

                    }

                    //Step 4: Get the result table of the query
                    DataTable queryResultTable = RDFQueryEngine.CombineTables(this.PatternGroupResultTables.Values.ToList(), false);

                    //Step 5: Transform the result into a boolean response
                    askResult.AskResult        = (queryResultTable.Rows.Count > 0);

                }

                return askResult;
            }
            throw new RDFQueryException("Cannot execute ASK query because given \"store\" parameter is null.");
        }