Techniques are provided for automatically rewriting a
relational-to-hierarchical mapping into one or more modified mappings. In
this way, clients that prefer or require different portions of the
mapping-defined data are supported. For example, in one aspect of the
invention, a technique for modifying a relational-to-hierarchical mapping
in accordance with at least one user query includes the following
steps/operations. At least one query associated with a query language
that supports a hierarchical data structure is obtained. Further, at
least one relational-to-hierarchical mapping for use in translating data
associated with a relational data structure into data associated with the
hierarchical data structure is obtained. Then, the at least one
relational-to-hierarchical mapping is modified based on the at least one
query such that data specifically relevant to the at least one query may
be generated in accordance with the modified relational-to-hierarchical
mapping.