template-based wrappers in the tsimmis system  in order to access information from a variety of heterogeneous information sources, one has to be able to translate queries and data from one data model into another. this functionality is provided by so-called (source) wrappers [4,8] which convert queries into one or more commands/queries understandable by the underlying source and transform the native results into a format understood by the application. as part of the tsimmis project [1, 6] we have developed hard-coded wrappers for a variety of sources (e.g., sybase dbms, www pages, etc.) including legacy systems (folio). however, anyone who has built a wrapper before can attest that a lot of effort goes into developing and writing such a wrapper. in situations where it is important or desirable to gain access to new sources quickly, this is a major drawback. furthermore, we have also observed that only a relatively small part of the code deals with the specific access details of the source. the rest of the code is either common among wrappers or implements query and data transformation that could be expressed in a high level, declarative fashion.  based on these observations, we have developed a wrapper implementation toolkit [7] for quickly building wrappers. the toolkit contains a library for commonly used functions, such as for receiving queries from the application and packaging results. it also contains a facility for translating queries into source-specific commands, and for translating results into a model useful to the application. the philosophy behind our "template-based" translation methodology is as follows. the wrapper implementor specifies a set of templates (rules) written in a high level declarative language that describe the queries accepted by the wrapper as well as the objects that it returns. if an application query matches a template, an implementor-provided action associated with the template is executed to provide the native query for the underlying source1. when the source returns the result of the query, the wrapper transforms the answer which is represented in the data model of the source into a representation that is used by the application. using this toolkit one can quickly design a simple wrapper with a few templates that cover some of the desired functionality, probably the one that is most urgently needed. however, templates can be added gradually as more functionality is required later on.  another important use of wrappers is in extending the query capabilities of a source. for instance, some sources may not be capable of answering queries that have multiple predicates. in such cases, it is necessary to pose a native query to such a source using only predicates that the source is capable of handling. the rest of the predicates are automatically separated from the user query and form a filter query. when the wrapper receives the results, a post- processing engine applies the filter query. this engine supports a set of built-in predicates based on the comparison operators =, ,<,>, etc. in addition, the engine supports more complex predicates that can be specified as part of the filter query. the postprocessing engine is common to wrappers of all sources and is part of the wrapper toolkit. note that because of postprocessing, the wrapper can handle a much larger class of queries than those that exactly match the templates it has been given.  figure 1 shows an overview of the wrapper architecture as it is currently implemented in our tsimmis testbed. shaded components are provided by the toolkit, the white component is source-specific and must be generated by the implementor. the driver component controls the translation process and invokes the following services: the parser which parses the templates, the native schema, as well as the incoming queries into internal data structures, the matcher which matches a query against the set of templates and creates a filter query for postprocessing if necessary, the native component which submits the generated action string to the source, and extracts the data from the native result using the information given in the source schema, and the engine, which transforms and packages the result and applies a postprocessing filter if one has been created by the matcher. we now describe the sequence of events that occur at the wrapper during the translation of a query and its result using an example from our prototype system. the queries are formulated using a rule-based language called msl that has been developed as a template specification and query language for the tsimmis project. data is represented using our object exchange model (oem). we will briefly describe msl and oem in the next section. details on msl can be found in [5], a full introduction to oem is given in [1].  joachim hammer hector garcia-molina svetlozar nestorov ramana yerneni marcus breunig vasilis vassalos