Click or drag to resize

SparqlQuery Class

Represents a SPARQL Query.
Inheritance Hierarchy

Namespace:  VDS.RDF.Query
Assembly:  dotNetRDF (in dotNetRDF.dll) Version:
public sealed class SparqlQuery : NodeFactory

The SparqlQuery type exposes the following members.

Public propertyAlgebraOptimisers
Gets/Sets the locally scoped Algebra Optimisers that are used to optimise the Query Algebra in addition to (but before) any global optimisers (specified by SparqlOptimiser.AlgebraOptimisers) that are applied.
Public propertyBaseUri
Gets/Sets the Base Uri for the Query.
Public propertyBindings
Gets/Sets the VALUES Clause for the Query which are bindings that should be applied.
Public propertyConstructTemplate
Gets/Sets the Construct Template for a Construct Query.
Public propertyDefaultGraphs
Gets the Default Graph URIs for the Query.
Public propertyDescriber
Gets/Sets the ISparqlDescribe which provides the Describe algorithm you wish to use.
Public propertyDescribeVariables
Gets the Variables, QNames and URIs used in the Describe Query.
Public propertyExpressionFactories
Gets/Sets the locally scoped Expression Factories that may be used if the query is using the CALL() function to do dynamic function invocation.
Public propertyGroupBy
Gets/Sets the Grouping for the Query.
Public propertyHasDistinctModifier
Gets whether a Query has a DISTINCT modifier.
Public propertyHasSolutionModifier
Gets whether the Query has a Solution Modifier (a GROUP BY, HAVING, ORDER BY, LIMIT or OFFSET).
Public propertyHaving
Gets/Sets the Having Clause for the Query.
Public propertyIsAggregate
Gets whether the Query has an Aggregate as its Result.
Public propertyIsOptimised
Gets whether Optimisation has been applied to the query.
Public propertyIsSubQuery
Gets whether this Query is a Sub-Query in another Query.
Public propertyLimit
Gets the Result Set Limit for the Query.
Public propertyNamedGraphs
Gets the Named Graph URIs for the Query.
Public propertyNamespaceMap
Gets the Namespace Map for the Query.
Public propertyOffset
Gets/Sets the Result Set Offset for the Query.
Public propertyOrderBy
Gets/Sets the Ordering for the Query.
Public propertyPartialResultsOnTimeout
Gets/Sets whether Partial Results should be returned in the event of Query Timeout.
Public propertyPropertyFunctionFactories
Gets/Sets the locally scoped Property Function factories that may be used by the PropertyFunctionOptimiser when generating the algebra for the query.
Public propertyQueryExecutionTime
Gets the Time taken to execute a Query.
Public propertyQueryType
Gets the type of the Query.
Public propertyRootGraphPattern
Gets the top level Graph Pattern of the Query.
Public propertySpecialType
Gets the Special Type of the Query (if any).
Public propertyTimeout
Gets/Sets the Query Execution Timeout in milliseconds.
Public propertyUsesDefaultDataset
Gets whether a Query uses the Default Dataset against which it is evaluated.
Public propertyVariables
Gets the Variables used in the Query.
Public propertyVirtualCount
The number of results that would be returned without any limit clause to a query or -1 if not supported. Defaults to the same value as the Count member.
Public methodAddDefaultGraph
Adds a Default Graph URI.
Public methodAddNamedGraph
Adds a Named Graph URI.
Public methodClearDefaultGraphs
Removes all Default Graph URIs.
Public methodClearNamedGraphs
Removes all Named Graph URIs.
Public methodCopy
Creates a copy of the query.
Public methodCreateBlankNode
Creates a Blank Node with a new automatically generated ID.
(Inherited from NodeFactory.)
Public methodCreateBlankNode(String)
Creates a Blank Node with the given Node ID.
(Inherited from NodeFactory.)
Public methodCreateGraphLiteralNode
Creates a Graph Literal Node which represents the empty Subgraph.
(Inherited from NodeFactory.)
Public methodCreateGraphLiteralNode(IGraph)
Creates a Graph Literal Node which represents the given Subgraph.
(Inherited from NodeFactory.)
Public methodCreateLiteralNode(String)
Creates a Literal Node with the given Value.
(Inherited from NodeFactory.)
Public methodCreateLiteralNode(String, String)
Creates a Literal Node with the given Value and Language.
(Inherited from NodeFactory.)
Public methodCreateLiteralNode(String, Uri)
Creates a Literal Node with the given Value and Data Type.
(Inherited from NodeFactory.)
Public methodCreateUriNode
Creates a URI Node for the given URI.
(Inherited from NodeFactory.)
Public methodCreateVariableNode
Creates a Variable Node for the given Variable Name.
(Inherited from NodeFactory.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodEvaluate(IInMemoryQueryableStore) Obsolete.
Evaluates the SPARQL Query against the given Triple Store.
Public methodEvaluate(ISparqlDataset) Obsolete.
Evaluates the SPARQL Query against the given Dataset.
Public methodEvaluate(IRdfHandler, ISparqlResultsHandler, IInMemoryQueryableStore) Obsolete.
Evaluates the SPARQL Query against the given Triple Store processing the results with the appropriate handler from those provided.
Public methodEvaluate(IRdfHandler, ISparqlResultsHandler, ISparqlDataset) Obsolete.
Evaluates the SPARQL Query against the given Dataset processing the results with an appropriate handler form those provided.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetNextBlankNodeID
Creates a new unused Blank Node ID and returns it.
(Inherited from NodeFactory.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodOptimise
Applies optimisation to a Query using the default global optimiser.
Public methodOptimise(IQueryOptimiser)
Applies optimisation to a Query using the specific optimiser.
Public methodProcess
Processes the Query using the given Query Processor.
Public methodToAlgebra
Converts the Query into it's SPARQL Algebra representation (as represented in the Leviathan API).
Public methodToString
Generates a String representation of the Query.
(Overrides ObjectToString.)

Note: This class is purposefully sealed and most setters are private/protected internal since generally you create a query by using the SparqlQueryParser to parse a query string/file.

To build a query programmatically you can use the QueryBuilder class to generate a new query and then various extension methods to modify that query using a fluent style API. A query is not immutable so if you use that API you are modifying the query, if you want to generate new queries by modifying an existing query consider using the Copy method to take a copy of the existing query.

See Also