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 Assignment
as(Assignable exp, Variable var)
Create a SPARQL assignmentstatic OrderCondition
Create an ascending SPARQL order conditionstatic Base
Create a SPARQL Base declarationstatic Base
Create a SPARQL Base declarationstatic GraphTemplate
construct(TriplePattern... triples)
Create a SPARQL graph templatestatic Dataset
Create a dataset declarationstatic OrderCondition
Create a descending SPARQL order conditionstatic From
Create a default graph referencestatic From
Create a default graph referencestatic From
Create a named graph referencestatic From
Create a named graph referencestatic GroupBy
Create a SPARQL Group By clausestatic Having
having(Expression<?>... expressions)
Create a SPARQL Having clausestatic OrderBy
Create a SPARQL Order clausestatic Prefix
Create a SPARQL Prefix declarationstatic Prefix
Create a SPARQL Prefix declarationstatic Prefix
Create a SPARQL default Prefix declarationstatic Prefix
Create SPARQL Prefix declaration from the givenNamespace
.static Prefix
Create a SPARQL default Prefix declarationstatic PrefixDeclarations
Create a SPARQL Prefix clausestatic Projection
select(Projectable... projectables)
Create a SPARQL projectionstatic TriplesTemplate
triplesTemplate(TriplePattern... triples)
Create a TriplesTemplate instance, for use with Construct and Update queriesstatic Variable
Create a SPARQL variable with a specific alias.static QueryPattern
where(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
- theNamespace
to 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:
- RDF Datasets
-
from
Create a default graph reference- Parameters:
iri
- the source of the graph- Returns:
- a From clause
- See Also:
- RDF Datasets
-
fromNamed
Create a named graph reference- Parameters:
iri
- the source of the graph- Returns:
- a named From clause
- See Also:
- RDF Datasets
-
fromNamed
Create a named graph reference- Parameters:
iri
- the source of the graph- Returns:
- a named From clause
- See Also:
- RDF Datasets
-
dataset
Create a dataset declaration- Parameters:
graphs
-- Returns:
- a new dataset clause
- See Also:
- RDF Datasets
-
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
-