return Expression.FALSE;
}
List<Expression> translated = new ArrayList<Expression>();
if (attributes.size() >= 2) {
Iterator<Attribute> it = attributes.iterator();
Attribute first = it.next();
while (it.hasNext()) {
translated.add(Equality.createAttributeEquality(first, it.next()));
}
}
if (patterns.size() >= 2) {
Iterator<Pattern> it = patterns.iterator();
Pattern first = it.next();
while (it.hasNext()) {
translated.addAll(matchPatterns(first, it.next()));
}
}
if (expressions.size() >= 2) {
Iterator<Expression> it = expressions.iterator();
Expression first = it.next();
while (it.hasNext()) {
translated.add(Equality.create(first, it.next()));
}
}
if (blankNodeIDs.size() >= 2) {
Iterator<BlankNodeID> it = blankNodeIDs.iterator();
BlankNodeID first = it.next();
while (it.hasNext()) {
translated.addAll(matchBlankNodeIDs(first, it.next()));
}
}
if (constantValue != null) {
if (!attributes.isEmpty()) {
Attribute first = attributes.iterator().next();
translated.add(Equality.createAttributeValue(first, constantValue));
}
if (!blankNodeIDs.isEmpty()) {
BlankNodeID first = blankNodeIDs.iterator().next();
translated.add(first.valueExpression(constantValue));
}
if (!patterns.isEmpty()) {
Pattern first = patterns.iterator().next();
translated.add(first.valueExpression(constantValue));
}
if (!expressions.isEmpty()) {
Expression first = expressions.iterator().next();
translated.add(Equality.createExpressionValue(first, constantValue));
}
} else if (!attributes.isEmpty()) {
AttributeExpr attribute = new AttributeExpr(attributes.iterator().next());
if (!blankNodeIDs.isEmpty()) {
BlankNodeID first = blankNodeIDs.iterator().next();
translated.add(Equality.create(attribute, first.toExpression()));
}
if (!patterns.isEmpty()) {
Pattern first = patterns.iterator().next();
translated.add(Equality.create(attribute, first.toExpression()));
checkUsesColumnFunctions(first);
}
if (!expressions.isEmpty()) {
Expression first = expressions.iterator().next();
translated.add(Equality.create(attribute, first));
}
} else if (!expressions.isEmpty()) {
Expression expression = expressions.iterator().next();
if (!blankNodeIDs.isEmpty()) {
BlankNodeID first = blankNodeIDs.iterator().next();
translated.add(Equality.create(expression, first.toExpression()));
}
if (!patterns.isEmpty()) {
Pattern first = patterns.iterator().next();
translated.add(Equality.create(expression, first.toExpression()));
checkUsesColumnFunctions(first);
}
} else if (!patterns.isEmpty() && !blankNodeIDs.isEmpty()) {
Pattern firstPattern = patterns.iterator().next();
BlankNodeID firstBNodeID = blankNodeIDs.iterator().next();