de.fuberlin.wiwiss.d2rq.algebra
Class VariableConstraints
java.lang.Object
de.fuberlin.wiwiss.d2rq.algebra.VariableConstraints
public class VariableConstraints
- extends Object
A map from variables to NodeMaker
s that helps to build up
constraints in cases where a variable is bound multiple times.
If several node makers are added for the same variable name, then only
one will be kept, and a constraint expression will be built up. The
expression ensures that both identically-named node makers produce the
same node for any result row that matches the expression.
- Author:
- Richard Cyganiak (richard@cyganiak.de)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VariableConstraints
public VariableConstraints()
add
public void add(Var var,
NodeMaker nodeMaker,
AliasMap aliases)
addIfVariable
public void addIfVariable(Node possibleVariable,
NodeMaker nodeMaker,
AliasMap aliases)
addAll
public void addAll(NodeRelation nodeRelation)
satisfiable
public boolean satisfiable()
- Returns:
- false if two identically-named node makers cannot produce the same node
constraint
public Expression constraint()
- Returns:
- An expression that, if it holds for a result row, will ensure that
any two identically-named node makers produce the same node
toMap
public Map<Var,NodeMaker> toMap()
- Returns:
- A regular map from variable names to
NodeMaker
s
allNames
public Set<Var> allNames()
relationAliases
public Map<Var,AliasMap> relationAliases()
allProjections
public Set<ProjectionSpec> allProjections()
- Returns:
- All projections needed by any of the retained node makers