// graph is used)
if (graphConstraintItem != null) {
if (graphConstraintItem instanceof Variable) {
final Variable graphConstraint = (Variable) graphConstraintItem;
// check if named graphs were provided at query time
if (this.root.namedGraphs != null
&& this.root.namedGraphs.size() > 0) {
// Convert the named graphs' names into
// URILiterals
// to be applicable
// later on
for (final String name : this.root.namedGraphs) {
final Indices indices = this.root.dataset
.getNamedGraphIndices(LiteralFactory
.createURILiteralWithoutLazyLiteral(name));
final URILiteral rdfName = indices
.getRdfName();
if (namedGraphs.contains(rdfName)) {
final TriplePattern ztp = new TriplePattern(
graphConstraint.equals(tp
.getPos(0)) ? rdfName
: tp.getPos(0),
graphConstraint.equals(tp
.getPos(1)) ? rdfName
: tp.getPos(1),
graphConstraint.equals(tp
.getPos(2)) ? rdfName
: tp.getPos(2));
final Triple zkey = getKey(ztp, null);
final Triple keyMinimum = this.getKey(ztp,
null, minima);
final Triple keyMaximum = this.getKey(ztp,
null, maxima);
final VarBucket vb = this.getVarBucket(v,
ztp, zkey, keyMinimum,
keyMaximum,
(SixIndices) indices);
if (vb != null) {
final VarBucket previous_vb = result
.get(v);
if (previous_vb != null) {
vb.add(previous_vb);
}
vb.minimum = (minima == null) ? null
: minima.get(v);
vb.maximum = (maxima == null) ? null
: maxima.get(v);
result.put(v, vb);
}
}
}
}
// otherwise there might have been named graphs
// added
// during the evaluation
else {
// get all indices of named graphs and bind them
// to
// the graph constraint
final Collection<Indices> dataSetIndices = this.root.dataset
.getNamedGraphIndices();
if (dataSetIndices != null) {
for (final Indices indices : dataSetIndices) {
final TriplePattern ztp = new TriplePattern(
graphConstraint.equals(tp
.getPos(0)) ? indices
.getRdfName() : tp
.getPos(0),
graphConstraint.equals(tp
.getPos(1)) ? indices
.getRdfName() : tp
.getPos(1),
graphConstraint.equals(tp
.getPos(2)) ? indices
.getRdfName() : tp
.getPos(2));
final Triple zkey = getKey(ztp, null);
final Triple keyMinimum = this.getKey(ztp,