/// <summary>
        /// Converts the Algebra back to a SPARQL Query
        /// </summary>
        /// <returns></returns>
        public SparqlQuery ToQuery()
        {
            SparqlQuery q = new SparqlQuery();

            q.RootGraphPattern = ToGraphPattern();
            q.AddVariable(_graphVar, true);
            q.Optimise();
            return(q);
        }
Exemple #2
0
        private void BuildReturnVariables(SparqlQuery query)
        {
            var variables = _buildSelectVariables.Select(buildSelectVariable => buildSelectVariable(Prefixes));

            foreach (var selectVariable in variables)
            {
                query.AddVariable(selectVariable);
            }
        }
Exemple #3
0
        private void BuildReturnVariables(SparqlQuery query)
        {
            if (_selectBuilder == null)
            {
                return;
            }

            query.QueryType = _selectBuilder.SparqlQueryType;
            foreach (SparqlVariable selectVariable in _selectBuilder.BuildVariables(Prefixes))
            {
                query.AddVariable(selectVariable);
            }
        }
Exemple #4
0
        /// <summary>
        /// Converts the Algebra back to a SPARQL Query
        /// </summary>
        /// <returns></returns>
        public SparqlQuery ToQuery()
        {
            SparqlQuery q = this._pattern.ToQuery();

            foreach (SparqlVariable var in this._variables)
            {
                q.AddVariable(var);
            }
            if (this._variables.All(v => v.IsResultVariable))
            {
                q.QueryType = SparqlQueryType.SelectAll;
            }
            else
            {
                q.QueryType = SparqlQueryType.Select;
            }
            return(q);
        }
 /// <summary>
 /// Converts the Algebra back to a SPARQL Query
 /// </summary>
 /// <returns></returns>
 public SparqlQuery ToQuery()
 {
     SparqlQuery q = new SparqlQuery();
     q.RootGraphPattern = this.ToGraphPattern();
     q.AddVariable(this._graphVar, true);
     q.Optimise();
     return q;
 }