Class QueryBuilder
Provides methods for building queries with a fluent style API.
Assembly: dotNetRdf.dll
Syntax
public class QueryBuilder : IQueryBuilder
Constructors
|
Edit this page
View Source
QueryBuilder(SparqlQueryType)
Create a new query builder for a specific type of SPARQL query.
Declaration
protected QueryBuilder(SparqlQueryType sparqlQueryType)
Parameters
Type |
Name |
Description |
SparqlQueryType |
sparqlQueryType |
The type of SPARQL query to build.
|
Properties
|
Edit this page
View Source
Prefixes
Gets or sets the namespace mappings for the SPARQL query being built.
Declaration
public INamespaceMapper Prefixes { get; set; }
Property Value
|
Edit this page
View Source
QueryType
Gets the query type of the generated SPARQL query.
Declaration
public SparqlQueryType QueryType { get; protected set; }
Property Value
|
Edit this page
View Source
Root
Gets the builder associated with the root graph pattern.
Declaration
public IGraphPatternBuilder Root { get; }
Property Value
|
Edit this page
View Source
RootGraphPatternBuilder
Gets the builder associated with the root graph pattern.
Declaration
public GraphPatternBuilder RootGraphPatternBuilder { get; }
Property Value
Methods
|
Edit this page
View Source
Ask()
Declaration
public static IQueryBuilder Ask()
Returns
|
Edit this page
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
|
Edit this page
View Source
BuildQuery()
Declaration
public SparqlQuery BuildQuery()
Returns
|
Edit this page
View Source
BuildQuery(SparqlQuery)
Performs the internal build process for a SparqlQuery.
Declaration
protected virtual SparqlQuery BuildQuery(SparqlQuery query)
Parameters
Type |
Name |
Description |
SparqlQuery |
query |
The query to be processed.
|
Returns
|
Edit this page
View Source
Construct()
Creates a new CONSTRUCT WHERE query.
Declaration
public static IQueryBuilder Construct()
Returns
|
Edit this page
View Source
Construct(Action<IDescribeGraphPatternBuilder>)
Creates a new CONSTRUCT query.
Declaration
public static IQueryBuilder Construct(Action<IDescribeGraphPatternBuilder> buildConstructTemplate)
Parameters
Returns
|
Edit this page
View Source
Describe(params string[])
Creates a new query, which will DESCRIBE the given variables
.
Declaration
public static IDescribeBuilder Describe(params string[] variables)
Parameters
Type |
Name |
Description |
string[] |
variables |
|
Returns
|
Edit this page
View Source
Describe(params Uri[])
Creates a new query, which will DESCRIBE the given uris
.
Declaration
public static IDescribeBuilder Describe(params Uri[] uris)
Parameters
Type |
Name |
Description |
Uri[] |
uris |
|
Returns
|
Edit this page
View Source
GroupBy(Func<INonAggregateExpressionBuilder, SparqlExpression>)
Adds a GROUP BY clause to the query.
Declaration
public IQueryBuilder GroupBy(Func<INonAggregateExpressionBuilder, SparqlExpression> buildGroupingExpression)
Parameters
Returns
|
Edit this page
View Source
GroupBy(string)
Adds a GROUP BY clause to the query.
Declaration
public IQueryBuilder GroupBy(string variableName)
Parameters
Type |
Name |
Description |
string |
variableName |
|
Returns
|
Edit this page
View Source
GroupBy(SparqlVariable)
Adds a GROUP BY clause to the query.
Declaration
public IQueryBuilder GroupBy(SparqlVariable variable)
Parameters
Returns
|
Edit this page
View Source
Having(Func<IExpressionBuilder, BooleanExpression>)
Adds a HAVING clause to the query.
Declaration
public IQueryBuilder Having(Func<IExpressionBuilder, BooleanExpression> buildHavingConstraint)
Parameters
Returns
|
Edit this page
View Source
InlineDataOverQuery(params 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 |
string[] |
variables |
|
Returns
|
Edit this page
View Source
Limit(int)
Declaration
public IQueryBuilder Limit(int limit)
Parameters
Type |
Name |
Description |
int |
limit |
Limit value. Pass negative to disable LIMIT.
|
Returns
|
Edit this page
View Source
Offset(int)
Declaration
public IQueryBuilder Offset(int offset)
Parameters
Type |
Name |
Description |
int |
offset |
|
Returns
|
Edit this page
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
|
Edit this page
View Source
OrderBy(string)
Adds ascending ordering by a variable to the query.
Declaration
public IQueryBuilder OrderBy(string variableName)
Parameters
Type |
Name |
Description |
string |
variableName |
|
Returns
|
Edit this page
View Source
OrderBy(SparqlVariable)
Adds ascending ordering by a variable to the query.
Declaration
public IQueryBuilder OrderBy(SparqlVariable variable)
Parameters
Returns
|
Edit this page
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
|
Edit this page
View Source
OrderByDescending(string)
Adds descending ordering by a variable to the query.
Declaration
public IQueryBuilder OrderByDescending(string variableName)
Parameters
Type |
Name |
Description |
string |
variableName |
|
Returns
|
Edit this page
View Source
OrderByDescending(SparqlVariable)
Adds descending ordering by a variable to the query.
Declaration
public IQueryBuilder OrderByDescending(SparqlVariable variable)
Parameters
Returns
|
Edit this page
View Source
Select(params string[])
Creates a new SELECT query which will return the given
variables
.
Declaration
public static ISelectBuilder Select(params string[] variables)
Parameters
Type |
Name |
Description |
string[] |
variables |
query result variables.
|
Returns
|
Edit this page
View Source
Select(params 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
|
Edit this page
View Source
SelectAll()
Creates a new SELECT * query.
Declaration
public static ISelectBuilder SelectAll()
Returns
|
Edit this page
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 |
|
Implements
Extension Methods