1. A method for processing queries comprising: receiving a query that comprises a model clause, said model clause comprising a rule, wherein said rule comprises: a parameter indicating an UPSERT operation; a left-side expression, wherein said left-side expression includes one or more existential predicates, wherein each of said one or more existential predicates evaluates to a Boolean value; and a right-side expression; executing said query to generate a relation, wherein executing said query comprises evaluating said rule according to the UPSERT operation; wherein the method is performed by one or more computer systems.