public class QueryAlgebraUtil extends Object
Constructor and Description |
---|
QueryAlgebraUtil() |
Modifier and Type | Method and Description |
---|---|
protected static Var |
appendVar(Var var,
Set<String> varNames,
BindingSet bindings)
Clone the specified variable and attach bindings.
|
protected static Var |
appendVarId(Var var,
String varID,
Set<String> varNames,
BindingSet bindings)
Clone the specified variable and attach bindings, moreover change name of variable by appending "_varId" to it.
|
protected static Union |
constructInnerUnion(StatementPattern stmt,
int outerID,
Set<String> varNames,
List<BindingSet> bindings) |
protected static StatementPattern |
constructStatement(StatementPattern stmt,
Set<String> varNames,
BindingSet bindings)
Construct the statement string, i.e.
|
protected static TupleExpr |
constructStatementCheckId(StatementPattern stmt,
int varID,
Set<String> varNames,
BindingSet bindings)
Construct the statement string, i.e.
|
protected static StatementPattern |
constructStatementId(StatementPattern stmt,
String varID,
Set<String> varNames,
BindingSet bindings)
Construct the statement string, i.e.
|
static Collection<String> |
getFreeVars(TupleExpr tupleExpr)
Computes the collection of free variables in the given
TupleExpr . |
static Value |
getVarValue(Var var,
BindingSet bindings)
Return the
Value of the variable which is either taken from the variable itself (bound) or from the
bindingsset (unbound). |
static boolean |
hasFreeVars(StatementPattern stmt,
BindingSet bindings)
returns true iff there is at least one free variable, i.e.
|
static TupleExpr |
selectQuery(ExclusiveGroup group,
BindingSet bindings,
FilterValueExpr filterExpr,
AtomicBoolean evaluated)
Construct a SELECT query for the provided
ExclusiveGroup . |
static TupleExpr |
selectQuery(StatementPattern stmt,
BindingSet bindings,
FilterValueExpr filterExpr,
AtomicBoolean evaluated)
Construct a SELECT query for the provided statement.
|
static TupleExpr |
selectQueryBoundUnion(StatementPattern stmt,
List<BindingSet> unionBindings,
FilterValueExpr filterExpr,
Boolean evaluated)
Construct a SELECT query expression for a bound union.
|
static TupleExpr |
selectQueryStringBoundCheck(StatementPattern stmt,
List<BindingSet> unionBindings)
Construct a SELECT query for a grouped bound check.
|
static Statement |
toStatement(StatementPattern stmt) |
static Statement |
toStatement(StatementPattern stmt,
BindingSet bindings) |
static StatementPattern |
toStatementPattern(Resource subj,
IRI pred,
Value obj) |
static StatementPattern |
toStatementPattern(Statement stmt) |
static TupleExpr |
toTupleExpr(ArbitraryLengthPath node,
Set<String> varNames,
BindingSet bindings)
Convert the given
ArbitraryLengthPath to a fresh TupleExpr where all provided bindings are bound. |
public static boolean hasFreeVars(StatementPattern stmt, BindingSet bindings)
stmt
- bindings
- public static Value getVarValue(Var var, BindingSet bindings)
Value
of the variable which is either taken from the variable itself (bound) or from the
bindingsset (unbound).var
- bindings
- the bindings, must not be null, use EmptyBindingSet
insteadpublic static TupleExpr toTupleExpr(ArbitraryLengthPath node, Set<String> varNames, BindingSet bindings)
ArbitraryLengthPath
to a fresh TupleExpr
where all provided bindings are bound.node
- varNames
- bindings
- public static StatementPattern toStatementPattern(Statement stmt)
public static StatementPattern toStatementPattern(Resource subj, IRI pred, Value obj)
public static Statement toStatement(StatementPattern stmt)
public static Statement toStatement(StatementPattern stmt, BindingSet bindings)
public static TupleExpr selectQuery(StatementPattern stmt, BindingSet bindings, FilterValueExpr filterExpr, AtomicBoolean evaluated) throws IllegalQueryException
stmt
- bindings
- filterExpr
- evaluated
- parameter can be used outside this method to check whether FILTER has been evaluated, false in
beginningIllegalQueryException
public static TupleExpr selectQuery(ExclusiveGroup group, BindingSet bindings, FilterValueExpr filterExpr, AtomicBoolean evaluated)
ExclusiveGroup
. Note that bindings and filterExpr are applied
whenever possible.group
- the expression for the querybindings
- the bindings to be appliedfilterExpr
- a filter expression or nullevaluated
- parameter can be used outside this method to check whether FILTER has been evaluated, false in
beginningpublic static TupleExpr selectQueryBoundUnion(StatementPattern stmt, List<BindingSet> unionBindings, FilterValueExpr filterExpr, Boolean evaluated)
stmt
- unionBindings
- filterExpr
- evaluated
- parameter can be used outside this method to check whether FILTER has been evaluated, false
in beginningpublic static TupleExpr selectQueryStringBoundCheck(StatementPattern stmt, List<BindingSet> unionBindings)
stmt
- unionBindings
- protected static Union constructInnerUnion(StatementPattern stmt, int outerID, Set<String> varNames, List<BindingSet> bindings)
protected static StatementPattern constructStatement(StatementPattern stmt, Set<String> varNames, BindingSet bindings)
stmt
- varNames
- bindings
- StatementPattern
protected static StatementPattern constructStatementId(StatementPattern stmt, String varID, Set<String> varNames, BindingSet bindings)
stmt
- varNames
- bindings
- StatementPattern
protected static TupleExpr constructStatementCheckId(StatementPattern stmt, int varID, Set<String> varNames, BindingSet bindings)
stmt
- varID
- varNames
- bindings
- protected static Var appendVar(Var var, Set<String> varNames, BindingSet bindings)
var
- varNames
- bindings
- protected static Var appendVarId(Var var, String varID, Set<String> varNames, BindingSet bindings)
var
- varID
- varNames
- bindings
- public static Collection<String> getFreeVars(TupleExpr tupleExpr)
TupleExpr
.tupleExpr
- the expressionVariableExpr
Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.