final ReplaceVar replaceVar = new ReplaceVar();
replaceVar.addSubstitution(object, subject);
final Variable variable = this.getVariable(subject.toString(), object.toString(), "interimVariable");
replaceVar.addSubstitution(variable, object);
if(graphConstraint!=null && graphConstraint.isVariable() && !graphConstraint.equals(getItem(subjectNode)) && !graphConstraint.equals(getItem(objectNode))) {
replaceVar.addSubstitution((Variable)graphConstraint, (Variable)graphConstraint);
}
final ReplaceVar replaceVari = new ReplaceVar();
replaceVari.addSubstitution(subject, subject);
replaceVari.addSubstitution(object, variable);
if(graphConstraint!=null && graphConstraint.isVariable() && !graphConstraint.equals(getItem(subjectNode)) && !graphConstraint.equals(getItem(objectNode))) {