Patent ID: 7366973

Claim:
A method in a computer system for generating a new representation of a document, the document having a current representation that is based on a hierarchical model in which hierarchical relationships between elements are defined by the model and non-hierarchical relationships between elements and content of elements are not defined by the model, the method comprising: identifying entities referenced by elements of the current representation that are to be items in the new representation, wherein the current representation represents some relationships between entities hierarchically by nesting elements and other relationships non-hierarchically by referring to another element of the hierarchical model, such that the current representation contains multiple references to at least one entity, wherein identifying entities comprises parsing expressions of the elements of the current representation using parsing rules; for each identified entity, creating for the new representation an item corresponding to the identified entity, wherein only one item is created in the new representation for the at least one entity having multiple references in the current representation, wherein creating the item comprises generating the new representation using generation rules that specify patterns for creating items of the new representation; for each created item, adding to the item that is a subject of a hierarchical relationship as indicated by the current representation a relation to each item corresponding to an identified element that is an object of the hierarchical relationship as indicated by the current representation; and for non-hierarchical relationships between elements and content of elements as indicated by the current representation, adding to an item corresponding to the element that is the subject of the non-hierarchical relationship a relation to the item corresponding to the content of the element that is the object of the non-hierarchical relationship, wherein the created items and the added relations form the new representation of the document, such that when an entity is the subject of both a hierarchical and nonhierarchical relationship in the current representation, the new representation contains a single instance of the entity and wherein the new representation forms a data structure that can be traversed by relationships between entities such that a program can use the new representation to interpret hierarchical and nonhierarchical relationships in the same way.