public void apply(final RippleList arg,
final Sink<RippleList> solutions,
final ModelConnection mc) throws RippleException {
RippleList stack = arg;
RippleValue subj, pred, obj, ctx;
ctx = stack.getFirst();
stack = stack.getRest();
obj = stack.getFirst();
stack = stack.getRest();
pred = stack.getFirst();
stack = stack.getRest();
subj = stack.getFirst();
stack = stack.getRest();
mc.add(subj, pred, obj, ctx);
// TODO: store added and removed statements in a buffer until the
// ModelConnection commits. You may not simply wait to commit,
// as writing and then reading without first committing may result
// in a deadlock. The LinkedDataSail already does this sort of
// buffering, which is why it does not deadlock w.r.t. its base
// Sail.
mc.commit();
solutions.put(stack.push(subj));
}