Class QueryBuilder
Provides methods for building queries with a fluent style API.
Inheritance
System.Object
QueryBuilder
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: dotNetRDF.dll
Syntax
public class QueryBuilder : IQueryBuilder
Constructors
|
Improve this Doc
View Source
QueryBuilder(SparqlQueryType)
Declaration
protected QueryBuilder(SparqlQueryType sparqlQueryType)
Parameters
Properties
|
Improve this Doc
View Source
Prefixes
Gets or sets the namespace mappings for the SPARQL query being built.
Declaration
public INamespaceMapper Prefixes { get; set; }
Property Value
|
Improve this Doc
View Source
QueryType
Gets the query type of the generated SPARQL query.
Declaration
public SparqlQueryType QueryType { get; protected set; }
Property Value
|
Improve this Doc
View Source
Root
Gets the builder associated with the root graph pattern.
Declaration
public IGraphPatternBuilder Root { get; }
Property Value
|
Improve this Doc
View Source
RootGraphPatternBuilder
Gets the builder associated with the root graph pattern.
Declaration
public GraphPatternBuilder RootGraphPatternBuilder { get; }
Property Value
Methods
|
Improve this Doc
View Source
Ask()
Creates a new ASK query.
Declaration
public static IQueryBuilder Ask()
Returns
|
Improve this Doc
View Source
Bind(Func<INonAggregateExpressionBuilder, SparqlExpression>)
Adds a BIND variable assignment to the root graph pattern.
Declaration
public IAssignmentVariableNamePart<IQueryBuilder> Bind(Func<INonAggregateExpressionBuilder, SparqlExpression> buildAssignmentExpression)
Parameters
Returns
|
Improve this Doc
View Source
BuildQuery()
Declaration
public SparqlQuery BuildQuery()
Returns
|
Improve this Doc
View Source
BuildQuery(SparqlQuery)
Declaration
protected virtual SparqlQuery BuildQuery(SparqlQuery query)
Parameters
Returns
|
Improve this Doc
View Source
Construct()
Creates a new CONSTRUCT WHERE query.
Declaration
public static IQueryBuilder Construct()
Returns
|
Improve this Doc
View Source
Construct(Action<IDescribeGraphPatternBuilder>)
Creates a new CONSTRUCT query.
Declaration
public static IQueryBuilder Construct(Action<IDescribeGraphPatternBuilder> buildConstructTemplate)
Parameters
Returns
|
Improve this Doc
View Source
Describe(String[])
Creates a new query, which will DESCRIBE the given variables
.
Declaration
public static IDescribeBuilder Describe(params string[] variables)
Parameters
Type |
Name |
Description |
System.String[] |
variables |
|
Returns
|
Improve this Doc
View Source
Describe(Uri[])
Creates a new query, which will DESCRIBE the given uris
.
Declaration
public static IDescribeBuilder Describe(params Uri[] uris)
Parameters
Type |
Name |
Description |
System.Uri[] |
uris |
|
Returns
|
Improve this Doc
View Source
GroupBy(Func<INonAggregateExpressionBuilder, SparqlExpression>)
Adds a GROUP BY clause to the query.
Declaration
public IQueryBuilder GroupBy(Func<INonAggregateExpressionBuilder, SparqlExpression> buildGroupingExpression)
Parameters
Returns
|
Improve this Doc
View Source
GroupBy(String)
Adds a GROUP BY clause to the query.
Declaration
public IQueryBuilder GroupBy(string variableName)
Parameters
Type |
Name |
Description |
System.String |
variableName |
|
Returns
|
Improve this Doc
View Source
GroupBy(SparqlVariable)
Adds a GROUP BY clause to the query.
Declaration
public IQueryBuilder GroupBy(SparqlVariable variable)
Parameters
Returns
|
Improve this Doc
View Source
Having(Func<IExpressionBuilder, BooleanExpression>)
Adds a HAVING clause to the query.
Declaration
public IQueryBuilder Having(Func<IExpressionBuilder, BooleanExpression> buildHavingConstraint)
Parameters
Returns
|
Improve this Doc
View Source
InlineDataOverQuery(String[])
Adds a VALUES inline data block to the entire query (outside graph patterns).
Declaration
public IInlineDataBuilder InlineDataOverQuery(params string[] variables)
Parameters
Type |
Name |
Description |
System.String[] |
variables |
|
Returns
|
Improve this Doc
View Source
Limit(Int32)
Applies a LIMIT.
Declaration
public IQueryBuilder Limit(int limit)
Parameters
Type |
Name |
Description |
System.Int32 |
limit |
Limit value. Pass negative to disable LIMIT. |
Returns
|
Improve this Doc
View Source
Offset(Int32)
Applies an OFFSET.
Declaration
public IQueryBuilder Offset(int offset)
Parameters
Type |
Name |
Description |
System.Int32 |
offset |
|
Returns
|
Improve this Doc
View Source
OrderBy(Func<IExpressionBuilder, SparqlExpression>)
Adds ascending ordering by an expression to the query.
Declaration
public IQueryBuilder OrderBy(Func<IExpressionBuilder, SparqlExpression> buildOrderExpression)
Parameters
Returns
|
Improve this Doc
View Source
OrderBy(String)
Adds ascending ordering by a variable to the query.
Declaration
public IQueryBuilder OrderBy(string variableName)
Parameters
Type |
Name |
Description |
System.String |
variableName |
|
Returns
|
Improve this Doc
View Source
OrderBy(SparqlVariable)
Adds ascending ordering by a variable to the query.
Declaration
public IQueryBuilder OrderBy(SparqlVariable variable)
Parameters
Returns
|
Improve this Doc
View Source
OrderByDescending(Func<IExpressionBuilder, SparqlExpression>)
Adds descending ordering by an expression to the query.
Declaration
public IQueryBuilder OrderByDescending(Func<IExpressionBuilder, SparqlExpression> buildOrderExpression)
Parameters
Returns
|
Improve this Doc
View Source
OrderByDescending(String)
Adds descending ordering by a variable to the query.
Declaration
public IQueryBuilder OrderByDescending(string variableName)
Parameters
Type |
Name |
Description |
System.String |
variableName |
|
Returns
|
Improve this Doc
View Source
OrderByDescending(SparqlVariable)
Adds descending ordering by a variable to the query.
Declaration
public IQueryBuilder OrderByDescending(SparqlVariable variable)
Parameters
Returns
|
Improve this Doc
View Source
Select(String[])
Creates a new SELECT query which will return the given
variables
.
Declaration
public static ISelectBuilder Select(params string[] variables)
Parameters
Type |
Name |
Description |
System.String[] |
variables |
query result variables. |
Returns
|
Improve this Doc
View Source
Select(SparqlVariable[])
Creates a new SELECT query which will return the given
variables
.
Declaration
public static ISelectBuilder Select(params SparqlVariable[] variables)
Parameters
Type |
Name |
Description |
SparqlVariable[] |
variables |
query result variables. |
Returns
|
Improve this Doc
View Source
Select<TExpression>(Func<IExpressionBuilder, PrimaryExpression<TExpression>>)
Creates a new SELECT query which will return an expression.
Declaration
public static IAssignmentVariableNamePart<ISelectBuilder> Select<TExpression>(Func<IExpressionBuilder, PrimaryExpression<TExpression>> buildAssignmentExpression)
Parameters
Returns
Type Parameters
Name |
Description |
TExpression |
|
|
Improve this Doc
View Source
SelectAll()
Creates a new SELECT * query.
Declaration
public static ISelectBuilder SelectAll()
Returns
Implements
Extension Methods