Patent ID: 7171404

Claim:
A method for generating a result for a query of a document of elements using pre-computed step queries and pre-computed step query results stored in a database, the method comprising: receiving the query, wherein the query comprises a path of elements in the document of elements; reducing the query into a plurality of step queries, wherein a step query comprises a relationship between a plurality of elements determined from a part of the path of elements; for each of the plurality of step queries, retrieving a pre-computed step query result and a pre-computed score for a step query in the plurality of step queries by querying the database using the step query, wherein the step query corresponds to a pre-computed step query and a pre-computed score for the pre-computed step query result, wherein a pre-computed step query and associated pre-computed score are computed from a canonical form of the pre-computed step query prior to receiving the query that comprises the path of elements; and displaying the result for the query using the step query results.