IP Library › Granted Patent US 7,346,609
Granted Patent B2
US 7,346,609 · App. 10/990,834 · Granted Mar 18, 2008

Streaming XPath algorithm for XPath value index key generation

Assignee: International Business Machines Corporation
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,346,609
App. No.
10/990,834
Filed
Nov 16, 2004
Granted
Mar 18, 2008
Kind
B2
Art Unit
2169
USPC
707/3
Abstract

A method generates hierarchical path index keys for single and multiple indexes with one scan of a document. Each data node of the document is scanned and matches to query nodes are identified. A data node matches a query node if the three conditions hold: if it is not the root step, there is a match for the query node in the previous step of the query; the data node matches the query node of the current step; and the edges of the data and query nodes match. A sub-tree of a data node can be skipped if the data node is not matched and its level is less than the fixed levels of the query. The matched data node is then placed in the match stacks corresponding to the match query nodes. The method uses transitivity properties among matching units to reduce the number of states that need to be tracked and to improve the evaluation of path expressions significantly.

Claims (38)

1. A method for generating hierarchical path value index keys from an XPath expression, the method comprising:

scanning a plurality of data nodes of a document;

building a tree of query nodes from the XPath expression;

determining if each of the plurality of data nodes of the document matches corresponding query nodes associated with the tree of query nodes, including determining that each of the plurality of data nodes matches corresponding query nodes associated with the tree of query nodes responsive to

a root query node associated with the tree of query nodes matching a root data node of the plurality of data nodes;

names of the plurality of data nodes of the document matching names of the corresponding query nodes within the tree of query nodes; and

relationships between the plurality of data nodes matching relationships between

the corresponding query nodes within the tree of query nodes; and

placing the plurality of data nodes that match the corresponding query nodes associated with the tree of query nodes in a match stack table, the plurality of data nodes placed in the match stack table representing the hierarchical path value index keys,

otherwise outputting a result indicating that none of the plurality of data nodes of the document matches corresponding query nodes associated with the tree of query nodes responsive to that data nodes of the document not matching corresponding query nodes associated with the tree of query nodes,

wherein determining if each of the plurality of data nodes of the document matches corresponding query nodes associated with the tree of query nodes further comprises

clearing old matches from the match stack table;

searching a direct active state hash table and an indirect active state hash table to identify active states with a same name as a given data node and placing the identified active states in a list;

clearing direct active states in the direct active state hash table;

skipping descendants of a given data node if the list is empty and a level of the data node is less than a fixed level;

placing the data node in an output stream, if a corresponding query node in the list is a leaf node;

adding indirect nodes of the corresponding query node to an indirect active state hash table responsive to the corresponding query node not being the leaf node and the match stack table for the corresponding query node being empty; and

pushing a match entry for the corresponding query node onto the match stack table and adding direct states of the corresponding query node to the direct active state hash table.

2. The method of claim 1 , wherein relationships between the plurality of data nodes include parent-child (PC) relationships and ancestor-descendant (AD) relationships.

3. A computer readable medium encoded with a computer program for generating hierarchical path value index keys from an XPath expression, the computer program comprising computer executable code for:

scanning a plurality of data nodes of a document;

building a tree of query nodes from the XPath expression;

determining if each of the plurality of data nodes of the document matches corresponding query nodes associated with the tree of query nodes, including determining that each of the plurality of data nodes matches corresponding query nodes associated with the tree of query nodes responsive to

a root query node associated with the tree of query nodes matching a root data node of the plurality of data nodes;

names of the plurality of data nodes of the document matching names of the corresponding query nodes within the tree of query nodes; and

relationships between the plurality of data nodes matching relationships between

the corresponding query nodes within the tree of query nodes; and

placing the plurality of data nodes that match the corresponding query nodes associated with the tree of query nodes in a match stack table, the plurality of data nodes placed in the match stack table representing the hierarchical path value index keys,

otherwise outputting a result indicating that none of the plurality of data nodes of the document matches corresponding query nodes associated with the tree of query nodes responsive to that data nodes of the document not matching corresponding query nodes associated with the tree of query nodes,

wherein the computer executable code for determining if each of the plurality of data nodes of the document matches corresponding query nodes associated with the tree of query nodes further comprises computer executable code for

clearing old matches from the match stack table;

searching a direct active state hash table and an indirect active state hash table to identify active states with a same name as a given data node and placing the identified active states in a list;

clearing direct active states in the direct active state hash table;

skipping descendants of a given data node if the list is empty and a level of the data node is less than a fixed level;

placing the data node in an output stream, if a corresponding query node in the list is a leaf node;

adding indirect nodes of the corresponding query node to an indirect active state hash table responsive to the corresponding query node not being the leaf node and the match stack table for the corresponding query node being empty; and

pushing a match entry for the corresponding query node onto the match stack table and adding direct states of the corresponding query node to the direct active state hash table.

4. The computer readable medium of claim 3 , wherein relationships between the plurality of data nodes include parent-child (PC) relationships and ancestor-descendant (AD) relationships.

Assignments (4)
CHANGE OF NAME Recorded Oct 6, 2017
From: GOOGLE INC.
To: GOOGLE LLC
Reel/Frame 044142/0357 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 13, 2011
From: INTERNATIONAL BUSINESS MACHINES CORPORATION
To: GOOGLE INC.
Reel/Frame 026894/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 31, 2005
From: CHEN, YAO-CHING STEPHEN; LIU, IRENE CHING-HUA; NI, DEMAI; ZHANG, GUOGEN; ZOU, QINGHUA
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 016220/0727 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 26, 2005
From: CHEN, YAO-CHING STEPHEN; LIU, IRENE CHING-HUA; NI, DEMAI; ZHANG, GUOGEN; ZOU, QINGHUA
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 015623/0450 →
Continuity (1)
Related Publication 20060106758A1 · May 18, 2006