Class SparqlBuilder
java.lang.Object
org.eclipse.rdf4j.sparqlbuilder.core.SparqlBuilder
A class to with static methods to create SPARQL query elements.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Assignmentas(Assignable exp, Variable var) Create a SPARQL assignmentstatic OrderConditionCreate an ascending SPARQL order conditionstatic BaseCreate a SPARQL Base declarationstatic BaseCreate a SPARQL Base declarationstatic GraphTemplateconstruct(TriplePattern... triples) Create a SPARQL graph templatestatic DatasetCreate a dataset declarationstatic OrderConditionCreate a descending SPARQL order conditionstatic FromCreate a default graph referencestatic FromCreate a default graph referencestatic FromCreate a named graph referencestatic FromCreate a named graph referencestatic GroupByCreate a SPARQL Group By clausestatic Havinghaving(Expression<?>... expressions) Create a SPARQL Having clausestatic OrderByCreate a SPARQL Order clausestatic PrefixCreate a SPARQL Prefix declarationstatic PrefixCreate a SPARQL Prefix declarationstatic PrefixCreate a SPARQL default Prefix declarationstatic PrefixCreate SPARQL Prefix declaration from the givenNamespace.static PrefixCreate a SPARQL default Prefix declarationstatic PrefixDeclarationsCreate a SPARQL Prefix clausestatic Projectionselect(Projectable... projectables) Create a SPARQL projectionstatic TriplesTemplatetriplesTemplate(TriplePattern... triples) Create a TriplesTemplate instance, for use with Construct and Update queriesstatic VariableCreate a SPARQL variable with a specific alias.static QueryPatternwhere(GraphPattern... patterns) Create a SPARQL query pattern
-
Method Details
-
var
Create a SPARQL variable with a specific alias.- Parameters:
varName- the alias of the variable- Returns:
- a new SPARQL variable
-
as
Create a SPARQL assignment- Parameters:
exp- the expression to evaluatevar- the variable to bind the expression value to- Returns:
- an Assignment object
-
base
Create a SPARQL Base declaration- Parameters:
iri- the base iri- Returns:
- a Base object
-
base
Create a SPARQL Base declaration- Parameters:
iri- the base iri- Returns:
- a Base object
-
prefix
Create a SPARQL Prefix declaration- Parameters:
alias- the alias of the prefixiri- the iri the alias refers to- Returns:
- a Prefix object
-
prefix
Create a SPARQL Prefix declaration- Parameters:
alias- the alias of the prefixiri- the iri the alias refers to- Returns:
- a Prefix object
-
prefix
Create a SPARQL default Prefix declaration- Parameters:
iri- the default iri prefix- Returns:
- a Prefix object
-
prefix
Create a SPARQL default Prefix declaration- Parameters:
iri- the default iri prefix as anIRI.- Returns:
- a Prefix object
-
prefix
Create SPARQL Prefix declaration from the givenNamespace.- Parameters:
namespace- theNamespaceto convert to a prefix declaration.- Returns:
- a Prefix object.
-
prefixes
Create a SPARQL Prefix clause- Parameters:
prefixes- prefix declarations to add to this Prefix clause- Returns:
- a new
-
from
Create a default graph reference- Parameters:
iri- the source of the graph- Returns:
- a From clause
- See Also:
-
from
Create a default graph reference- Parameters:
iri- the source of the graph- Returns:
- a From clause
- See Also:
-
fromNamed
Create a named graph reference- Parameters:
iri- the source of the graph- Returns:
- a named From clause
- See Also:
-
fromNamed
Create a named graph reference- Parameters:
iri- the source of the graph- Returns:
- a named From clause
- See Also:
-
dataset
Create a dataset declaration- Parameters:
graphs-- Returns:
- a new dataset clause
- See Also:
-
select
Create a SPARQL projection- Parameters:
projectables- projectable elements to add to the projection- Returns:
- a Projection
-
construct
Create a SPARQL graph template- Parameters:
triples- triples to add to the template- Returns:
- a new SPARQL graph template
-
where
Create a SPARQL query pattern- Parameters:
patterns- graph patterns to add to the query pattern- Returns:
- a new Query Pattern
-
groupBy
Create a SPARQL Group By clause- Parameters:
groupables- the group conditions- Returns:
- a Group By clause
-
orderBy
Create a SPARQL Order clause- Parameters:
conditions- the order conditions- Returns:
- an Order By clause
-
having
Create a SPARQL Having clause- Parameters:
expressions- the having conditions- Returns:
- a Having clause
-
asc
Create an ascending SPARQL order condition- Parameters:
orderOn- the order comparator- Returns:
- an ASC() order condition
-
desc
Create a descending SPARQL order condition- Parameters:
orderOn- the order comparator- Returns:
- a DESC() order condition
-
triplesTemplate
Create a TriplesTemplate instance, for use with Construct and Update queries- Parameters:
triples- the triples to include in the triples template- Returns:
- a TriplesTemplate of the given triples
-