attributeVars.add(attributeVar);
Var attributePredVar = new Var("-acl_attr_pred_" + i, attribute);
// SP(?subject, accessAttr_i, ?accessAttrValue_i)
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);