Class GraphPattern
- java.lang.Object
- 
- org.eclipse.rdf4j.query.parser.sparql.GraphPattern
 
- 
 @InternalUseOnly public class GraphPattern extends Object A graph pattern consisting of (required and optional) tuple expressions, binding assignments and boolean constraints.- Author:
- Arjohn Kampman
 
- 
- 
Constructor SummaryConstructors Constructor Description GraphPattern()Creates a new graph pattern.GraphPattern(GraphPattern parent)Creates a new graph pattern that inherits the context and scope from a parent graph pattern.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConstraint(ValueExpr constraint)voidaddConstraints(Collection<ValueExpr> constraints)voidaddOptionalTE(TupleExpr te, List<ValueExpr> constraints)add the supplied tuple expression as an optional expression, with a list of constraints that hold as conditions.voidaddRequiredSP(Var subjVar, Var predVar, Var objVar)voidaddRequiredTE(TupleExpr te)TupleExprbuildTupleExpr()Builds a combined tuple expression from the tuple expressions and constraints in this graph pattern.voidclear()Removes all tuple expressions and constraints.List<ValueExpr>getConstraints()VargetContextVar()List<Map.Entry<TupleExpr,List<ValueExpr>>>getOptionalTEs()Retrieves the optional tuple expressions as a list of tuples with the tuple expression as the key and the list of value expressions as the value.List<TupleExpr>getRequiredTEs()StatementPattern.ScopegetStatementPatternScope()List<ValueExpr>removeAllConstraints()voidsetContextVar(Var contextVar)voidsetStatementPatternScope(StatementPattern.Scope spScope)
 
- 
- 
- 
Constructor Detail- 
GraphPatternpublic GraphPattern() Creates a new graph pattern.
 - 
GraphPatternpublic GraphPattern(GraphPattern parent) Creates a new graph pattern that inherits the context and scope from a parent graph pattern.
 
- 
 - 
Method Detail- 
setContextVarpublic void setContextVar(Var contextVar) 
 - 
getContextVarpublic Var getContextVar() 
 - 
setStatementPatternScopepublic void setStatementPatternScope(StatementPattern.Scope spScope) 
 - 
getStatementPatternScopepublic StatementPattern.Scope getStatementPatternScope() 
 - 
addRequiredTEpublic void addRequiredTE(TupleExpr te) 
 - 
addOptionalTEpublic void addOptionalTE(TupleExpr te, List<ValueExpr> constraints) add the supplied tuple expression as an optional expression, with a list of constraints that hold as conditions.- Parameters:
- te- a tuple expression
- constraints- a list of constraints that form a condition for the LeftJoin to be formed from the optional TE.
 
 - 
getOptionalTEspublic List<Map.Entry<TupleExpr,List<ValueExpr>>> getOptionalTEs() Retrieves the optional tuple expressions as a list of tuples with the tuple expression as the key and the list of value expressions as the value.- Returns:
- a list of Map entries.
 
 - 
addConstraintpublic void addConstraint(ValueExpr constraint) 
 - 
addConstraintspublic void addConstraints(Collection<ValueExpr> constraints) 
 - 
clearpublic void clear() Removes all tuple expressions and constraints.
 - 
buildTupleExprpublic TupleExpr buildTupleExpr() Builds a combined tuple expression from the tuple expressions and constraints in this graph pattern.- Returns:
- A tuple expression for this graph pattern.
 
 
- 
 
-