Class Query<T extends Query<T>>
java.lang.Object
org.eclipse.rdf4j.sparqlbuilder.core.query.Query<T>
- Type Parameters:
T- They type of query. Used to support fluency.
- All Implemented Interfaces:
QueryElement
- Direct Known Subclasses:
OuterQuery,SubSelect
The base class for all SPARQL Queries. Contains elements and methods common to all queries.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected intprotected static final Stringprotected intprotected static final Stringprotected intprotected QueryPattern -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbNode()A shortcut.Set the Dataset clause for this queryAdd datasets to this queryprotected abstract StringAdd grouping specifiers for the query results.Set this query's Group By clausehaving(Expression<?>... constraints) Specify constraints for this query's Having clause.Set this query's Having clauselimit(int limit) Set a limit on the number of results returned by this query.offset(int offset) Specify an offset in query results.Specify orderings for the query resultsSet this query's Order By clausevar()A shortcut.where(QueryPattern where) Set the query pattern of this querywhere(GraphPattern... queryPatterns) Add graph patterns to this query's query pattern
-
Field Details
-
LIMIT
- See Also:
-
OFFSET
- See Also:
-
from
-
where
-
groupBy
-
orderBy
-
having
-
limit
protected int limit -
offset
protected int offset -
varCount
protected int varCount -
bnodeCount
protected int bnodeCount
-
-
Constructor Details
-
Query
public Query()
-
-
Method Details
-
from
Add datasets to this query- Parameters:
graphs- the graph specifiers to add- Returns:
- this
-
from
Set the Dataset clause for this query- Parameters:
from- theDatasetclause to set- Returns:
- this
-
where
Add graph patterns to this query's query pattern- Parameters:
queryPatterns- the patterns to add- Returns:
- this
- See Also:
-
where
Set the query pattern of this query- Parameters:
where- the query pattern to set- Returns:
- this
-
groupBy
Add grouping specifiers for the query results.- Parameters:
groupables- the objects to group on, in order (appended to the end of any existing grouping specifiers)- Returns:
- this
- See Also:
-
groupBy
Set this query's Group By clause- Parameters:
groupBy- theGroupByclause to set- Returns:
- this
-
orderBy
Specify orderings for the query results- Parameters:
conditions- the objects to order on, in order- Returns:
- this
- See Also:
-
orderBy
Set this query's Order By clause- Parameters:
orderBy- theOrderByclause to set- Returns:
- this
-
having
Specify constraints for this query's Having clause.- Parameters:
constraints- the constraints to add to the clause- Returns:
- this
- See Also:
-
having
Set this query's Having clause- Parameters:
having- the Having clause to set- Returns:
- this
-
limit
Set a limit on the number of results returned by this query.- Parameters:
limit-- Returns:
- this
- See Also:
-
offset
Specify an offset in query results.- Parameters:
offset-- Returns:
- this
- See Also:
-
var
A shortcut. Each call to this method returns a newVariablethat is unique (i.e., has a unique alias) to this query instance.- Returns:
- a
Variableobject that is unique to this query instance
-
bNode
A shortcut. Each call to this method returns a newRdfBlankNode.LabeledBlankNodethat is unique (i.e., has a unique alias) to this query instance.- Returns:
- a
RdfBlankNode.LabeledBlankNodeobject that is unique to this query instance
-
getQueryActionString
-
getQueryString
- Specified by:
getQueryStringin interfaceQueryElement- Returns:
- the String representing the SPARQL syntax of this element
-