1. A method for performing a database query by a data processing system, comprising: receiving a closure rule and at least one input object in the data processing system, the closure rule having at least one closure rule clause to collect data required for a consolidation as a logically consistent set of data objects, the at least one input object in a primary class of objects to be included in the consolidation; identifying a first closure rule clause by the data processing system, from the at least one closure rule clause, to be evaluated for the at least one input object; constructing a recursive database query corresponding to the first closure rule clause by the data processing system; querying a database using the recursive database query by the data processing system, wherein querying the database further comprises in response to encountering a first object of the primary class of objects, processing and traversing, according to the closure rule, a second object referenced by the first object even when the second object is in a secondary class of objects; and receiving and storing results from the recursive database query as the logically consistent set of data objects for the consolidation in the data processing system.