Patent ID: 7165063

Claim:
An XML query rewrite method processing an XML query, the XML query rewrite method comprising: identifying an expression of the XML query that receives a sequence of concatenated XML items as an expression input; determining of whether a set of items defined by an output of the expression is independent of grouping of items in the expression input by determining a granularity property according to: SET ⁡ ( EVAL ⁡ ( exp , LET ⁡ ( I ) ) ) + SET ( CONCAT i ⁢ ⁢ in ⁢ ⁢ LET ⁡ ( I ) ( EVAL ⁡ ( exp , ⁢ ⅈ ) ) ) where exp represents the expression, I represents the sequence of concatenated XML items, CONCAT is a concatenation operator, EVAL is an expression evaluation operator, SET is a set operator, LET produces a concatenated sequence of XML items, and wherein the set of items defined by the output of the expression is determined to be independent of grouping of items in the expression input if the granularity property is true; and transforming the expression input into a transformed data stream input, the transforming being conditioned upon the set of items defined by the output of the expression being independent of grouping of items in the expression input.