/** * Get all constraints which are variables. This * method now uses the fourth element of the triple. * * @return A set containing all variable constraints. */ public Set<Variable> getVariables() { if (variables == null) { Set<Variable> v = new HashSet<Variable>(); Variable e = getVariable(); if (!e.getName().startsWith("_")) v.add(e); // now check the graph if (element[3] instanceof Variable && !((Variable)element[3]).getName().startsWith("_")) { v.add((Variable)element[3]); } variables = Collections.unmodifiableSet(v); } return variables; }
public Tuples resolve(QueryEvaluationContext context, ModelExpression modelExpr, ConstraintExpression constraintExpr) throws Exception { ConstraintIs constraint = (ConstraintIs)constraintExpr; return TuplesOperations.assign((Variable)context.localize(constraint.getVariable()), ((LocalNode)context.localize(constraint.getValueNode())).getValue()); } }),