StatementPattern attributePattern = new StatementPattern(subjectVar, attributePredVar,
attributeVar);
if (inheritanceProp != null) {
// create a union expression for this attribute.
Union union = new Union();
union.addArg(attributePattern);
// the join for checking if the access attribute is inherited.
Join inheritJoin = new Join();
Var inheritVar = new Var("-acl_inherited_value" + i);
// SP (?subject, inheritProp, ?S_i)
StatementPattern inheritPattern = new StatementPattern(subjectVar, inheritPredVar, inheritVar);
inheritJoin.addArg(inheritPattern);
// SP (?S_i, accessAttr_i, ?accessAttrValue_i)
StatementPattern inheritAttrPattern = new StatementPattern(inheritVar, attributePredVar,
attributeVar);
inheritJoin.addArg(inheritAttrPattern);
union.addArg(inheritJoin);
joinOfAttributePatterns.addArg(union);
}
else {
// no inheritance: the attribute can be matched with a simple