WO2006054506A1 - ツリーデータの検索・集計・ソート方法及びプログラム - Google Patents

ツリーデータの検索・集計・ソート方法及びプログラム Download PDF

Info

Publication number
WO2006054506A1
WO2006054506A1 PCT/JP2005/020808 JP2005020808W WO2006054506A1 WO 2006054506 A1 WO2006054506 A1 WO 2006054506A1 JP 2005020808 W JP2005020808 W JP 2005020808W WO 2006054506 A1 WO2006054506 A1 WO 2006054506A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
tree
nodes
root
parent
Prior art date
Application number
PCT/JP2005/020808
Other languages
English (en)
French (fr)
Inventor
Shinji Furusho
Original Assignee
Turbo Data Laboratories Inc.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Turbo Data Laboratories Inc. filed Critical Turbo Data Laboratories Inc.
Priority to JP2006544997A priority Critical patent/JP4796970B2/ja
Publication of WO2006054506A1 publication Critical patent/WO2006054506A1/ja

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9027Trees

Definitions

  • the present invention relates to a method of handling a tree-type data structure, and more particularly to a method of searching and “aggregating” and sorting data of a tree-type data structure.
  • the present invention also relates to an information processing apparatus that implements such a method.
  • the present invention relates to a program for executing such a method and a recording medium on which the program is recorded.
  • RDB relational databases
  • the second reason for the inefficiency is that it takes time to express the search results. If you try to express a node group that hits the search, you must also express the node that is a descendant of that node, but unlike the RDBMS, the data structure is atypical, so to express the descendant node It takes time.
  • RDB which is the mainstream of databases
  • a method of converting tree-format data to RDB for example, see Patent Document 1. Proposed.
  • RDB data is broken down into tables. Therefore, to convert the actual tree format data into RDB, it is necessary to push the tree format data into the table.
  • system construction based on RDB is a very laborious work.
  • An example approach to creating a database of XML data as is is to take a copy of the data entered in the tree structure. For example, if the item is "age" Separate search index data is stored (for example, see Patent Document 2). This makes full use of the merits of XML data that allows attributes to be added to the data itself, and allows the relational structure of each item expressed using tags to be stored as is.
  • Patent Document 1 Japanese Unexamined Patent Publication No. 2003-248615
  • Patent Document 2 Japanese Patent Laid-Open No. 2001-195406
  • Non-Patent Document 1 SECK, Inc., "Karearea White Paper", [online], [February 19, 2004 search], Internet ⁇ URL: http: //www.sec. Co.jp/products/karearea /
  • Non-Patent Document 2 W3C, "Extensible Markup Language (XML) 1.0 (ThirdEdition)", [online], 2004 February 4, [Search February 19, 2004], Internet URL: http: ⁇ www .w3.org / TR / 2004 / REC-xml-20040204 />
  • Non-Patent Document 3 R. Alan Zuiiku, Brad Lupen, Sultan Luman, “Programming XML”, Nikkei DP Soft Press, 2002, p. 59—84
  • this mechanism is a search that uses the relationship between nodes as a problem (for example, extraction of a tree that includes “60 years old” and “age” as ancestors and “1 year” and “age” as descendants) Not available for
  • the fundamental problem of such a conventional technique is that the tree-type data structure is expressed by focusing on only individual data and connecting the nodes that store the data with pointers.
  • the relationship between them for example, parent-child, ancestor, descendant, sibling (generation), generation, etc., cannot be traced efficiently.
  • the value of the pointer is not constant, it cannot be used for the purpose of indicating the data storage address, and the relationship between the nodes cannot be expressed directly.
  • the above DOM only specifies the interface for operations that edit the topology of the tree-type data structure, not the specific method of operations.
  • the present invention provides a method, an information processing apparatus, a program, and a recording medium on which the program is recorded, which can efficiently search, aggregate, and sort data having a tree-type data structure.
  • the purpose is to provide the body.
  • the present invention relates to a parent-child relationship between nodes constituting a tree-type data structure, and a parent node to a child node that is not a parent-child relationship in which a child node is associated with a parent node. If the data is expressed by a “child-to-parent” relationship that associates the nodes, the tree-type data structure data is searched, aggregated, and sorted based on the parent-child relationship expression.
  • a method for retrieving data having a tree-type data structure including a root 'node developed in a storage device and a non-root' node that is a node other than the root 'node. As described in 1,
  • a unique node identifier is assigned to all nodes including the root node, and the node identifier assigned to each parent node of the non-root node is associated with the node identifier assigned to each non-root node, This represents the parent-child relationship between the nodes that make up the tree-type data structure,
  • Each node is associated with at least one entity information representing data
  • search hit information For each node, it is determined whether the entity information associated with the node matches the search condition. If the information matches, the search hit information is associated with the node, and the parent-child relationship between the nodes is determined. Associating search hit information with an ancestor node; a search step;
  • entity information can be specified, the entire tree can be inspected, and nodes that meet the conditions can be detected.
  • a parent-child relationship when a parent-child relationship is expressed by a known “parent ⁇ child” relationship, a single parent node may correspond to a plurality of child nodes.
  • the parent-child relationship cannot be defined without specifying. That is, even if a parent node is specified, a child node having a parent-child relationship with the parent node cannot be specified.
  • the parent-child relationship when the parent-child relationship is expressed by a “child ⁇ parent” relationship as in the present invention, since only one parent node always corresponds to one child node, this child node can be identified by specifying this child node. A single parent node corresponding to a child node can be immediately identified. This allows a tree data structure Can be searched at high speed.
  • node identifiers are defined by integers
  • an array that accommodates child node identifiers is not required when defining a parent-child relationship (ie, the topology of a tree-type data structure is described with one array) Memory usage is reduced and processing speed is increased.
  • the node identifier is an integer serial number.
  • the present invention provides, as described in claim 2,
  • the partial tree is a group of nodes including a specific node of the tree-type data structure and descendant nodes of the specific node.
  • the condition specifying step includes a step of specifying at least one partial tree representing the search range
  • the method further includes a step of storing an identifier representing a partial tree including a node associated with the search hit information as a search result.
  • the search result is obtained as a list of identifiers representing partial trees.
  • a method for retrieving data having a tree-type data structure including a root 'node developed in a storage device and a non-root' node that is a node other than the root 'node.
  • a unique node identifier is assigned to all nodes including the root node, and the node identifier assigned to each parent node of the non-root node is associated with the node identifier assigned to each non-root node, This represents the parent-child relationship between the nodes that make up the tree-type data structure,
  • Each node is associated with at least one entity information representing data
  • the partial tree is a group of nodes including a specific node of the tree-type data structure and descendant nodes of the specific node.
  • a method for retrieving data of a tree-type data structure including a root 'node developed in a storage device and a non-root' node that is a node other than the root 'node.
  • a unique node identifier is assigned to all nodes including the root node, and the node identifier assigned to each parent node of the non-root node is associated with the node identifier assigned to each non-root node, This represents the parent-child relationship between the nodes that make up the tree-type data structure,
  • Each node is associated with at least one entity information representing data
  • the partial tree is a group of nodes including a specific node of the tree-type data structure and descendant nodes of the specific node.
  • each partial tree it is determined whether or not at least one entity information associated with a node belonging to the partial tree matches the search condition based on a parent-child relationship between the nodes, and a matching node exists. Storing an identifier representing the partial tree as a search result;
  • entity information can be specified as a search condition, a partial tree can be inspected, and a partial tree identifier can be obtained as a search result.
  • a method for retrieving data of a tree-type data structure including a root 'node developed in a storage device and a non-root' node that is a node other than the root 'node.
  • a unique node identifier is assigned to all nodes including the root node, and the node identifier given to each of the non-root nodes is added to each parent node of the non-root node.
  • Node identifiers which represent the parent-child relationship between the nodes that make up the tree data structure,
  • Each node is associated with at least one entity information representing data
  • the partial tree is a group of nodes including a specific node of the tree-type data structure and descendant nodes of the specific node.
  • an ancestor node of the partial tree is identified by finding a parent-child relationship between the nodes, and at least one entity information associated with the specific node and Z or the ancestor node of the partial tree is searched. Determining whether the condition is met and associating search hit information with the matched node;
  • entity information can be specified as a search condition, an ancestor node can be inspected, and a node that matches the search condition can be obtained as a search result.
  • a method for retrieving data of a tree-type data structure including a root 'node developed in a storage device and a non-root' node that is a node other than the root 'node.
  • a unique node identifier is assigned to all nodes including the root node, and the node identifier assigned to each parent node of the non-root node is associated with the node identifier assigned to each non-root node, This represents the parent-child relationship between the nodes that make up the tree-type data structure,
  • Each node is associated with at least one entity information representing data
  • the partial tree is a group of nodes including a specific node of the tree-type data structure and descendant nodes of the specific node.
  • an ancestor node of the partial tree is identified by finding a parent-child relationship between the nodes, and at least one entity information associated with the specific node and Z or the ancestor node of the partial tree is searched.
  • Judges whether the condition is met and matches A step of storing an identifier representing the partial tree as a search result when a node exists;
  • entity information can be specified as a search condition, an ancestor node can be inspected, and an identifier of a partial tree having an ancestor node hit in the search can be obtained as a search result.
  • data of a tree-type data structure including a root 'node and a non-root' node that is a node other than the root 'node developed in the storage device is used as the first search condition and the second search condition.
  • the method of searching by logically combining is as described in claim 7,
  • a unique node identifier is assigned to all nodes including the root node, and the node identifier assigned to each parent node of the non-root node is associated with the node identifier assigned to each non-root node, This represents the parent-child relationship between the nodes that make up the tree-type data structure,
  • Each node is associated with at least one entity information representing data
  • the partial tree is a group of nodes including a specific node of the tree-type data structure and descendant nodes of the specific node.
  • At least one subtree representing the search scope is specified.
  • an identifier representing a partial tree to which a node that matches the first search condition belongs is obtained based on the parent-child relationship between the nodes.
  • an identifier representing a partial tree to which a node that matches the first search condition belongs is obtained based on a second search result based on a parent-child relationship between the nodes.
  • the first search condition and the second search condition By executing a logical operation corresponding to the logical relationship between the first search condition and the second search condition on the first search result and the second search result, the first search condition and the second search Generating search results that logically combine conditions;
  • a search combining search conditions is realized as a search using individual search conditions and a logical operation of the search results of the individual search.
  • a unique node identifier is assigned to all nodes including the root node, and the node identifier assigned to each parent node of the non-root node is associated with the node identifier assigned to each non-root node, This represents the parent-child relationship between the nodes that make up the tree-type data structure,
  • Each node is associated with at least one entity information representing data
  • the partial tree is a group of nodes including a specific node of the tree-type data structure and descendant nodes of the specific node.
  • For each partial tree identify the node group belonging to the partial tree based on the parent-child relationship between the nodes, and determine whether there is a node associated with the entity information representing the target of aggregation in the node group. And, if present, a step of aggregating entity information associated with the node;
  • a method for aggregating data of a tree-type data structure including a root 'node developed on a storage device and a non-root' node that is a node other than the root 'node is provided. As described in
  • a unique node identifier is assigned to all nodes including the root node, and the node identifier assigned to each parent node of the non-root node is associated with the node identifier assigned to each non-root node, This represents the parent-child relationship between the nodes that make up the tree-type data structure,
  • Each node is associated with at least one entity information representing data
  • the partial tree is a group of nodes including a specific node of the tree-type data structure and descendant nodes of the specific node. Specifying entity information representing a classification target for aggregation, specifying entity information representing an aggregation target, and specifying at least one partial tree representing a range of aggregation;
  • For each partial tree identify the node group belonging to the partial tree based on the parent-child relationship between the nodes, and determine whether there is a node associated with the entity information representing the target of aggregation in the node group. And, if present, summing entity information associated with the node for each entity information representing a classification target of aggregation related to the node group belonging to the partial tree;
  • an order is given to at least two node groups of data of a tree-type data structure including a root 'node expanded in a storage device and a non-root' node that is a node other than the root 'node.
  • the method is as described in claim 10
  • a unique node identifier is assigned to all nodes including the root node, and the node identifier assigned to each parent node of the non-root node is associated with the node identifier assigned to each non-root node, This represents the parent-child relationship between the nodes that make up the tree-type data structure,
  • Each node is associated with at least one entity information representing data
  • a partial tree is a group of nodes including a specific node of data of a tree-type data structure and descendant nodes of the specific node,
  • For each partial tree identify the node group belonging to the partial tree based on the parent-child relationship between the nodes, and determine whether there is a node associated with the entity information representing the target of aggregation in the node group. And, if present, a step of aggregating entity information associated with the node;
  • the partial tree can be sorted using the aggregation result.
  • at least two node groups of data of a tree-type data structure including a root 'node developed in a storage device and a non-root' node that is a node other than the root 'node are included. How to order
  • a unique node identifier is assigned to all nodes including the root node, and the node identifier assigned to each parent node of the non-root node is associated with the node identifier assigned to each non-root node, This represents the parent-child relationship between the nodes that make up the tree-type data structure,
  • Each node is associated with at least one entity information representing data
  • a partial tree is a group of nodes including a specific node of data of a tree-type data structure and descendant nodes of the specific node,
  • the node group belonging to the partial tree is identified through the parent-child relationship between the nodes, and the entity information associated with the node associated with the entity information as an index of ordering in the node group Step to get the
  • each entity information is item name information representing an item of data or item value information representing an item value of data.
  • a partial tree including a specific node and a descendant node of the specific node is defined by a node identifier of the specific node. expressed.
  • a partial tree can be represented by one vertex node. It becomes possible to describe the result of search and the target range of search and aggregation by this vertex node.
  • the unique node identifiers assigned to all nodes including the root 'node are more than nodes of the same generation. Is also given priority over child nodes.
  • the data of the tree-type data structure includes a plurality of tree data to which a tree identifier is assigned. This makes it possible to process multiple tree data as search, aggregation, and sort targets.
  • the information processing apparatus of the present invention has a storage device for storing data of a tree-type data structure including a non-root node that is a node other than a root node and a root 'node.
  • An information processing device for retrieving data stored in a storage device is described in claims 16 to 30.
  • Condition specifying means for specifying a search condition related to at least one entity information, and for each node, it is determined whether at least one entity information associated with the node matches the search condition.
  • a search means for associating search hit information with each other and associating search hit information with an ancestor node of the node based on a parent-child relationship between the nodes;
  • the partial tree is a group of nodes including a specific node of the tree-type data structure and descendant nodes of the specific node.
  • the condition specifying means includes means for specifying at least one partial tree representing the search range,
  • the search means identifies the partial tree containing the node with which the search hit information is associated Means for saving the child as a search result;
  • the information processing apparatus has a storage device that stores data of a tree-type data structure including a root 'node and a non-root' node that is a node other than the root 'node.
  • An information processing device that retrieves data stored in a storage device and assigns a unique node identifier to all nodes including the root node, giving priority to child nodes over nodes of the same generation.
  • 'Node identifier assigned to each of the nodes is associated with the node identifier assigned to each parent node of the non-root' node, thereby expressing the parent-child relationship between the nodes that make up the tree-type data structure.
  • a data expansion means for associating at least one entity information representing data with each other and constructing a tree-type data structure on the storage device;
  • a partial tree is a group of nodes including a specific node of a tree-type data structure and descendant nodes of the specific node, and specifies at least one sub-tree representing a search range by specifying a search condition for at least one entity information.
  • a search means for associating search hit information with a matched node For each partial tree, identify the node group belonging to the partial tree by determining the parent-child relationship between the nodes, determine whether at least one entity information associated with the node group matches the search condition, A search means for associating search hit information with a matched node;
  • An information processing apparatus includes a storage device that stores data of a tree-type data structure including a root 'node and a non-root' node that is a node other than the root 'node.
  • An information processing device for retrieving data stored in a device includes a storage device that stores data of a tree-type data structure including a root 'node and a non-root' node that is a node other than the root 'node.
  • All nodes including the root node are given a unique node identifier in preference to the child node over the same generation node, and the node identifier assigned to each non-root 'node is assigned to each non-root' node.
  • the parent-child relationship between the nodes that make up the tree-type data structure is expressed, and at least one entity information representing the data is associated with each node.
  • a partial tree is a specific node of a tree-type data structure and a descendant node of the specific node.
  • a condition specifying means for specifying a search condition related to at least one entity information and specifying at least one partial tree representing a search range;
  • search means for storing an identifier representing the partial tree as a search result when a matching node exists;
  • An information processing device includes a storage device that stores data of a tree-type data structure including a root 'node and a non-root' node that is a node other than the root 'node, An information processing device for retrieving data stored in a device,
  • a partial tree is a group of nodes including a specific node of a tree-type data structure and descendant nodes of the specific node, and specifies at least one sub-tree representing a search range by specifying a search condition for at least one entity information.
  • an ancestor node of the partial tree is identified by finding a parent-child relationship between the nodes, and at least one entity information associated with the specific node and Z or the ancestor node of the partial tree is searched.
  • the information processing device includes a storage device that stores data of a tree-type data structure including a root 'node and a non-root' node that is a node other than the root 'node.
  • An information processing device for retrieving data stored in a device includes a storage device that stores data of a tree-type data structure including a root 'node and a non-root' node that is a node other than the root 'node.
  • a node identifier given to each parent node of the non-root node by assigning a unique node identifier to all nodes including the root node, and a node identifier assigned to each non-root node Data expansion that associates identifiers, thereby expressing the parent-child relationship between the nodes that make up the tree-type data structure, associates at least one entity information representing data with each node, and builds the tree-type data structure on the storage device Means,
  • a partial tree is a group of nodes including a specific node of a tree-type data structure and descendant nodes of the specific node, and specifies at least one sub-tree representing a search range by specifying a search condition for at least one entity information.
  • an ancestor node of the partial tree is identified by finding a parent-child relationship between the nodes, and at least one entity information associated with the specific node and Z or the ancestor node of the partial tree is searched.
  • the information processing apparatus includes a storage device that stores data of a tree-type data structure including a root 'node and a non-root' node that is a node other than the root 'node, and the first search An information processing apparatus that performs a search by logically combining a condition and a second search condition,
  • the partial tree is a node group including a specific node of the tree-type data structure and a descendant node of the specific node, and a condition specifying means for specifying at least one partial tree representing a search range;
  • an identifier representing a partial tree to which a node that matches the first search condition belongs is obtained based on the parent-child relationship between the nodes. And matches the first search condition for the parent-child relationship between the nodes according to the second search condition that specifies at least one entity information.
  • An information processing apparatus includes a storage device that stores data of a tree-type data structure including a root 'node and a non-root' node that is a node other than the root 'node.
  • An information processing device that aggregates data stored in the device,
  • All nodes including the root node are given a unique node identifier in preference to the child node over the same generation node, and the node identifier assigned to each non-root 'node is assigned to each non-root' node.
  • the parent-child relationship between the nodes that make up the tree-type data structure is expressed, and at least one entity information representing the data is associated with each node.
  • Data expansion means for expanding the data on the storage device
  • a partial tree is a node group that includes a specific node of a tree-type data structure and descendant nodes of the specific node, specifies entity information that represents the aggregation target, and specifies at least one partial tree that represents the aggregation range
  • a condition designating means
  • For each partial tree identify the node group that belongs to the partial tree based on the parent-child relationship between the nodes, determine whether entity information representing the target of aggregation is associated with the node group, and exist And a counting means for counting the entity information associated with the node,
  • An information processing device includes a storage device that stores data of a tree-type data structure including a root 'node and a non-root' node that is a node other than the root 'node.
  • An information processing device that aggregates data stored in the device,
  • All nodes including the root node are given a unique node identifier in preference to the child node over the same generation node, and the node identifier assigned to each non-root 'node is assigned to each non-root' node.
  • the partial tree is a group of nodes including a specific node of a tree-type data structure and descendant nodes of the specific node, specifying entity information representing a classification target of aggregation, specifying entity information representing a target of aggregation, A condition specifying means for specifying at least one partial tree representing a range of aggregation;
  • an aggregation means that aggregates entity information associated with the node for each entity information representing an aggregation classification target related to the node group belonging to the partial tree;
  • the information processing apparatus includes a storage device that stores data of a tree-type data structure including a root 'node and a non-root' node that is a node other than the root 'node, and stores the data in the storage device.
  • An information processing device for ordering at least two nodes of the received data is a storage device that stores data of a tree-type data structure including a root 'node and a non-root' node that is a node other than the root 'node, and stores the data in the storage device.
  • All nodes including the root node are given a unique node identifier in preference to the child node over the same generation node, and the node identifier assigned to each non-root 'node is assigned to each non-root' node.
  • the parent-child relationship between the nodes that make up the tree-type data structure is expressed, and at least one entity information representing the data is associated with each node.
  • Data expansion means for expanding the data on the storage device
  • a partial tree is a node group that includes a specific node of data of a tree-type data structure and descendants of the specific node, specifies entity information that represents an aggregation target, and includes at least two partial trees that represent the scope of aggregation.
  • a group of nodes belonging to the partial tree is identified based on the parent-child relationship between the nodes, and entity information representing the aggregation target is associated with the node group.
  • Ordering means for ordering the at least two partial trees according to the order relation of the item value information aggregated for each partial tree
  • An information processing apparatus includes a storage device that stores data of a tree-type data structure including a root 'node and a non-root' node that is a node other than the root 'node.
  • An information processing device for ordering at least two nodes of data stored in the device,
  • All nodes including the root node are given a unique node identifier in preference to the child node over the same generation node, and the node identifier assigned to each non-root 'node is assigned to each non-root' node.
  • the parent-child relationship between the nodes that make up the tree-type data structure is expressed, and at least one entity information representing the data is associated with each node.
  • Data expansion means for expanding the data on the storage device
  • a partial tree is a group of nodes including a specific node of data of a tree-type data structure and descendant nodes of the specific node. At least two partial trees to be ordered are specified, and entity information serving as an index for ordering is specified.
  • the node group belonging to the partial tree is identified by determining the parent-child relationship between the nodes, and the node information associated with the entity information serving as an index for ordering is identified in the node group.
  • Ordering means for ordering the at least two partial trees according to the order relation of the item value information acquired for each partial tree
  • a program for executing the method according to 5 is provided.
  • the parent-child relationship between the nodes of the tree-type data structure is expressed based on the "child ⁇ parent" expression! This reduces the amount of memory that is accessed, enabling fast search, aggregation, and sorting.
  • FIG. 1 is a block diagram showing a hardware configuration of a computer system that searches, aggregates, and sorts data having a tree-type data structure useful for the embodiment of the present invention.
  • this computer system 10 has a configuration similar to that of a normal one, and a CPU 12 that controls the entire system and individual components by executing a program, a RAM that stores work data, etc. Random Access Memory) 14, ROM (Read Only Memory) for storing programs, etc. 16, Fixed storage medium such as hard disk 18, CD — ROM driver 20 for accessing ROM 19 — CD—ROM driver 20 and external network ( An interface (IZF) 22 provided between an external terminal (not shown) and an external terminal connected thereto, an input device 24 such as a keyboard and a mouse, and a CRT display device 26 are provided.
  • the CPU 12, RAM 14, ROM 16, external storage medium 18, I / F 22, input device 24, and display device 26 are connected to each other via a bus 28.
  • a program for searching, summing up, and sorting data of a tree-type data structure and a program for converting the tree-type data structure on a storage device according to the present embodiment are accommodated in a CD-ROM19. It may be read by the CD-ROM driver 20 or stored in the ROM 16 in advance. In addition, what is once read from the CD-ROM 19 may be stored in a predetermined area of the external storage medium 18. Alternatively, the program may be supplied with an external force via a network (not shown), an external terminal, and the IZF 22.
  • an information processing apparatus useful for the embodiment of the present invention is connected to the computer system 10. This is realized by running a program that searches, aggregates, and sorts data with a tree-type data structure.
  • FIG. 2A and 2B are explanatory diagrams of POS data, which is an example of tree format data
  • FIG. 2A is an example of a visual representation of the data structure (ie, topology) and data values of this tree format data.
  • Figure 2B shows an example of the same tree format data expressed in XML format.
  • the tree-type data structure is expressed by a combination of nodes and arcs starting from the root node (in this example, POS data) and branching at each node to the leaf node (end point).
  • the Each node is associated with item name information, that is, the node type, and item value information, that is, the value of the node.
  • This association can be realized, for example, by associating a node identifier with a pointer to a node information storage area in which information describing the node type and node value is stored.
  • the present invention is not limited by the way the actual values of the tree data structure are handled.
  • such a tree-type data structure is expressed by connecting nodes that store data with pointers.
  • the pointer representation has the disadvantage that the pointer value is not necessary. That is, in some cases, a specific node A is stored at a certain address (for example, address 100), and in other cases, the same node A is stored at another address (for example, address 200).
  • a pointer value that is not constant essentially represents the storage address of the node. So, for example, if nodes are connected with a pointer according to the depth-first rule, reconnect these nodes with a pointer according to the width-first rule. It is difficult to do.
  • An arc list is a list of arcs that represent parent-child relationships between nodes.
  • 3A to 3C are explanatory diagrams of an example of an expression format of a tree type data structure using an arc list.
  • Figure 3A shows the entire tree data structure.
  • FIG. 3A shows an arc list from a parent node (From—ID) to a child node (To—ID), and FIG. 3C shows a node list including a list of node ID / node type pairs. Note that there is no need for a node list for the purpose of simply representing a tree-type data structure. In principle, the relationship between nodes can be described directly without using pointers by using such an arc list.
  • the arc list is described based on a “parent ⁇ child” relationship in which a child node is associated with a parent node. Therefore, since there are three child nodes 10, 60, and 80 in one parent node, for example, root 'node 0, the same node ID 0 appears three times in the From—ID of the arc list. ing. In other words, since the child node cannot be specified even if the parent node is specified, the arc list is composed of the element From—ID array and the element To—ID array. When using an arc list, a node appears in both the From—ID array and the To—ID array.
  • the parent-child relationship can also be expressed by a “child ⁇ parent” relationship.
  • the parent-child relationship between the nodes is represented by an array of pairs of each of the non-root nodes that are nodes other than the root 'node and the associated parent node.
  • this “child ⁇ parent” relationship there is an important characteristic that cannot be obtained in the case of the “parent ⁇ child” relationship. That is, since only one parent node always corresponds to one child node, By identifying a child node, you can immediately identify the only parent node that corresponds to this child node. In other words, the arc list actually requires only an array of element To-IDs. As a result, the storage capacity for storing the arc list is reduced. This reduction in storage capacity has the effect of reducing the number of accesses to the memory, and as a result, high-speed processing can be realized.
  • FIGS. 4A to 4D are explanatory diagrams of a method for expressing a tree-type data structure based on the “child ⁇ parent” relationship.
  • 4A is an explanatory diagram of the entire tree
  • FIG. 4B is an arc list based on the “child ⁇ parent” relationship. Since the arc list in FIG. 4B includes a storage area of the parent node for the root node, “ ⁇ - ⁇ ” is set as the parent node of the root node for convenience. However, since there is no parent node corresponding to the root node, the storage area of the parent node for the root node may be excluded from the arc list based on the “child ⁇ parent” relationship, as shown in FIG. 4C. Absent.
  • the parent-child relationship between the nodes is expressed by associating the parent node of the non-root node with each non-root node that is a node other than the root node.
  • the tree topology can be expressed by obtaining a list of parent nodes from the child nodes expressed as “child ⁇ parent”.
  • a tree-type data structure based on such a "child-to-parent" relationship is routed to the computer system 10 shown in FIG. 1 as shown in FIG.
  • the parent-child relationship defining step 502 for associating the node identifier assigned to the parent node is executed on the RAM 14.
  • Node identifier power of child node The tree topology can be expressed by subtracting (lookup) the node identifier of the parent node.
  • the node definition step uses a numeric value as the node identifier, more preferably a consecutive integer, and even more preferably an integer sequence number from 0 or 1. to this Therefore, the node identifier of the parent node corresponding to the node can be easily obtained from the node identifier, so that the process of subtracting the node identifier of the parent node can be performed at high speed. You can do it.
  • a node with a tree-type data structure is given a number with an order as a node identifier to express a parent-child relationship between the nodes, by defining a rule in the order of number assignment, the subsequent tree-type data structure When handling becomes easy, there is an advantage.
  • a rule for assigning numbers a depth priority mode that prioritizes child nodes over nodes of the same generation and a width priority mode that prioritizes nodes of the same generation over child nodes are used.
  • FIGS. 6A to 6C are explanatory diagrams of processing for converting the tree structure type data in the ID format into the tree structure type data in the integer serial number format.
  • Figure 6A shows tree-structured data with each node assigned an ID number.
  • Fig. 6B shows the conversion rules
  • Fig. 6C shows the tree-structured data with integer numbers assigned to each node!
  • the conversion rule in this example is a rule that assigns serial numbers with depth priority. Specifically, when there are multiple child nodes, the minimum number is assigned to the first child (top brother) node. Assign a higher number to the youngest child (bottom brother) node, and give the child node a priority over the sibling node. In this example, the numbers may be numbered in descending order.
  • FIGS. 7A to 7C are explanatory diagrams of processing for converting the tree structure type data in the ID format into the tree structure type data in the integer serial number format.
  • Figure 7A shows tree-structured data with each node assigned an ID number.
  • FIG. 7B shows conversion rules
  • FIG. 7C shows tree-structured data in which integer sequential numbers are assigned to each node.
  • the conversion rule in this example is a rule that assigns a serial number with breadth priority. Specifically, if there are multiple child nodes, the minimum number is assigned to the first child (top brother) node, Assign a higher number to the youngest child (bottom brother) node, and give priority to the sibling node over the child node. In this example, numbering is performed in ascending order, but numbering may be performed in descending order.
  • the tree-type data structure based on depth priority as shown in Fig. 6C is stored in the computer system 10 shown in Fig. 1.
  • An array formed by arranging the integers assigned to each parent node of the non-root node in the order of the integers assigned to each of the non-root nodes that are nodes other than the root node is stored in the storage device.
  • nodes are assigned consecutive integers with depth priority, and the parent-child relationship between nodes is represented by an array of “child-to-parent” relationships.
  • FIG. 8 is a flowchart of node definition processing based on depth priority. This node definition process is performed by computer system 10.
  • step 802 for assigning the number next to the number assigned to that particular node to the child node; If there is more than one child node in a given node, the brother node is assigned the next number after all the descendant nodes of the immediately above brother node are numbered according to the sibling relationship between the child nodes.
  • Step 803 for assigning numbers from the top brother node to the bottom brother node so that
  • FIG. 9 is an explanatory diagram of an array of parent-child relationships based on the “child ⁇ parent” expression created from the depth-first tree-type data structure shown in FIG. 6C.
  • sub-tree 1 or sub-tree 2 if you represent the parent-child relationship of nodes assigned consecutive numbers with depth priority based on the “child-to-parent” relationship, the descendant nodes of a node When appears in a continuous region,! / ⁇ ⁇ excellent properties are obtained.
  • All the descendant nodes of the certain node can be specified by extracting a continuous area in which a value equal to or greater than an integer assigned to the node is stored.
  • a node group representing a descendant node of a certain node can be acquired as a continuous block in the array. For example, if the size of a continuous block is m, the processing speed for specifying all descendant nodes of a node is on the order of O (m).
  • FIG. 10 is an explanatory diagram of an array of parent-child relationships based on the created “parent ⁇ child” expression. Since there can be a plurality of child nodes for one parent node, the parent-child relationship array stores the child node number for each node, an array Aggr for indicating the area, and the child node number. It is composed of two arrays, P ⁇ C, in which the numbers of the nodes are stored.
  • the value of the second element Aggr [1] from the beginning of the array Aggr is "3", which means that the number of the child node for the node [1] is the element P ⁇ C of the array P ⁇ C [3] Indicates that it is stored after.
  • the node [0] that is, the child node for the root node is the three elements from the beginning of the array P ⁇ C, P ⁇ C [0] 1, P ⁇ C [1] 6, and P ⁇ C [2] is 8.
  • the Aggr value is also obtained for the numbering power of the parent node shown in bold in the figure. This Aggr value represents the starting point of the array P ⁇ C.
  • parent-child relationship based on the expression “parent ⁇ child” can be expressed more simply by two arrays: an array of parent node numbers and an array of corresponding child node numbers. Only However, in order to find a parent-child relationship using this array, the number of the parent node must be searched, that is, the access time of log (n) is required, so that the efficiency is low.
  • FIG. 7C Furthermore, a tree-type data structure based on breadth-first as shown in FIG. 7C is added to the computer system 10 shown in FIG.
  • a node definition step that gives priority to a node of the same generation over a child node and gives a unique continuous integer to a node including a root node;
  • the array formed by arranging the integers assigned to each parent node of the non-root 'node in the order of the integers assigned to each of the non-root' nodes that are nodes other than the root 'node.
  • nodes are given consecutive integers in the breadth-first mode, and the parent-child relationship between nodes is expressed by an array of “child ⁇ parent” relationships.
  • FIG. 11 is a flowchart of node definition processing based on width priority. This node definition process is performed by the computer system 10
  • First 1102 assigning a number to the root node
  • Step 1013 in which a unique integer continuously changing from the number next to the number assigned immediately before from the top brother node to the bottom brother node is assigned in order,
  • FIG. 12 shows “child ⁇ parent” created from the breadth-first tree data structure shown in FIG. 7C. It is explanatory drawing of the arrangement
  • the parent-child relationship of nodes assigned consecutive numbers with breadth priority is expressed based on the “child-to-parent” relationship
  • child nodes of a certain node appear in a continuous region. Excellent properties are obtained. This is because when the parent-child relationship of nodes assigned consecutive numbers in the breadth-first mode is expressed as an array based on the “child ⁇ parent” relationship, the numbers assigned to the parent nodes are ordered (ascending or descending) in the array. ) To appear in).
  • FIG. 13 is an explanatory diagram of an array of parent-child relationships based on the created “parent ⁇ child” expression, with the breadth-first tree type data structure shown in FIG. 7C.
  • Figure 13 Sece there can be multiple child nodes for one parent node, the parent-child relationship array contains an array Aggr to indicate the area where the child node number for each node is stored, Consists of two arrays P ⁇ C that store numbers.
  • the value of the second element Aggr [1] from the beginning of the array Aggr is "3", which means that the child node number for the node [1] is the element P ⁇ C [3] of the array P ⁇ C It is stored after that !.
  • the child node for node [0] that is, the root 'node is the three elements from the beginning of the array P ⁇ C, P ⁇ C [0] 1, P ⁇ C [1] 2, and P ⁇ C [2] is 3.
  • the Aggr value is also obtained for the numbering power of the parent node shown in bold in the figure. This Aggr value represents the starting point of the array P ⁇ C.
  • the depth priority mode and the width priority mode for assigning sequential numbers to nodes each have unique and excellent properties.
  • one tree-type data structure can be expressed in any of the “child ⁇ parent” representation format based on depth priority, the “child ⁇ parent” representation format based on width priority, and the “parent ⁇ child” representation format. Is possible. Therefore, it should be noted that the “child ⁇ parent” representation format based on depth priority, the “child ⁇ parent” representation format based on breadth priority, and the “parent ⁇ child” representation format are interchangeable as appropriate. is there.
  • a specific part of the entire tree data may be a processing target, for example, a search target range.
  • the inventor has proposed a method for improving the efficiency of various processes by introducing a single node that represents a specific part including a plurality of nodes. Next, this method will be described in detail.
  • the value of the node closest to the root 'node is used to represent the node and all the nodes that branch from that node up to the leaf' node (endpoint). think of.
  • a node group from a certain node and its node force to a leaf 'node is called a partial tree.
  • the node closest to the above node (root node) is called the vertex node.
  • FIG. 14A is a diagram showing a tree-type data structure based on the above-described breadth-first mode
  • FIG. 14B is a diagram showing an array of a parent-child relationship based on the tree-type data structure based on the expression “child ⁇ parent”.
  • vertex node [4] contains node identifier ⁇ 4, 8, 9 ⁇
  • vertex node [6] contains node identifier ⁇ 6 ⁇
  • vertex node [3] contains node identifier Includes ⁇ 3, 7, 10, 11 ⁇ .
  • Such an array composed of a plurality of vertex nodes is referred to as a vertex node list.
  • a plurality of partial trees can be specified by the vertex node list, and the plurality of specified partial trees are called a partial tree group.
  • the vertex node list is represented as [a, b,.
  • “a”, “,”,... are node identifiers corresponding to the vertex nodes.
  • each vertex node constituting the vertex node list is expanded and node identifiers of all nodes included in the partial tree having the vertex node as a vertex are obtained.
  • a partial tree group is referred to as a “regular partial tree group”.
  • Such a partial tree group is called “non-normal subtree group”.
  • a partial tree group can be converted into a normal partial tree group, and this process is referred to as “normalization”. Normalization is important for efficient execution of set operations.
  • every node belongs to at most one vertex node, so the list of vertex nodes to which each node belongs should be described as an array of size equal to the number of vertex nodes at most. Can do. For this reason, in the normalized state, set operations represented by logical products and logical sums can be performed efficiently.
  • a partial tree group including a vertex node and its descendant nodes can be specified by the vertex node list.
  • the vertex node list [4, 6, 3] can be used to create a partial tree group (partial trees ⁇ 4, 8, 9 ⁇ , ⁇ 6 ⁇ , ⁇ 3, 7, 10, 11 ⁇ ) is specified.
  • the partial tree group specified by the vertex node list can be a target of search, aggregation, sorting, and set operation.
  • FIG. 16A is a vertex node list representing this partial tree group.
  • an array 1701 is a vertex node list
  • an array 1702 is an array indicating the number of nodes belonging to the partial tree specified by each vertex node.
  • an array 1801 is a sorted vertex node list
  • an array 1802 is an array indicating the number of nodes belonging to the partial tree specified by the vertex node list.
  • Figure 1 8B shows a state where the partial tree is sorted according to the number of nodes.
  • a logical product will be described as a set operation between a plurality of partial tree groups.
  • the partial tree group shown in FIG. 19B (the corresponding vertex node list is shown in FIG. 19A) and the partial tree group shown in FIG. 19D (the corresponding vertex node list is shown in FIG. 19C).
  • the logical product is described as a set operation between a plurality of partial tree groups.
  • FIG. 19B compares the partial tree 1901 identified by the vertex node with the node identifier “4” and the partial tree 1 911 identified by the vertex node identifier with the node identifier “1” in FIG. 19D. Then, the partial tree 1901 is included in the partial tree 1902. A partial tree that has an inclusive relationship with the partial tree 1902 in FIG. 19B does not exist in the partial tree group shown in FIG. 19D. Also, comparing the partial tree 1903 identified by the vertex node of the node identifier “3” in FIG. 19B with the partial tree 1913 identified by the node identifier “7” in FIG. 19D, the partial tree 1913 is , Included in the partial tree 1903. As a result, the vertex node list indicating the result of the logical product operation is [4, 7] as shown in Fig. 20A. FIG. 20B shows a partial tree group corresponding to the result of the logical product operation.
  • the vertex node list (in addition to this, an array storing the aggregation results (number of nodes) of the same size as the vertex node list) Can represent the result of each process or operation.
  • the logical product of the two normal partial tree groups becomes the normal partial tree group 2202.
  • the normal subtree group 2202 includes the normal subtree group 2201 (see FIG. 22C)
  • the logical product of the two normal subtree groups becomes the normal subtree group 2201.
  • both normal subtree groups do not have an inclusive relationship, the logical product between them becomes an empty set.
  • FIG. 23 is a flowchart showing processing executed by the system during the logical product operation.
  • a marking array is generated for each normal subtree group to be subjected to the AND operation (step 2301).
  • the marking array is equivalent to the flag array and the affiliated node array generated by normalization. That is, the marking arrangement can be obtained by performing the same processing as the first method and the second method of normalization calculation.
  • the system 10 compares the corresponding values of both marking sequences (steps). 2302). More specifically, the system 10 initializes pointers for identifying corresponding values in the two marking arrays (step 2311), and retrieves both values of the marking arrays indicated by the pointers (step 2312). Both values or one value force If the initial value is “ ⁇ 1” (No in step 2313), the system 10 indicates that the pointer does not point to the end of the array, otherwise (no in step 2315). (No)), move the pointer (step 2316), and return to step 2312.
  • both values of the marking array are values other than the initial value "1" (Yes in step 2 312), the larger value power storage address of the marking array values, That is, it is determined whether or not it is equal to the corresponding node identifier (step 2313). If it is determined YES in step 2133, the system 10 stores the matching value in the vertex node array as the value of the vertex node array indicating the result of the logical AND operation (step 2314). Thereafter, if the pointer does not point to the end of the array (No in step 2315), the pointer is moved (step 2316), and the process returns to step 2312.
  • step 2312 If it is determined NO in step 2312 and the pointer does not point to the end of the array (NO in step 2315), the pointer is moved (step 2316). Return to.
  • FIG. 24 shows a state where the marking sequences of the normal subtree group [3, 6] and the normal subtree group [2, 7] are generated.
  • the reference numeral 2401 indicates the marking array (first marking array) of the normal subtree group [3, 6], and the marking arrangement (second second) of the normal subtree group [2, 7]. Marking array)
  • the logical OR operation can be described as follows.
  • A, ⁇ , C, and D be normal subtree groups, respectively.
  • the normal subtree group can be represented by a vertex node list.
  • (Expression 1) is expressed by two vertex node lists (a vertex node list indicating the logical product operation result of A and C, and a vertex node indicating the logical sum operation result of B and D) List) and the operator "subtraction" between them.
  • it should be represented by the four vertex node lists of the regular subtree groups A to C and the operators between them, but can be represented by the two vertex lists and the operators between them.
  • the vertex node list of the reduced number and the vertex node list of the reduced number (excluded vertex node list) ).
  • negation (NOT) of normal subtree groups can be expressed as an excluded vertex node list.
  • ⁇ Aj (A is a normal subtree group) is the negation of all node force normal subtree groups A except for the vertex nodes listed in the excluded vertex node list and their descendant nodes.
  • exclusive OR can also be expressed by a vertex node list and an excluded vertex node list.
  • Tree data search has two aspects: path search and node stored value search.
  • the search of the path is to extract a node satisfying the path condition of, for example, 7shop / shopName in FIGS. 2A and 2B.
  • a general tree data search is a combination of a path search and a node stored value search.
  • a general tree data search is a search using an AND condition that satisfies the path condition and the node storage value condition at the same time. It is possible to determine whether or not a certain vertex node force satisfies the AND condition by examining the path condition and examining the condition of the node storage value of the node that satisfies the path condition.
  • the search by specifying the AND condition can be realized by executing an AND (logical product) operation of the search result set by the path condition and the search result set by the node storage value condition.
  • the tree data search is not limited to the search by specifying the AND condition of the above path condition and node stored value condition.
  • This search by specifying the OR condition can be realized by executing an OR (logical sum) operation on the search result set by the path condition and the search result set by the node storage value condition.
  • node item name information for example, node type
  • node item value information for example, node value
  • Entity information is used.
  • these entity information may be specified by following a node identifier with a pointer to a node information storage area in which information describing the node type and node value is stored. it can.
  • the node information storage area can be configured to store only the node value.
  • FIGS. 27A and 27B are explanatory diagrams of a tree-type data structure to be searched according to a path condition of descendants according to an embodiment of the present invention and a “child ⁇ parent” expression of a parent-child relationship of nodes.
  • the node type that is the item name information of each node is represented by a symbol number.
  • FIG. 27A the node identifier (for example, the node number) of each node is displayed together with a graphic corresponding to the symbol number of that node. Has been. For example, the root 'node is a round symbol. The vertex nodes are indicated by black stars ( ⁇ ).
  • FIG. 27B is a diagram showing the correspondence between symbol numbers, display figures, and symbol names.
  • node extraction is performed using a condition of a descendant node of a vertex node as a search condition. More specifically, vertex nodes including button-type nodes as descendant nodes are extracted.
  • Method 1 is a method that checks in the order of the head force of the expression “child ⁇ parent”, and is effective when the number of vertex nodes is large.
  • method 2 is effective when the number of vertex nodes is small, since the parent power is checked in order starting from the vertex nodes.
  • Method 1 and Method 2 may be selectively performed.
  • a computer system that executes a path condition search method 1 according to an embodiment of the present invention
  • tree-type data structure data including a root 'node and a non-root' node that is a node other than the root 'node is expanded in 10 RAMs 14. More specifically, a node number that is a unique node identifier is assigned to all nodes including the root 'node, and the node identifier assigned to each non-root' node is assigned to each parent node of the non-root 'node.
  • each node is associated with a node type (or symbol number) that is item name information and a node value that is item value information.
  • the computer system 10 determines whether or not the node type associated with the node matches the button type, and if it matches, the search hit information is associated with the node.
  • the search hit information is associated with the ancestor node of the relevant node through the parent-child relationship in the form of “child ⁇ parent”.
  • the search hit information can be associated with the node identifier by preparing a flag information area corresponding to each node identifier and setting the flag information when the search hits, for example.
  • FIG. 28 is a flowchart of a tree search method based on descendant path conditions that is useful in an embodiment of the present invention.
  • FIGS. 29A to 33C are diagrams for explaining the operation state of the tree search method based on the descendant path conditions according to an embodiment of the present invention.
  • the system 10 initializes a flag area Flag and initializes a symbol number read address (step 2801).
  • the flag area is initialized with the value 0
  • the symbol number read address is initialized with the leading address 0, and the symbol number (Symbol 1)
  • step 2802 the symbol number (Symbol No.) corresponding to this symbol number reading address (step 2802) and checks whether this symbol number is 1 (step 2803).
  • the pointer indicating the check location is indicated by a thick arrow. Since the symbol number corresponding to the start address 0 is 2, the check result in step 2803 is No, and if the next address is checked (step 2808), the next address 1 exists ( (Yes), move the symbol number read address to the next address 1 (step 2805) and return to step 2802.
  • steps 2802, 2803, 2804, and 2805 are repeated until the read symbol number matches 1 or the next symbol number read address is exhausted.
  • the symbol number does not match 1 until f, dress 0 force and address 6 in this f row.
  • Figure 29C when the symbol number read address advances to 7, the symbol number matches 1 (step 2803)
  • the system 10 finds a symbol number matching 1 in step 2803 (Yes), it marks the flag of the node at the address 7 found as shown in Figure 3 OA (step 28 06), Using the parent-child relationship expression C ⁇ P, the address of the parent node of address 7, that is, address 6, is found, and the target node is moved to the parent node (step 2807).
  • the node at address 7 is referred to as node 7 and the node at address n is generally referred to as node n.
  • the system 10 checks whether the destination parent node 6 is marked (step 2808), because the flag of node 6 is not marked (No).
  • step 2809 mark the flag of parent node 6 (step 2809), and return to step 2807 to check whether there is a parent node.
  • node 6's parent node is node 0, and the flag for node 0 is not marked (step 2808, No), so mark the flag for node 0 (step 2809) If it is checked whether there is a parent node (step 2807), the parent node does not exist (No), and the system 10 proceeds to step 2804.
  • the system 10 moves the symbol number read address to the next address 8 as shown in Fig. 31A (step 2805), and the read symbol number is 1 as shown in Fig. 31B. Until the next symbol number read address is exhausted. Repeat steps 2802, 2803, 2804, and 2805. As shown in FIG. 31C, the symbol number matches 1 when it reaches the readout address 11 (step 2803).
  • step 2806 Since the system 10 finds the symbol number matching 1 in step 2803 (Yes), it marks the flag of the found node 11 (step 2806) as shown in Fig. 32A, and displays the parent-child relationship expression. Use C ⁇ P to move to node 9 which is the parent node of node 11 (step 2807).
  • the system 10 checks whether the destination parent node 9 is marked (step 2808), because the flag for node 9 is not marked (No). Then, mark the flag of node 9 (step 2809), and return to step 2807 to check if there is a parent node.
  • the parent node of node 9 is node 8
  • the flag for node 8 is not marked (No)
  • the node 8 flag is marked (step 2809), and the parent node is Return to step 2807 to see if it exists.
  • the parent node of node 8 is node 0, and as shown in Figure 32D, if node 0 is already marked (step 2 808), it is already marked (Yes), so go to step 2804 move on. If it is checked whether there is an address next to the current symbol number read address 11 (Step 2 804), since there are no more addresses (No), marking ends.
  • the result of the flag area can be used as it is as a result of the exhaustive search of nodes.
  • the system 10 sets each vertex node in the vertex node list after marking. Check if the flag is marked! /, And store the marked vertex node as! / In the vertex node list after the search.
  • vertex node 1 has a corresponding flag of 0, so the partial tree with node 1 as the vertex does not contain a button-type node, but vertex node 6 is shown in Fig. 33B.
  • the corresponding flag is 1 (ie, marked)
  • the partial tree with node 6 at the top contains a button-type node.
  • the vertex node 8 is also the top node of the partial tree including the button type node. Therefore, as shown in FIG. 33C, a vertex node list including the vertex nodes 6 and 8 is generated as a search result.
  • a vertex node list including the vertex nodes 6 and 8 is generated as a search result.
  • the initial value may be a force other than 0, with 0 being the initial value.
  • the integer used for marking is not limited to the smallest integer as long as it is unused.
  • the path condition search method 2 includes data of a tree-type data structure including a non-root node that is a node other than the root node and the root node. Has been expanded.
  • the parent-child relationship between the nodes that make up the tree-type data structure is constructed in an expression format with depth-first “child ⁇ parent”.
  • descendant nodes of a certain node appear in a continuous region. Take advantage of superior properties.
  • Each node is associated with a node type (or symbol number) that is item name information and a node value that is item value information, for example, as shown in FIG.
  • system 10 displays the search scope.
  • a vertex node list [1, 6, 8] including vertex nodes 1, 6, and 8 is specified.
  • This search condition and search range may be input by the user via the input device 24 of the computer system 10 or read from the external storage medium 18 or set by external force via the IZF 22, for example. May be.
  • the vertex node is a node representing a node group including a specific node of the tree-type data structure and descendant nodes of the specific node.
  • the computer system 10 identifies the descendant node of the vertex node using the parent-child relationship between the nodes, and associates it with the vertex node and Z or the descendant node of the vertex node. It is determined whether or not the given node type matches the button type. If there is a matching node, the node identifier assigned to the vertex node is saved as the search result.
  • FIG. 34 is a flowchart of a tree search method based on descendant path conditions that is useful in an embodiment of the present invention.
  • FIGS. 35A to 37C are diagrams for explaining the operation state of the tree search method based on the path conditions of the descendants according to the embodiment of the present invention.
  • the system 10 initializes a pointer indicating an address for reading a vertex node from the vertex node list with the top address of the vertex node list (step 3401).
  • First vertex node 1 is extracted from (step 3402).
  • the system 10 identifies the descendant node of the top node 1 by referring to the expression of the parent-child relationship by depth-first “child ⁇ parent” (step 3403).
  • the expression of the parent-child relationship by depth-first “child ⁇ parent” has the above-mentioned excellent properties! /. Therefore, a descendant node of a specific node has a node identifier assigned to this specific node.
  • a value greater than the value of the node identifier assigned to the specific node is stored from the next position after the stored position, and can be specified by extracting the continuous area.
  • C ⁇ P a continuous area from the next position where the node identifier 0 assigned to the node 1 is stored to the position where the value of the node identifier 1 of the node 1 is stored, That is, it is the range of descendant nodes of the region power S node 1 in which the node identifiers 1, 2, 2, 1 are stored. Since this area stores the node identifiers assigned to Node 2, Node 3, Node 4, and Node 5, the descendant nodes of Node 1 are Node 2, Node 3, Node 4, and Node 5.
  • the system 10 checks whether or not a node that matches the search condition, that is, a node whose node type is a button type exists among the identified descendant nodes (step 3404).
  • a node that matches the search condition that is, a node whose node type is a button type exists among the identified descendant nodes.
  • a node that matches the search condition that is, a node whose node type is a button type exists among the identified descendant nodes.
  • a node that matches the search condition that is, a node whose node type is a button type exists among the identified descendant nodes.
  • a node that matches the search condition that is, a node whose node type is a button type exists among the identified descendant nodes.
  • the system 10 proceeds to step 3405.
  • the system 10 moves the pointer to the vertex node 6 (Step 3406) and returns to Step 3402.
  • the system 10 extracts the vertex node 6 from the vertex node list (step 3402), and uses it as the descendant node of the vertex node 6 by using the method for identifying the descendant node described above. Node 7 is identified (step 3403). Subsequently, as shown in FIG. 36B, the system 10 checks whether the node type of the descendant node 7 is a button type (step 3404), and determines that the descendant node 7 meets the search condition. (Yes). Therefore, as shown in FIG. 36C, the system 10 registers the vertex node 6 in the post-search vertex node list that is the search result (step 3407), and proceeds to step 3405.
  • Step 3405 since the next vertex node 8 exists in the vertex node list (Yes in Step 3405), the system 10 moves the pointer to the vertex node 6 (Step 3406) and returns to Step 3402. .
  • the system 10 extracts the vertex node 8 from the vertex node list (step 3402), and uses it as the descendant node of the vertex node 8 by using the method for identifying the descendant node described above. Node 9, node 10, and node 11 are identified (step 3403). Subsequently, as shown in FIG. 37B, the system 10 checks whether the node type is a button type among the descendant nodes (step 3404), and determines that the descendant node 11 meets the search condition. (Yes). Therefore, as shown in FIG.
  • the system 10 registers the vertex node 8 in the post-search vertex node list that is the search result (step 3407), and proceeds to step 3405. In this example, since the next vertex node does not exist in the vertex node list, the system 10 ends the search process.
  • the vertex node list [6, 8] after the search is obtained.
  • the power to identify all descendant nodes For example, limit the number of generations of descendants, for example, up to child nodes and grandchild nodes. By doing so, it is possible to limit the search range.
  • the vertex node list is generated as a search result.
  • a flag area as described with reference to FIGS. 29A to 29C is prepared, and all the hits in the search condition are prepared. It is also possible to generate a node identifier of a descendant node as a search result.
  • the search by the ancestor path condition is a process of extracting a vertex node having a node having a specified node type as an ancestor node.
  • 38A to 38C are explanatory diagrams of a tree-type data structure to be searched by the path condition and a “child ⁇ parent” expression of a parent-child relationship of nodes.
  • the vertex nodes are node 2, node 7, and node 9, and the vertex nodes are indicated by black stars ( ⁇ ).
  • the correspondence between the symbol number, display figure, and symbol name is as described for FIG. 27B.
  • node extraction is performed using the condition of the ancestor node of the vertex node as the search condition. More specifically, a vertex node including a heart-type node as an ancestor node is extracted.
  • each node is associated with a node type (or symbol number) that is item name information and a node value that is item value information.
  • the system 10 sets up at least one subtree that represents the search scope.
  • a vertex node list [2, 7, 9] including vertex nodes 2, 7, and 9 is specified.
  • This search condition and search range may be input by the user via the input device 24 of the computer system 10 or read from the external storage medium 18 or set by external force via the IZF 22, for example. May be.
  • the vertex node is a node representing a node group including a specific node of the tree-type data structure and descendant nodes of the specific node.
  • the computer system 10 specifies, for each vertex node, an ancestor node of the vertex node based on the parent-child relationship between the nodes, and at least one associated with the vertex node or the ancestor node of the vertex node. It is determined whether or not the entity information matches the search condition. If there is a matching node, the node identifier assigned to the vertex node is stored as a search result.
  • FIG. 39 is a flowchart of a tree search method based on an ancestor path condition that is useful in an embodiment of the present invention.
  • FIG. 40A to FIG. 42C are diagrams for explaining the operation state of the tree search method based on an ancestor path condition that is useful in one embodiment of the present invention.
  • the system 10 initializes a pointer indicating an address for reading a vertex node from the vertex node list with the top address of the vertex node list (step 3901).
  • First vertex node 2 is extracted from (step 3902).
  • the system 10 reads the symbol number (Symbol No.) corresponding to this vertex node 2 (step 3903) and checks whether this symbol number is 3 (step 3904). Since the symbol number of vertex node 2 is not 3 (No), system 10 goes to step 3 905, where the parent node of vertex node 2 is In this case, as shown in FIG. 40B, since the parent node 1 exists (Yes), the system 10 reads the symbol number corresponding to the parent node 1 (step 3906).
  • step 3907, No Since the symbol number associated with node 1 is 5 and does not meet the search criteria (step 3907, No), system 10 returns to step 3905 and checks whether the parent node of node 1 exists. In this case, as shown in FIG. 40C, parent node 0 of node 1 exists (Yes), and system 10 reads the symbol number corresponding to node 0 (step 3906). Since the symbol number associated with node 0 is 2 and does not match the search condition (step 3907, No), system 10 returns to step 3905 and checks whether the parent node of node 0 exists. Since node 0 is the root node and there is no parent node (No), system 10 proceeds to step 3909.
  • the system 10 Since the next vertex node 7 exists in the vertex node list, as shown in Fig. 41A, the system 10 sets a pointer indicating an address for reading the vertex node from the vertex node list. To the next address (step 3910) The th vertex node 7 is extracted (step 3902). Next, the system 10 reads the symbol number corresponding to the vertex node 7 (step 3903), and checks whether this symbol number is 3 (step 3904). Since the symbol number of vertex node 7 is not 3 (No), system 10 proceeds to step 3905, and the parent node of vertex node 7 is determined by referring to the expression of parent-child relationship by depth-first “child ⁇ parent”. In this case, as shown in FIG.
  • step 3906 since the symbol number associated with node 6 is 3 and matches the search criteria (step 3907, Yes), system 10 proceeds to step 3908 and the vertex pointed to by the current pointer as shown in Figure 41C Node 7 is registered as a search result in the vertex node list after the search. Since vertex node 7 has been registered, there is no need to visit the parent node any more, so system 10 proceeds to step 3909.
  • the system 10 Since the next vertex node 9 exists in the vertex node list, the system 10 sets a pointer indicating the address for reading the vertex node from the vertex node list, as shown in FIG. 42A. Move to the address (step 3910) and take the third vertex node 9 from the vertex node list (step 3902). Next, the system 10 reads the symbol number corresponding to this vertex node 9 (step 3903), and checks whether this symbol number is 3 (step 3904). Since the symbol number of vertex node 9 is not 3 (No), system 10 proceeds to step 3905, and the parent node of vertex node 9 is determined by referring to the expression of parent-child relationship by depth-first “child ⁇ parent”. In this case, as shown in FIG.
  • step 3906 since the parent node 8 exists (Yes), the system 10 reads the symbol number corresponding to the parent node 8 (step 3906). Since the symbol number associated with node 8 is 3 and matches the search criteria (step 3907, Yes), system 10 proceeds to step 3908 and, as shown in Figure 42C, the vertex pointed to by the current pointer Node 9 is registered as a search result in the vertex node list after the search. Since vertex node 9 has been registered, there is no need to visit the parent node any more, so system 10 proceeds to step 3909. Since the next vertex node does not exist in the vertex node list (step 3909, No), the system 10 ends the search process. [0161] Through the above search processing, the post-search vertex node list [7, 9] is obtained.
  • the vertex node list is generated as a search result.
  • a flag area as described with reference to FIGS. 29A to 29C is prepared, and all the hits in the search condition are prepared. It is also possible to generate a node identifier of a descendant node as a search result.
  • a search based on a value condition is a process of extracting a node associated with specified item value information (for example, a node value). For example, as shown in FIG. 26, item name information (for example, node type) and item value information (for example, node value) are associated with the node in the same way, so that it depends on the path condition. It is clear that the search, that is, the search algorithm based on the node type, can be applied to the search based on the value condition, that is, the search based on the node value.
  • all nodes may be associated with the same node type.
  • there is no need to associate a node type with each node so only the node value is associated with the node, and only a search based on the value condition is performed.
  • the actual value of a node is only a separated token string, so this character is included in the node. Only the columns are associated and no node type is used.
  • the result of the search can be expressed by this vertex node list, that is, the vertex node list.
  • the first search condition and the second search condition are represented by the first vertex node list and the second vertex node list, respectively. think of.
  • the first search condition and A vertex node list representing a search result that satisfies both of the second search conditions is obtained.
  • search condition 3 “vertex node in which button type nodes and deformed square type nodes exist in descendants” is searched.
  • a search result using a logical product of a plurality of search conditions as a search condition is obtained by a logical product operation of the vertex node list of the search result based on each search condition.
  • the search result using the logical sum of multiple search conditions as the search condition is calculated by the logical sum operation of the vertex node list of the search result by each search condition. can get.
  • tree data is aggregated by classifying item value information associated with a range of nodes in the tree for each item name information.
  • Aggregation includes various processes such as counting the number of item value information that is a measure of aggregation, or calculating the total value, average value, maximum value, minimum value, and the like.
  • the measure to be aggregated is, for example, a node value corresponding to a specific node type associated with the node.
  • the range of aggregation is, for example, a partial tree group, and can be specified by a vertex node list of the partial tree, that is, a vertex node list.
  • the dimension that is the classification target for aggregation is a specific node associated with the node.
  • the node value corresponding to the type is
  • FIGS. 43A and 43B are diagrams for explaining the aggregation useful for one embodiment of the present invention.
  • FIG. 43A shows a “child ⁇ parent” relationship between the tree-type data structure to be aggregated and the parent-child relationship of nodes.
  • FIG. 43B is a diagram showing the correspondence between symbol numbers, display figures, and symbol names. Two types of tree data aggregation will be described with reference to the examples shown in Figs. 43A and B.
  • the first tree data aggregation is, for example, to calculate the number of weights (measures) and the total for each manufacturer name (dimension).
  • the vertex node list [1, 6, 8] is used to specify the range of aggregation.
  • the range of aggregation may be the whole tree.
  • / Is specified by specifying a dimension.
  • a dimension is not specified, that is, the aggregation, that is, the second tree data aggregation is also conceivable.
  • a vertex node list can be specified and measures can be aggregated for each vertex node.
  • the second tree data aggregation is a type of aggregation that explicitly specifies this vertex node, ie, the partial tree. In the example of FIGS.
  • the tree-type data structure data includes a storage device of the computer system 10 that includes a root 'node and a non-root' node that is a node other than the root 'node, and performs aggregation. For example, it is expanded in RAM14.
  • the parent-child relationship between nodes gives a unique node identifier to all nodes including the root node, giving priority to the child node over the node of the same generation, and not to the node identifier given to each of the non-root nodes. It is defined by associating the node identifier assigned to each parent node of the root node.
  • Each node is associated with at least one entity information representing data.
  • the vertex node is a node representing a node group including a specific node of the tree-type data structure and descendant nodes of the specific node.
  • the computer system 10 designates item name information representing the classification target, designates item name information representing the aggregation target, and designates at least one partial tree representing the scope of the aggregation.
  • the classification target, the aggregation target, and the aggregation range may be input by the user via the input device 24 of the computer system 10 or read from the external storage medium 18, for example. An external force may also be set via the IZF22.
  • the computer system 10 identifies, for each vertex node, the descendant node of the vertex node based on the parent-child relationship between the nodes, and the item associated with the vertex node or the descendant node of the vertex node. Determine whether the name information matches the item name information that represents the target of aggregation, and the item value information associated with the matched node is the classification target related to the node group represented by the vertex node. It is counted for each item value information associated with the item name information that represents.
  • a vertex node list, a dimension, and a measure are specified, and the dimension values and measures existing in the nodes in the range specified by the vertex node list are aggregated.
  • a vertex node ie, a partial tree
  • FIG. 43A With reference to the example shown in Fig. 43A, the relationship between dimensions and aggregation feasibility will be described in detail.
  • 4A to 4D are explanatory diagrams of the partial tree represented by each vertex node in FIG. 43A.
  • the aggregation to calculate the number of weights (measures) and the total for each manufacturer name (dimension).
  • FIG. 44A represents the partial tree 1 represented by the vertex node 1, and the manufacturer name which is a dimension is associated with the two nodes of the node 2 and the node 5, so that the association is made with the node 1 and the node 3. It cannot be specified to which maker name the given weight belongs. Therefore, do not count against partial tree 1.
  • FIG. 44B represents the partial tree 2 represented by the vertex node 6.
  • this partial 1 there is no node associated with the manufacturer name that is a dimension, but it is a measure.
  • the dimension value is assumed to be a null value and aggregation is performed.
  • FIG. 44C represents the partial tree 3 represented by the vertex node 8.
  • this partial list 3 there are a node 10 associated with a manufacturer name as a dimension, and a node 9 and a node 11 associated with a weight as a measure.
  • a node 10 associated with a manufacturer name as a dimension
  • a node 9 and a node 11 associated with a weight as a measure.
  • FIG. 45 is a flowchart of a first tree data totaling method useful for one embodiment of the present invention.
  • FIGS. 46 to 48 are diagrams for explaining the operating state of the first tree data tabulation method useful in one embodiment of the present invention.
  • the system 10 first initializes a pointer indicating the address for reading the vertex node from the vertex node list with the top address of the vertex node list (step 4501).
  • the first vertex node 1 is extracted from the vertex node list (step 4502).
  • the system 10 specifies the partial tree of the vertex node 1 with reference to the expression of the parent-child relationship by depth-first “child ⁇ parent” (step 4504).
  • the expression of the parent-child relationship by depth-first “child ⁇ parent” has the above-mentioned excellent properties, so that the partial tree stores the node identifier assigned to the vertex node.
  • a continuous area in which the value equal to or greater than the value of the node identifier assigned to this vertex node is extracted from the next position In this example, in C ⁇ P, a continuous area from the position where the node identifier 0 assigned to the node 1 is stored to the position where the value of the node identifier 1 of the node 1 is stored, that is, Node identifiers 0, 1, 2, 2, 1 are stored Is a partial tree represented by vertex node 1. Since this area stores the node identifiers assigned to Node 1, Node 2, Node 3, Node 4, and Node 5, the partial tree consists of Node 1, Node 2, Node 3, and Node 4. And node 5 (* 1 in Figure 46).
  • node 1's node type is weight
  • node 2's node type is manufacturer
  • node 3's node type is weight
  • node 4's node type is price
  • node 5's node The type is a mail name (* 2 in Figure 46).
  • System 10 determines if the number power of the measure is ⁇ (step 450
  • step 4506 Demonstrate that the number of measures is not 0 (No), and then determine whether the number of dimensions is 2 or more (step 4506). Since the number of dimensions is 2 or more (Yes) and this partial tree is not subject to aggregation, the system 10 determines whether the next vertex node exists (step 4511). In this example, since the next vertex node 6 exists in the vertex node list (Yes), the system 10 moves the pointer to the vertex node 6 (step 45 12) and returns to step 4502.
  • the system 10 extracts the vertex node 6 from the vertex node list (step 4502), and the partial node represented by the vertex node 6 in the same manner as described above.
  • the tree is identified (step 4503), it can be seen that node 6 and node 7 belong to this partial tree (* 1 in Fig. 47).
  • the node type of node 6 is the price
  • the node type of node 7 is the weight (* 2 in Figure 47).
  • system 10 determines whether the number of measures is SO (step 4505), it knows that the number of measures is not zero (No), and then whether the number of dimensions is two or more. (Step 45
  • Step 4507 If the number of dimensions is not two or more (No) and it is determined whether the number of dimensions is 1 (Step 4507), the number of dimensions is not 1 (No), so the dimension value is set to the null value. Deemed (step 4508), aggregate measures (step 4510). In this example, the weight of the partial tree represented by vertex node 6 is 1, and the total weight is the value of the node value associated with node 7 (not shown). In addition, system 10 determines whether there is a next vertex node (step 4511). In this example, since the next vertex node 8 exists in the vertex node list (Yes), the system 10 moves the pointer to the vertex node 8 (step 4512) and returns to step 4502.
  • the system 10 extracts the vertex node 8 from the vertex node list (step 4502), and the partial node represented by the vertex node 8 in the same manner as described above.
  • the tree is identified (step 4503), it can be seen that node 8, node 9, node 10, and node 11 belong to this partial tree (* 1 in Fig. 48).
  • the node type of node 8 is the price
  • the node type of node 9 is the weight
  • the node type of node 10 is the manufacturer name
  • the node type of node 11 is the weight (* 2 in Figure 48) ).
  • system 10 determines whether the number of measures is zero (step 4505), it knows that the number of measures is not zero (No), and then whether the number of dimensions is two or more. Judgment is made (step 4506).
  • the number of dimensions is not two or more (No), and if it is determined whether the number of dimensions is 1 (step 4507), the number of dimensions is 1 (Yes), so it is associated with node 10.
  • the measured node value is taken as a dimension value (step 4509), and a measure is measured (step 4510).
  • the number of weights of the partial tree represented by vertex node 8 is 2, and the total weight is the value of the node value associated with node 9 and the value of the node value assigned to node 11. (Not shown).
  • the system 10 determines whether or not the next vertex node exists (step 4511). In this example, since there are no more vertex nodes in the vertex node list (No), the system 10 integrates the aggregation results obtained for each partial tree (step 4513).
  • the dimension value of the aggregation is a null value and the manufacturer name assigned to node 10 (the node value associated with node 10), and the number of weights corresponding to the null value is one.
  • the total amount is the weight assigned to node 7 (node value associated with node 7), the number of weights corresponding to the manufacturer name assigned to node 10 is 2, and the weight The total is the sum of the value of the node value associated with node 9 and the value of the node value assigned to node 11.
  • the parent-child relationship between the nodes is expressed in the depth priority mode. However, it may be expressed in the width priority mode and the partial tree may be specified.
  • the tree-type data structure data includes a storage device of the computer system 10 that includes a root 'node and a non-root' node that is a node other than the root 'node, and performs aggregation. For example, it is expanded in RAM14.
  • the parent-child relationship between nodes gives a unique node identifier to all nodes including the root node, giving priority to the child node over the node of the same generation, and not to the node identifier given to each of the non-root nodes. It is defined by associating the node identifier assigned to each parent node of the root node.
  • Each node is associated with at least one entity information representing data.
  • the vertex node is a node representing a node group including a specific node of the tree-type data structure and descendant nodes of the specific node.
  • the computer system 10 designates item name information representing the classification target of aggregation, and specifies at least one partial tree representing the range of aggregation.
  • the classification target and the range of aggregation may be input by the user via the input device 24 of the computer system 10, read from the external storage medium 18, or via the IZF 22, for example. External force may also be set.
  • the computer system 10 identifies, for each vertex node, a descendant node of the vertex node based on the parent-child relationship between the nodes, and the vertex node and Z or the vertex node. Judges whether the item name information associated with the descendant node of the point node matches the target of aggregation, and aggregates the item value information associated with the matching node.
  • FIG. 49 is a flowchart of a second tree data tabulation method useful for one embodiment of the present invention
  • FIGS. 50A to 50D are explanatory diagrams of the operating state of the second tree data tabulation method.
  • the second tree data aggregation method performs similar operations to the first tree data aggregation method shown in Figure 45, but does not define dimensions, so The processing for the dimension is omitted, and the processing for integrating the aggregation results for each partial tree is also omitted.
  • System 10 takes a vertex node from the vertex node list and identifies its subtree (step 4902, step 4903 in Fig. 49), subtrees as shown in Figs. 50A, B, and C. 1. Partial tree 2 and partial tree 3 are identified, and the number of weights and the total weight are calculated for each partial tree (step 4906). In FIG. 50D, the result of aggregation for each vertex node is shown.
  • the parent-child relationship between the nodes is expressed in the depth priority mode. However, it may be expressed in the width priority mode and the partial tree may be specified.
  • the sorting process of tree data that is useful in the present invention involves at least two node groups of data of a tree-type data structure including non-root nodes that are nodes other than the root 'node and the root' node developed in the storage device ( This is a process of ordering a collection of nodes (for example, a partial tree).
  • nodes for example, a partial tree.
  • the tree data sorting process of the present invention collects a certain index (comparison standard value) associated with each partial tree, and then assigns an order relationship to this index, so This is achieved by ordering itself.
  • Sort processing can be roughly divided into two types according to the way of collecting indices.
  • the first tree data sorting method uses the results of aggregation.
  • the second tree data aggregation method the aggregation results are collected for each partial tree. Therefore, for example, in the example of FIGS. 50A to 50D, when it is required to arrange the partial trees 1 to 3 in descending order of the “number of weights”, the “number of weights” shown in FIG. 50D can be used as an index.
  • the order relation can be defined in the partial trees 1 to 3, that is, the partial trees 1 to 3 can be sorted.
  • the second tree data sorting method does not use the result of aggregation.
  • the information related to the nodes of the partial tree is used as an index as it is, and the order relation is defined in the partial tree. .
  • the partial tree is divided into node values of nodes whose node type is “price” in the partial tree, that is, in the order of “price value”. Sort.
  • the first tree data sorting method useful for one embodiment of the present invention is represented by, for example, vertex node 1, vertex node 6 and vertex node 8 of the data of the tree type data structure as shown in FIG. 43A. Sort partial tree 1 (Fig. 50A), partial tree 2 (Fig. 50B) and partial tree 3 (Fig. 50C) using the number of weights as an index.
  • data having a tree-type data structure including a root ′ node and a non-root ′ node that is a node other than the root node is expanded.
  • the parent-child relationship between nodes gives a unique node identifier to all nodes including the root node, giving priority to child nodes over nodes of the same generation, and to each non-root node. It is expressed by associating the assigned node identifier with the assigned node identifier for each parent node of the non-root node.
  • Each node is associated with item name information (for example, node type) representing the data item and item value information (for example, node value) representing the data item value, and each node group (for example, partial tree 1, part The tree 2 and the partial tree 3) include vertex nodes representing the node group (for example, the vertex node 1, the vertex node 6, and the vertex node 8) and descendant nodes of the vertex node.
  • item name information for example, node type
  • item value information for example, node value
  • each node group for example, partial tree 1, part The tree 2 and the partial tree 3
  • vertex nodes representing the node group for example, the vertex node 1, the vertex node 6, and the vertex node 8 and descendant nodes of the vertex node.
  • the target of aggregation and the range of aggregation may be input by the user via the input device 24 of the computer system 10, for example, or may be externally stored. It can be read from the medium 18 or an external force can be set via the I / F22! /.
  • the computer system 10 identifies, for each vertex node, the descendant node of the vertex node using the parent-child relationship between the nodes, and the item associated with the vertex node or the descendant node of the vertex node. Judges whether the name information matches the target of aggregation, and aggregates the item value information associated with the matched nodes.
  • FIGS. 51A to 51C are explanatory diagrams of a first tree data sorting method useful for one embodiment of the present invention.
  • FIG. 51A shows a comparison standard obtained by executing the second tree data aggregation method. The result of collecting values is shown. In this example, the number of weights per vertex node is the collection result of the comparison reference value.
  • the computer system 10 assigns an order to the at least two vertex nodes according to the order relation of the item value information aggregated for each vertex node, so that a node group represented by the vertex node is obtained.
  • 2 is the number of weights corresponding to vertex node 1
  • 1 is the number of weights corresponding to vertex node 6
  • 2 is the number of weights corresponding to vertex node 8.
  • the vertex nodes are ordered.
  • the vertex nodes are arranged in the order of vertex node 6, vertex node 1, and vertex node 8.
  • FIG. 51B shows the sorting result of the comparison reference values obtained in this way.
  • the subtree represented by these vertex nodes can be ordered as shown in FIG. 51C.
  • the parent-child relationship between the nodes is expressed in the depth priority mode. However, it may be expressed in the width priority mode and the partial tree may be specified.
  • FIGS. 52A to 52C show the “child-to-parent” representation (FIG. 52A) of the tree-type data structure and the parent-child relationship of the nodes that are the targets of the processing of the second tree data sorting method that is useful in one embodiment of the present invention.
  • FIG. 52 is a diagram for explaining a list of node values for each node type (FIG. 52B) and node types and node values (FIG. 52C) associated with the nodes. Vertex nodes are indicated by black stars ( ⁇ ).
  • the value number is a pointer to the value list.
  • symbol number i and value number j are associated with node X
  • the node value of node X is j in the value list specific to symbol number i. It can be obtained by referring to the th element (eg, the first element is the 0th element).
  • a method for specifying an actual value by a combination of such a value number and a value list has been proposed by the present inventor (see, for example, International Publication No. WOOOZ 10103 pamphlet).
  • the partial trees represented by vertex node 1, vertex node 6 and vertex node 8 are defined as partial tree 1, partial tree 2 and partial tree 3, respectively.
  • the element corresponding to the value number 3 of (price) VL is “200”. In this way, the node value associated with node 4 is obtained.
  • the computer system 10 designates vertex nodes representing at least two nodes to be ordered, and designates item name information as an index for ordering (for example, a vertex node list).
  • the ordering indicator eg, node type
  • the IZF 22 may be You can also set the external capacity via this.
  • the computer system 10 identifies, for each vertex node, the descendant node of the vertex node based on the parent-child relationship between the nodes, and orders the vertex node or the descendant node of the vertex node.
  • the item value information associated with the node associated with the item name information that becomes the index of is acquired.
  • the node value may be obtained by the above method.
  • the computer system 10 determines the order of the item value information acquired for each vertex node. By ordering the at least two vertex nodes according to the relationship (for example, the magnitude relationship of the obtained node values), the nodes represented by the vertex node (for example, the partial tree) are ordered.
  • the relationship for example, the magnitude relationship of the obtained node values
  • FIG. 53 is a flowchart of the second tree data sorting method useful for one embodiment of the present invention.
  • the computer system 10 sorts the vertex nodes in the vertex node list in the order of the value numbers corresponding to the vertex nodes based on the cumulative number (step 5306).
  • the order of the value numbers corresponds to the sort order.
  • Figs. 54 to 62 illustrate an operation state when the second tree data sorting method according to the embodiment of the present invention is applied to data having the tree-type data structure shown in Figs. 52A to 52C.
  • FIG. 54 illustrates an operation state when the second tree data sorting method according to the embodiment of the present invention is applied to data having the tree-type data structure shown in Figs. 52A to 52C.
  • Number storage area Tmp—VNo and a sorted vertex node list storage area are prepared, and a count area Count having the same size as the price value list VL is prepared (step 5302).
  • the computer system 10 takes out the first vertex node 1 from the vertex node list and specifies the partial tree corresponding to the vertex node 1 (* in FIG. 55). ).
  • the computer system 10 receives vertex information as shown in FIG. The second vertex node 6 is extracted from the list, and the partial tree corresponding to the vertex node 6 is specified (* 1 in Fig. 56).
  • the computer system 10 extracts the third vertex node 8 from the vertex node list, and specifies the partial tree corresponding to the vertex node 8 (* 1 in FIG. 57).
  • the computer system 10 counts the number of occurrences (existence number) of the value number stored in Tmp—VNo corresponding to the vertex node list (step 5304).
  • the completed Count of FIG. 58 is obtained.
  • the computer system 10 accumulates the elements of Count and converts the count array Count into the accumulated number array Aggr (step 5305). As shown in Figure 59, the count array Count,
  • the count array Count and the cumulative number array Aggr are distinguished from each other. Physically, the count array Count and the cumulative number array Aggr may have the same area.
  • the cumulative number array Aggr obtained in this way is displayed when the value numbers obtained in step 5303 are arranged in ascending order (if there are two or more same value numbers, the number is duplicated) , Indicates the start position of each value number. In this example, the value number
  • the computer system 10 uses the cumulative number array Aggr to rearrange the vertex nodes in the vertex node list in order of the value numbers associated with the vertex nodes (step 5306).
  • increment Aggr [3] By this increment, the pointer indicating the storage position of the sorted vertex node list is moved to the next position, so even if the value number is duplicated, the vertex node list is correctly displayed. You can do so.
  • VNo [l] Cumulative number array pointed to by 2
  • the computer system 10 can convert the pre-sort vertex node list into the post-sort vertex node list by sorting in ascending order by price as shown in FIG. 62B.
  • the item name information when specified as an index for the value cart of certain item name information (for example, certain node type), the item name information is associated with one partial tree.
  • the ability to describe the second tree data sort for an example where only one node is being used There may be more than one node that hits as an index in a partial tree. In that case, one node is selected according to the sort purpose and application. Also, when there is no node that hits as an index in one partial tree, the partial tree is handled as being excluded from sorting or assigning the lowest order according to the application. can do.
  • the power to specify all the descendant nodes when specifying the partial tree represented by the vertex node, the power to specify all the descendant nodes.
  • the descendant such as up to the child node, up to the grandchild node, etc. It is also possible to limit the scope of aggregation by limiting the number of generations.
  • the parent-child relationship between the nodes is expressed in the depth priority mode. It may be expressed in breadth-first mode and there may be a partial tree specified.
  • data with a tree-type data structure may be composed of multiple tree data.
  • each tree data is given a tree identifier and is distinguished by this tree identifier.
  • the tree-type data structure data including a plurality of tree data is obtained by executing the above-described tree-type data structure data search, aggregation, and sorting method for each tree data. Is also applicable.
  • 63A to 63E are diagrams showing an example of data having a tree-type data structure including a plurality of tree data, that is, tree groups.
  • information related to the purchase of parts necessary to produce a product (supplier, manufacturer, product number, weight, price, etc.) is represented as data in a single data structure.
  • supply, manufacturer, product number, weight, price, etc. information related to the purchase of parts necessary to produce a product
  • product number supply, manufacturer, product number, weight, price, etc.
  • separate tree data is prepared for each route of acquisition.
  • Each node is represented in the form of (node type, node value) using item name information (ie, node type) and item value information (ie, node value) associated with that node.
  • the data in FIG. 63A has a tree identifier of tree data 1, a root 'node is (part number, 1), and node (manufacturer, A), node (weight, 10) as child nodes of the root' node. ), Node (price, 5000), and node (vendor, ⁇ ).
  • the tree data may have different structures.
  • Search, aggregation, and sorting can be performed on data having such a tree-type data structure. Search, aggregation, and sorting are performed individually for each tree data, and then the results of search, aggregation, and sorting are integrated. The integrated result is associated with each tree data via a tree data identifier.
  • the root node of each tree data is a vertex node.
  • the search result is expressed by a set of a set of a tree data identifier of the tree data and a node identifier of the vertex node.
  • the search result is expressed by a set of a set of a tree data identifier and a node identifier.
  • the vertex nodes that hit this search are the vertex node of tree data 1, the vertex node of tree data 2, and the top node of tree data 3.
  • a vertex node including both nodes having a price value of 200 or less and a node having a weight value of 12 or less as descendant nodes is a vertex node of the tree data 3.
  • the sort such as “low price order” is the same as the first tree data sorting method of the present invention.
  • the second tree data sorting method it can be realized by extending the elements of the vertex node list to be specified by a set of tree data identifier and node identifier.
  • a node is identified by a set of a tree data identifier and a node identifier, and a method of searching, aggregating, and sorting data of a tree-type data structure for each tree data. By implementing it, it can be extended to data of a tree type data structure including a plurality of tree data.
  • FIG. 64 is a block diagram of an information processing device 6400 that processes data having a tree-type data structure according to an embodiment of the present invention.
  • the information processing device 6400 includes a storage unit 6401 that stores data representing a tree-type data structure, a data expansion unit 6402 that expands data of the tree-type data structure on the storage unit 640 1, and a tree data processing unit.
  • the tree data processing unit 6404 includes a search unit 6405 that executes tree data search, a totaling unit 6406 that executes tree data aggregation, an index acquisition unit 6408 that acquires an index for tree data sorting, and a totaling unit.
  • An ordering unit 6407 that receives the aggregation result from 6406 or the index from the index acquisition unit 6408 and executes tree data sorting.
  • the storage unit 6401 stores data of a tree-type data structure including a root 'node and a non-root' node that is a node other than the root 'node.
  • the data expansion unit 6402 assigns a unique node identifier to all nodes including the root 'node, and assigns a node identifier assigned to each parent node of the non-root' node to a node identifier assigned to each of the non-root 'nodes.
  • the parent-child relationship between the nodes constituting the tree-type data structure is expressed, and at least one entity information representing the data is associated with each node, and the tree-type data structure is constructed on the storage device.
  • the data expansion unit 6402 may give a unique node identifier to all the nodes including the root ′ node in preference to the child node over the same generation node.
  • the condition specifying unit 6403 sets various conditions according to the purposes of search, aggregation, and sorting.
  • Various conditions include at least one search condition related to actual information, at least one partial tree representing the search range, item name information representing the aggregation target, at least one partial tree representing the aggregation range, and ordering target Vertex nodes that represent at least two node groups, or item name information that serves as an index for ordering.
  • the search unit 6405 determines whether or not at least one entity information associated with the node matches the search condition. If there is a match, the search unit 6405 associates the search hit information with the node, and The search hit information is associated with the ancestor node of the node by finding the parent-child relationship between the nodes. Further, the search unit 6405 may store the node identifier assigned to the vertex node associated with the search hit information among at least one vertex node as a search result.
  • the search unit 6405 identifies, for each vertex node, an ancestor node of the vertex node based on a parent-child relationship between the nodes, and at least one associated with the vertex node and Z or the ancestor node of the vertex node. It is determined whether the entity information matches the search condition, and the search hit information is associated with the matched node.
  • the search unit 6405 has a parent-child relationship between the nodes according to a first search condition that specifies at least one entity information, and matches the first search condition.
  • the node identifier assigned to the vertex node representing the node group to which the node belongs is stored as the first search result, and the parent-child relationship between the nodes is determined according to the second search condition specifying at least one entity information.
  • the node identifier assigned to the vertex node representing the node group to which the node that matches the first search condition belongs is stored as the second search result, and the logic of the first search condition and the second search condition is stored.
  • the aggregation unit 6406 identifies, for each vertex node, a descendant node of the vertex node based on the parent-child relationship between the nodes, and is associated with the vertex node and Z or a descendant node of the vertex node. It is determined whether the item name information matches the target of aggregation, and the item value information associated with the matching node is aggregated.
  • the counting unit 64 For each vertex node, specify the descendant node of the vertex node by gathering the parent-child relationship between the nodes, and the item name information associated with the vertex node or the descendant node of the vertex node is the target of aggregation.
  • the item value information associated with the matched node is associated with the item name information representing the classification target of the aggregation related to the node group represented by the vertex node. For each item value information.
  • the ordering unit 6407 orders the node group represented by the vertex node by ordering the at least two vertex nodes according to the order relation of the item value information aggregated for each vertex node.
  • the index acquisition unit 6408 identifies, for each vertex node belonging to each tree data, a descendant node of the vertex node based on the parent-child relationship between the nodes, and the vertex node Alternatively, item value information associated with a node associated with item name information, which is an index for ordering, is obtained from descendant nodes of the vertex node.
  • the ordering unit 6407 orders the node group represented by the vertex node by ordering the at least two vertex nodes according to the order relation of the item value information acquired for each vertex node.
  • FIG. 1 is a block diagram of a computer system that handles a tree-type data structure useful for an embodiment of the present invention.
  • Figs. 2A and 2B are explanatory diagrams of POS data, which is an example of tree format data.
  • Fig. 2A is a visual representation of the data structure (ie, topology) and data values of this tree format data.
  • Fig. 2B is an example of the same tree format data expressed in XML format.
  • FIGS. 3A to 3C are explanatory diagrams of an example of an expression format of a tree-type data structure using an arc list.
  • FIGS. 4A to 4C are diagrams illustrating a representation method of a tree-type data structure based on a “child ⁇ parent” relationship It is.
  • FIG. 5 is a flowchart of a method for constructing a tree-type data structure on a storage device.
  • FIGS. 6A to 6C are explanatory diagrams of the process of converting the tree structure type data in the ID format into the tree structure type data in the integer serial number format.
  • FIGS. 7A to C are explanatory diagrams of the process of converting the tree structure type data in the ID format into the tree structure type data in the integer serial number format.
  • FIG. 8 is a flowchart of node definition processing based on depth priority.
  • FIG. 9 is an explanatory diagram of an array of parent-child relationships based on the expression “child ⁇ parent”.
  • Figure 10 shows the “parent” created from the depth-first tree data structure shown in FIG. 6C.
  • FIG. 11 is a flowchart of node definition processing based on width priority.
  • FIG. 12 is an explanatory diagram of an array of parent-child relationships based on the expression “child ⁇ parent”.
  • Figure 13 shows the “parent” created from the depth-first tree data structure shown in FIG. 7C.
  • FIG. 14A is a diagram showing a tree-type data structure based on the breadth-first mode
  • FIG. 14B is a diagram showing an array of a parent-child relationship based on the tree-type data structure based on a “child ⁇ parent” expression.
  • FIG. 15A is a diagram showing an example of a vertex node list
  • FIG. 15B is a diagram showing an example of a partial tree group specified by the vertex node list.
  • FIG. 16A is a diagram showing an example of a vertex node list obtained by the search process
  • FIG. 16B is a diagram showing an example of a partial tree group specified by the vertex node list.
  • FIG. 17A is an example of an array showing a vertex node list and a result of aggregation obtained by the aggregation process
  • FIG. 17B is a diagram showing an example of a partial tree group specified by the vertex node list.
  • FIG. 18A is a vertex node list sorted by the number of nodes and an example of an array indicating the number of corresponding nodes
  • FIG. 18B is a diagram showing an example of a partial tree specified by the vertex node list. .
  • FIGS. 19A and 19C are diagrams showing examples of vertex node lists to be subjected to AND operations
  • FIGS. 19B and 19D are diagrams showing examples of partial tree groups specified by the vertex node list.
  • FIG. 20A is an example of a vertex node list showing a result of a logical product operation
  • FIG. 20B is a diagram showing a partial tree group specified by the vertex node list.
  • FIG. 21A is a diagram showing a tree-type data structure based on the breadth-first mode
  • FIG. 21B is a diagram showing an array of a parent-child relationship based on the tree-type data structure based on the expression “child ⁇ parent”.
  • FIGS. 22A and 22B are diagrams illustrating a logical product operation.
  • FIG. 23 is a flowchart showing a logical product operation process.
  • FIG. 24 is a diagram showing an example of logical product operation processing.
  • FIG. 25 is a diagram showing an example of logical product operation processing.
  • FIG. 26 is a diagram showing an example of how to handle substantial values.
  • FIG. 27A is an explanatory diagram of a “child-to-parent” representation of a parent-child relationship between a tree-type data structure and a node that is a target of a search based on a descendant path condition according to an embodiment of the present invention
  • FIG. 27B shows the correspondence between symbol numbers, display figures, and symbol names.
  • FIG. 28 is a flowchart of a tree search method based on descendant path conditions according to an embodiment of the present invention.
  • FIGS. 29A to 29C are diagrams for explaining the operation states of the tree search method based on the descendant path conditions that are useful in one embodiment of the present invention.
  • FIGS. 30A to 30C are diagrams for explaining the operation state of the tree search method based on the path conditions of descendents according to one embodiment of the present invention.
  • FIG. 31A to FIG. 31C are diagrams for explaining the operation state of the tree search method based on the descendant path conditions that are useful in one embodiment of the present invention.
  • FIGS. 32A to 32D are diagrams for explaining the operation state of the tree search method based on the path conditions of descendents according to one embodiment of the present invention.
  • FIGS. 33A to 33C are diagrams for explaining the operation state of the tree search method based on the path conditions of descendents according to one embodiment of the present invention.
  • FIG. 34 is a flowchart of a tree search method based on descendant path conditions according to an embodiment of the present invention.
  • FIGS. 35A to 35C are diagrams for explaining the operation states of the tree search method based on the descendant path conditions according to one embodiment of the present invention.
  • FIGS. 36A to 36C are diagrams for explaining the operation state of the tree search method based on the descendant path conditions according to one embodiment of the present invention.
  • FIGS. 37A to 37C are diagrams for explaining the operation state of the tree search method based on the path conditions of descendents according to one embodiment of the present invention.
  • FIGS. 38A to 38C are explanatory diagrams of a “child ⁇ parent” expression of a parent-child relationship between a tree-type data structure and a node to be searched according to an ancestor path condition according to an embodiment of the present invention. .
  • FIG. 39 is a flowchart of a tree search method based on ancestor path conditions according to one embodiment of the present invention.
  • FIGS. 40A to 40C are diagrams for explaining an operation state of a tree search method based on an ancestor path condition useful for an embodiment of the present invention.
  • FIGS. 41A to 41C are diagrams for explaining an operation state of a tree search method based on an ancestor path condition useful for an embodiment of the present invention.
  • FIGS. 42A to 42C are diagrams for explaining the operation state of the tree search method based on an ancestor path condition useful in one embodiment of the present invention.
  • FIG. 43A is an explanatory diagram of a “child-to-parent” expression of a tree-type data structure and a parent-child relationship of nodes that are subject to aggregation according to an embodiment of the present invention
  • FIG. It is a figure showing the correspondence of a display figure and a symbol name.
  • FIGS. 44A to 44D are explanatory diagrams of a partial tree represented by each vertex node in FIG. 43A.
  • FIG. 45 is a flow chart of a first tree data tabulation method useful for one embodiment of the present invention.
  • FIG. 46 is a diagram for explaining the operating state of the first tree data tabulation method useful in one embodiment of the present invention.
  • FIG. 47 is a diagram for explaining the operating state of the first tree data tabulation method useful in one embodiment of the present invention.
  • FIG. 48 is a diagram for explaining the operating state of the first tree data tabulation method useful in one embodiment of the present invention.
  • FIG. 49 is a flowchart of a second tree data tabulation method useful for an embodiment of the present invention. Yat.
  • FIGS. 50A to 50D are diagrams for explaining the operating state of the second tree data tabulation method useful in one embodiment of the present invention.
  • FIGS. 51A to 51C are explanatory diagrams of a first tree data sorting method useful in one embodiment of the present invention.
  • FIG. 52A shows a tree-type data structure and a “child-to-parent” representation of the parent-child relationship of the nodes to be processed by the second tree data sorting method according to one embodiment of the present invention.
  • B shows a list of node values for each node type
  • FIG. 52C shows a node type and a node value associated with the node.
  • FIG. 53 is a flowchart of a second tree data tabulation method useful for one embodiment of the present invention.
  • FIG. 54 is an explanatory diagram of an operation state when the second tree data sorting method according to the embodiment of the present invention is applied to the data of the tree type data structure shown in FIGS. It is.
  • FIG. 55 is an explanatory diagram of an operation state when the second tree data sorting method according to the embodiment of the present invention is applied to the data of the tree type data structure shown in FIGS. It is.
  • FIG. 56 is an explanatory diagram of an operation state when the second tree data sorting method according to the embodiment of the present invention is applied to the data of the tree type data structure shown in FIGS. It is.
  • FIG. 57 is an explanatory diagram of an operation state when the second tree data sorting method according to the embodiment of the present invention is applied to the data of the tree type data structure shown in FIGS. It is.
  • FIG. 58 is an explanatory diagram of an operation state when the second tree data sorting method according to the embodiment of the present invention is applied to the data of the tree type data structure shown in FIGS. It is.
  • FIG. 59 is an explanatory diagram of an operation state when the second tree data sorting method according to the embodiment of the present invention is applied to data of the tree type data structure shown in FIGS.
  • FIG. 60 is an explanatory diagram of an operating state when the second tree data sorting method according to the embodiment of the present invention is applied to data of the tree-type data structure shown in FIGS. It is.
  • FIG. 61 is an explanatory diagram of an operation state when the second tree data sorting method according to the embodiment of the present invention is applied to the data of the tree type data structure shown in FIGS. It is.
  • FIG. 62A and FIG. 62B are diagrams for explaining the operation state when the second tree data sorting method, which is useful in one embodiment of the present invention, is applied to the data of the tree type data structure shown in FIGS. FIG.
  • FIGS. 63A to 63E are diagrams showing an example of data having a tree-type data structure including a plurality of tree data.
  • FIG. 64 is a block diagram of an information processing apparatus according to an embodiment of the present invention.
  • Tree data processing section 6405 Search unit 6406 Totaling unit 6407 Ordering unit 6408 Index acquisition unit

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

 効率的にツリー型データ構造のデータを検索、集計、ソートする。本発明は、ツリー型データ構造を構成するノード間の親子関係を、ツリー型データ構造のノード間の親子関係を、子ノードのノード識別子に親ノードのノード識別子を対応付ける「子→親」関係によって表現する。各ノードはデータを表す少なくとも一つの実体情報が関連付けられる。条件指定部は、実体情報や処理対象範囲に関する条件を指定し、ツリーデータ処理部は、条件指定部によって指定された条件に基づいて、検索、集計、ソートを実行する。

Description

明 細 書
ツリーデータの検索.集計 ·ソート方法及びプログラム 技術分野
[0001] 本発明はツリー型データ構造を取り扱う方法、特に、ツリー型データ構造のデータ を検索 '集計'ソートする方法に関する。また、本発明は、このような方法を実施する 情報処理装置に関する。更に、本発明は、このような方法を実行するためのプロダラ ム、及び、このプログラムを記録した記録媒体に関する。
背景技術
[0002] データベースは種々の用途に用いられている力 中規模ないし大規模システムに おいては、論理的な矛盾が排除できるリレーショナルデータベース (RDB)の使用が 主流となっている。たとえば、 RDBは飛行機の座席予約等のシステムに利用されて いる。この場合、キー項目を指定することにより、(多くの場合 1件の)ターゲットを迅速 に検索することもでき、或いは、予約の確定、キャンセル或いは変更などを行うことが できる。また、各便の座席数はせいぜい数百であるため、特定の航空便の空席数を 求めることも可能である。
[0003] このような RDBは、表形式データの取り扱いに適している力 ツリー形式データの 取り扱いには適していないことが知られている(例えば、非特許文献 1を参照。 ) o
[0004] 更に、アプリケーションの中には、表形式による表現よりもツリー形式による表現の 方が適しているものが存在する。特に、近年、イントラネットやインターネットのアプリケ ーシヨンのデータ標準として、ツリー型データ構造を採用する XMLが普及している( XMLの詳細については、例えば、非特許文献 2を参照。 )0
[0005] しかし、ツリー型データ構造の取り扱い、例えば、ツリー形式データの検索は、一般 に、大変効率が悪い。この効率の悪さの第 1の理由は、データが各所のノードに分散 して存在するため、データの存在すべき場所を直ちに特定することが困難である点 にある。 RDBでは、例えば、「年齢」というデータは、あるテーブルの「年齢」という項 目だけに格納されている。しかし、ツリー型データ構造では、「年齢」というデータを保 持するノードが各所に散在しているので、一般的には、ツリー型データ構造の全体を 調べなければ、該当するデータを検索することができない。
[0006] 効率の悪さの第 2の理由は、検索の結果を表現するために時間が力かるという点に ある。検索にヒットしたノード群を表現しょうとすると、屡々、そのノードの子孫にあたる ノードも表現しなければならな 、が、 RDBMSとは異なりデータ構造が非定型である ため、子孫ノードを表現するために時間が力かる。
[0007] そこで、データベースの主流である RDBの利点をいかすため、従来、ツリー型デー タ構造をデータベース化するとき、ツリー形式データを RDB化する方法 (例えば、特 許文献 1を参照。)が提案されている。 RDBでは、データはテーブル (表)に分解して 保持される。そのため、実際のツリー形式データを RDB化するには、ツリー形式デー タをテーブルに押し込める必要がある。しかし、様々のツリー型データ構造を取り扱う ためには、その構造毎に個別にデータをテーブルに押し込め、システム設計を行わ なければならない。したがって、 RDBに基づくシステム構築は非常に手間の力かる作 業である。
[0008] これに対して、ツリー形式データ、特に、 XMLデータをそのままの形でデータべ一 ス化する方法も提案されている。ツリー型データ構造の場合、一つのノードに子孫ノ ードをぶら下げることができ、多様な表現が可能であるため、システム設計の手間を 大幅に削減することができる。したがって、 XMLのようなツリー構造を取り扱える技術 を核として、ツリー形式データを処理することへのニーズが高まって 、る。
[0009] XMLデータをそのままの形でデータベース化する方法の一例のアプローチは、ッ リー構造に記入されているデータのコピーを取り出し、例えば、「年齢」という項目であ れば、「年齢」の検索用インデックスデータを別途保持する(例えば、特許文献 2を参 照。;)。これにより、データ自身に属性を付加できるという XMLデータのメリットを十分 に活用すると共に、タグを用いて表現された各項目の関係構造をそのまま記憶できる ようにしている。
[0010] また、 XML文書をツリー構造でメモリ上に展開するための DOMと呼ばれるォブジ エタトモデルのインタフェースが公開されている(例えば、非特許文献 3を参照。)。 特許文献 1 :特開 2003— 248615号公報
特許文献 2:特開 2001— 195406号公報 非特許文献 1 :株式会社セック、 "Karearea White Paper", [online], [平成 16年 2月 1 9日検索」、インターネット < URL:http://www.sec. co.jp/products/karearea/ 非特許文献 2 :W3C、 "Extensible Markup Language (XML) 1.0 (ThirdEdition)", [onli ne]、 2004年 2月 4日、 [平成 16年 2月 19日検索]、インターネットく URL:http:〃 www .w3.org/TR/2004/REC-xml-20040204/ >
非特許文献 3 :R. ァラン ヮイク、ブラッド ルーペン、サルタン ルーマン、「プログ ラミング XML」、 日経 DPソフトプレス、 2002年、 p. 59— 84
発明の開示
発明が解決しょうとする課題
[0011] しかし、上記の検索用インデックスデータを別途保持するようなアプローチでは、少 なくともデータは二重に保持され、かつ、インデックスを作成するコスト及びインデック スを格納するためのデータ領域が必要となり、大規模なデータを保持する上で不利 である。
[0012] このようなメカニズムによって、実際に検索を行い、ノードを特定したとしても、そのノ ードを表現するためには時間がかかる。また、このメカニズムは、ノード間の関係を問 題とする検索 (例えば、祖先に「60歳」 、う「年齢」を含み、子孫に「1歳」 、う「年齢 」を含むツリーの抽出)には利用できない。
[0013] このような従来技術の根本的な問題点は、個々のデータのみに着目し、データを蓄 えたノード間をポインタで接続することによりツリー型データ構造が表現されているた め、データ間の関係、例えば、親子、祖先、子孫、兄弟 (シブリング)、世代などの関 係を効率的にトレースすることができないことにある。換言すると、ポインタは、その値 が一定しないため、データの格納アドレスを示すという用途にし力使用できず、ノード 間の関係を直接的に表現することができない。その結果として、従来技術では、ッリ 一型データ構造のデータを検索、集計、ソートすることが困難であった。また、上記の DOMは、ツリー型データ構造のトポロジーを編集する操作のインタフェースを規定 するだけであり、操作の具体的手法を規定するものではな 、。
[0014] そこで、本発明は、効率的にツリー型データ構造のデータを検索、集計、ソートする ことができる方法、情報処理装置、プログラム、および、プログラムを記録した記録媒 体の提供を目的とする。
課題を解決するための手段
[0015] 上記目的を達成するため、本発明は、ツリー型データ構造を構成するノード間の親 子関係を、親ノードに子ノードを対応付ける「親→子」関係ではなぐ子ノードに親ノ ードを対応付ける「子→親」関係によって表現すると!、う親子関係表現に基づ!、て、 ツリー型データ構造のデータを検索、集計、ソートする。
[0016] したがって、本発明によれば、記憶装置に展開されたルート'ノードとルート'ノード 以外のノードである非ルート'ノードを含むツリー型データ構造のデータを検索する方 法は、請求項 1に記載されるように、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
実体情報に関する検索条件を指定する条件指定ステップと、
各ノードについて、当該ノードに関連付けられた実体情報が前記検索条件と一致 するかどうかを判定し、一致した場合に当該ノードに検索ヒット情報を関連付け、前記 ノード間の親子関係を迪つて当該ノードの祖先ノードに検索ヒット情報を関連付ける 検索ステップと、
を有する。これにより、実体情報を指定して、全ツリーを検査し、条件に合致するノー ドを検出することができる。
[0017] 従来力 知られている「親→子」関係によって親子関係を表現する場合、一つの親 ノードに複数の子ノードが対応する場合があるので、親ノードと子ノードの二つの要 素を特定しなければ親子関係を定義できない。即ち、親ノードを特定しても、その親 ノードと親子関係にある子ノードを特定することができない。これに対して、本発明の ように「子→親」関係によって親子関係を表現する場合、一つの子ノードには必ず唯 一の親ノードが対応するので、子ノードを特定することによって、この子ノードに対応 する唯一の親ノードを直ちに特定することができる。これにより、ツリー型データ構造 のデータを高速に検索できるようになる。
[0018] 特に、ノード識別子を整数により定義すると、親子関係を定義する際に、子ノードの 識別子を収容する配列が不要になるので (すなわち、ツリー型データ構造のトポロジ 一は一つの配列で記述できるので)、メモリ使用量が削減され、処理速度が高速ィ匕 する。好ましくは、ノード識別子は整数連番にされる。
[0019] また、本発明は、請求項 2に記載されるように、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、
条件指定ステップは、検索範囲を表す少なくとも一つの部分ツリーを指定するステ ップを含み、
検索ステップの後に、検索ヒット情報が関連付けられたノードを含む部分ツリーを表 す識別子を検索結果として保存するステップをさらに有する。これにより、検索結果が 部分ツリーを表す識別子のリストとして得られる。
[0020] このように、特定のノードとその特定のノードの子孫ノードは部分ツリーという形でま とめて取り扱うと、この部分ツリーを用いて検索の範囲を指定したり、検索の結果を表 したりすることができるので、非常に便利である。
[0021] また、本発明によれば、記憶装置に展開されたルート'ノードとルート'ノード以外の ノードである非ルート'ノードを含むツリー型データ構造のデータを検索する方法は、 請求項 3に記載されるように、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、
少なくとも一つの実体情報に関する検索条件を指定し、検索範囲を表す少なくとも 一つの部分ツリーを指定するステップと、 各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群に関連付けられた少なくとも一つの実体情報が前記検索条件と一致するか どうかを判定し、一致したノードに検索ヒット情報を関連付けるステップと、 を有する。これにより、指定された部分ツリーを検査し、ヒットしたノードを検索結果とし て得ることができる。
[0022] また、本発明によれば、記憶装置に展開されたルート'ノードとルート'ノード以外の ノードである非ルート'ノードを含むツリー型データ構造のデータを検索する方法は、 請求項 4に記載されるように、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、
少なくとも一つの実体情報に関する検索条件を指定し、検索範囲を表す少なくとも 一つの部分ツリーを指定するステップと、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノードに関連付けられた少なくとも一つの実体情報が前記検索条件と一致するかどう かを判定し、一致したノードが存在する場合に、当該部分ツリーを表す識別子を検索 結果として保存するステップと、
を有する。これにより、実体情報を検索条件として指定し、部分ツリーを検査し、部分 ツリーの識別子を検索結果として得ることができる。
[0023] また、本発明によれば、記憶装置に展開されたルート'ノードとルート'ノード以外の ノードである非ルート'ノードを含むツリー型データ構造のデータを検索する方法は、 請求項 5に記載されるように、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、
少なくとも一つの実体情報に関する検索条件を指定し、検索範囲を表す少なくとも 一つの部分ツリーを指定するステップと、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーの祖先ノ ードを特定し、当該部分ツリーの特定のノード及び Z又は祖先ノードに関連付けられ た少なくとも一つの実体情報が前記検索条件と一致するかどうかを判定し、一致した ノードに検索ヒット情報を関連付けるステップと、
を有する。これにより、実体情報を検索条件として指定し、祖先ノードを検査して、検 索条件に合致したノードを検索結果として得ることができる。
また、本発明によれば、記憶装置に展開されたルート'ノードとルート'ノード以外の ノードである非ルート'ノードを含むツリー型データ構造のデータを検索する方法は、 請求項 6に記載されるように、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、
少なくとも一つの実体情報に関する検索条件を指定し、検索範囲を表す少なくとも 一つの部分ツリーを指定するステップと、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーの祖先ノ ードを特定し、当該部分ツリーの特定のノード及び Z又は祖先ノードに関連付けられ た少なくとも一つの実体情報が前記検索条件と一致するかどうかを判定し、一致した ノードが存在する場合に、当該部分ツリーを表す識別子を検索結果として保存するス テツプと、
を有する。これにより、検索条件として実体情報を指定し、祖先ノードを検査し、検索 にヒットした祖先ノードを有する部分ツリーの識別子を検索結果として得ることができ る。
また、本発明によれば、記憶装置に展開されたルート'ノードとルート'ノード以外の ノードである非ルート'ノードを含むツリー型データ構造のデータを第 1の検索条件と 第 2の検索条件を論理的に組み合わせて検索する方法は、請求項 7に記載されるよ うに、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、
検索範囲を表す少なくとも一つの部分ツリーが指定され、
少なくとも一つの実体情報を指定する第 1の検索条件に従って、前記ノード間の親 子関係を迪つて当該第 1の検索条件に一致するノードが属する部分ツリーを表す識 別子を第 1の検索結果として保存するステップと、
少なくとも一つの実体情報を指定する第 2の検索条件に従って、前記ノード間の親 子関係を迪つて当該第 1の検索条件に一致するノードが属する部分ツリーを表す識 別子を第 2の検索結果として保存するステップと、
第 1の検索条件と第 2の検索条件の論理的な関係に対応した論理演算を第 1の検 索結果と第 2の検索結果に実行することにより、第 1の検索条件と第 2の検索条件を 論理的に組み合わせた検索結果を生成するステップと、
を有する。これにより、検索条件を組み合わせた検索が、個別の検索条件による検索 と、個別の検索の検索結果の論理演算として実現される。 [0026] また、本発明によれば、記憶装置に展開されたルート'ノードとルート'ノード以外の ノードである非ルート'ノードを含むツリー型データ構造のデータを集計する方法は、 請求項 8に記載されるように、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、
集計の対象を表す実体情報を指定し、集計の範囲を表す少なくとも一つの部分ッ リーを指定するステップと、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群を特定し、当該ノード群の中に集計の対象を表す実体情報が関連付けられ たノードが存在するかどうかを判定し、存在する場合に、当該ノードに関連付けられ た実体情報を集計するステップと、
を有する。この方法は、各部分ツリーを明示的に指定することにより、次元を指定しな い集計、すなわち、部分ツリー内の測度の集計を実現する。
[0027] また、本発明によれば、記憶装置に展開されたルート'ノードとルート'ノード以外の ノードである非ルート'ノードを含むツリー型データ構造のデータを集計する方法は、 請求項 9に記載されるように、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、 集計の分類対象を表す実体情報を指定し、集計の対象を表す実体情報を指定し、 集計の範囲を表す少なくとも一つの部分ツリーを指定するステップと、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群を特定し、当該ノード群の中に集計の対象を表す実体情報が関連付けられ たノードが存在するかどうかを判定し、存在する場合に、当該ノードに関連付けられ た実体情報を、当該部分ツリーに属するノード群に関係した集計の分類対象を表す 実体情報毎に集計するステップと、
を有する。この方法は、集計の対象 =測度、集計の範囲 =カテゴリ、及び、集計の分 類対象 =次元を指定して、部分ツリー内の測度^^計することができる。
また、本発明によれば、記憶装置に展開されたルート'ノードとルート'ノード以外の ノードである非ルート'ノードを含むツリー型データ構造のデータの少なくとも二つのノ ード群に順序を付ける方法は、請求項 10に記載されるように、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造のデータの特定のノード及び当該特定のノードの 子孫ノードを含むノード群であり、
集計の対象を表す実体情報を指定し、集計の範囲を表す少なくとも二つの部分ッ リーを指定するステップと、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群を特定し、当該ノード群の中に集計の対象を表す実体情報が関連付けられ たノードが存在するかどうかを判定し、存在する場合に、当該ノードに関連付けられ た実体情報を集計するステップと、
部分ツリー毎に集計された項目値情報の順序関係に従って当該少なくとも二つの 部分ツリーに順序を付けるステップと、
を有する。この方法は、集計結果を利用して、部分ツリーをソートすることができる。 [0029] また、本発明によれば、記憶装置に展開されたルート'ノードとルート'ノード以外の ノードである非ルート'ノードを含むツリー型データ構造のデータの少なくとも二つのノ ード群に順序を付ける方法は、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造のデータの特定のノード及び当該特定のノードの 子孫ノードを含むノード群であり、
順序付けの対象となる少なくとも二つの部分ツリーを指定し、順序付けの指標となる 実体情報を指定するステップと、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群を特定し、当該ノード群の中で、順序付けの指標となる実体情報が関連付け られたノードに関連付けられた実体情報を取得するステップと、
部分ツリー毎に取得された実体情報の順序関係に従って当該少なくとも二つの部 分ツリーに順序を付けるステップと、
を有する。この方法は、実体情報を利用して部分ツリーをソートすることができる。
[0030] 本発明の好ましい実施の形態によれば、請求項 12に記載されるように、各実体情 報はデータの項目を表す項目名情報又はデータの項目値を表す項目値情報である
[0031] また、本発明の好ましい実施の形態によれば、請求項 13に記載されるように、特定 のノード及び当該特定のノードの子孫ノードを含む部分ツリーは当該特定のノードの ノード識別子によって表される。これにより、一つの頂点ノードで部分ツリーを代表さ せることができる。検索の結果や、検索や集計の対象範囲をこの頂点ノードで記述す ることが可能になる。
[0032] また、本発明の一部の好ましい実施の形態では、請求項 14に記載されるように、ル ート 'ノードを含む全ノードに付与された固有のノード識別子は同じ世代のノードより も子ノードを優先して付与される。このような深さ優先の親子表現を利用すると、ある ノードの子孫ノードが親子表現の連続領域に出現するという優れた性質が得られ、検 索、集計、ソートの処理を高速ィ匕することが可能である。
[0033] 本発明の別の実施の形態では、請求項 15に記載されるように、ツリー型データ構 造のデータはツリー識別子が付与された複数のツリーデータを含む。これにより、複 数のツリーデータを検索、集計、ソートの対象として処理することが可能になる。
[0034] 請求項 1乃至 15に記載された方法を実施する情報処理装置は請求項 16乃至 30 に記載されている。本発明の情報処理装置は、請求項 16に記載されるように、ルート •ノードとルート'ノード以外のノードである非ルート ·ノードを含むツリー型データ構造 のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータを検索する情報 処理装置であって、
ルート'ノードを含む全ノードに固有のノード識別子を付与し、非ルート'ノードの各 々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノード 識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係 を表現し、各ノードにデータを表す少なくとも一つの実体情報を関連付け、ツリー型 データ構造を記憶装置上に構築するデータ展開手段と、
少なくとも一つの実体情報に関する検索条件を指定する条件指定手段と、 各ノードについて、当該ノードに関連付けられた少なくとも一つの実体情報が前記 検索条件と一致するかどうかを判定し、一致した場合に当該ノードに検索ヒット情報 を関連付け、前記ノード間の親子関係を迪つて当該ノードの祖先ノードに検索ヒット 情報を関連付ける検索手段と、
を有する。
[0035] この情報処理装置において、請求項 17に記載されるように、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、
条件指定手段は、検索範囲を表す少なくとも一つの部分ツリーを指定する手段を 含み、
検索手段は、検索ヒット情報が関連付けられたノードを含む部分ツリーを表す識別 子を検索結果として保存する手段を含む。
[0036] また、請求項 18に記載された情報処理装置は、ルート'ノードとルート'ノード以外 のノードである非ルート'ノードを含むツリー型データ構造のデータを記憶する記憶装 置を有し、記憶装置に記憶されたデータを検索する情報処理装置であって、 ルート ·ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノ ード識別子を付与し、非ルート'ノードの各々に付与されたノード識別子に非ルート' ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型 データ構造を構成するノード間の親子関係が表現され、各ノードにデータを表す少 なくとも一つの実体情報を関連付け、ツリー型データ構造を記憶装置上に構築する データ展開手段と、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、少なくとも一つの実体情報に関する検索条件を指定し、検 索範囲を表す少なくとも一つの部分ツリーを指定する条件指定手段と、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群を特定し、当該ノード群に関連付けられた少なくとも一つの実体情報が前記 検索条件と一致するかどうかを判定し、一致したノードに検索ヒット情報を関連付ける 検索手段と、
を有する。
[0037] 請求項 19に記載された情報処理装置は、ルート'ノードとルート'ノード以外のノー ドである非ルート'ノードを含むツリー型データ構造のデータを記憶する記憶装置を 有し、記憶装置に記憶されたデータを検索する情報処理装置であって、
ルート ·ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノ ード識別子を付与し、非ルート'ノードの各々に付与されたノード識別子に非ルート' ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型 データ構造を構成するノード間の親子関係が表現され、各ノードにデータを表す少 なくとも一つの実体情報を関連付け、ツリー型データ構造を記憶装置上に構築する データ展開手段と、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、少なくとも一つの実体情報に関する検索条件を指定し、検 索範囲を表す少なくとも一つの部分ツリーを指定する条件指定手段と、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群を特定し、当該ノード群に関連付けられた少なくとも一つの実体情報が前記 検索条件と一致するかどうかを判定し、一致したノードが存在する場合に、当該部分 ツリーを表す識別子を検索結果として保存する検索手段と、
を有する。
[0038] 請求項 20に記載された情報処理装置は、ルート'ノードとルート'ノード以外のノー ドである非ルート'ノードを含むツリー型データ構造のデータを記憶する記憶装置を 有し、記憶装置に記憶されたデータを検索する情報処理装置であって、
ルート'ノードを含む全ノードに固有のノード識別子を付与し、非ルート'ノードの各 々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノード 識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係 が表現され、各ノードにデータを表す少なくとも一つの実体情報を関連付け、ツリー 型データ構造を記憶装置上に構築するデータ展開手段と、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、少なくとも一つの実体情報に関する検索条件を指定し、検 索範囲を表す少なくとも一つの部分ツリーを指定する条件指定手段と、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーの祖先ノ ードを特定し、当該部分ツリーの特定のノード及び Z又は祖先ノードに関連付けられ た少なくとも一つの実体情報が前記検索条件と一致するかどうかを判定し、一致した ノードに検索ヒット情報を関連付ける検索手段と、
を有する。
[0039] 請求項 21に記載された情報処理装置は、ルート'ノードとルート'ノード以外のノー ドである非ルート'ノードを含むツリー型データ構造のデータを記憶する記憶装置を 有し、記憶装置に記憶されたデータを検索する情報処理装置であって、
ルート'ノードを含む全ノードに固有のノード識別子を付与し、非ルート'ノードの各 々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノード 識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係 が表現され、各ノードにデータを表す少なくとも一つの実体情報を関連付け、ツリー 型データ構造を記憶装置上に構築するデータ展開手段と、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、少なくとも一つの実体情報に関する検索条件を指定し、検 索範囲を表す少なくとも一つの部分ツリーを指定する条件指定手段と、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーの祖先ノ ードを特定し、当該部分ツリーの特定のノード及び Z又は祖先ノードに関連付けられ た少なくとも一つの実体情報が前記検索条件と一致するかどうかを判定し、一致した ノードが存在する場合に、当該部分ツリーを表す識別子を検索結果として保存する 検索手段と、
を有する。
請求項 22に記載された情報処理装置は、ルート'ノードとルート'ノード以外のノー ドである非ルート'ノードを含むツリー型データ構造のデータを記憶する記憶装置を 有し、第 1の検索条件と第 2の検索条件を論理的に組み合わせて検索する情報処理 装置であって、
ルート'ノードを含む全ノードに固有のノード識別子を付与し、非ルート'ノードの各 々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノード 識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係 が表現され、各ノードにデータを表す少なくとも一つの実体情報を関連付け、ツリー 型データ構造を記憶装置上に構築するデータ展開手段と、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、検索範囲を表す少なくとも一つの部分ツリーを指定する条 件指定手段と、
少なくとも一つの実体情報を指定する第 1の検索条件に従って、前記ノード間の親 子関係を迪つて当該第 1の検索条件に一致するノードが属する部分ツリーを表す識 別子を第 1の検索結果として保存し、少なくとも一つの実体情報を指定する第 2の検 索条件に従って、前記ノード間の親子関係を迪つて当該第 1の検索条件に一致する ノードが部分ツリーを表す識別子を第 2の検索結果として保存する検索手段と、 第 1の検索条件と第 2の検索条件の論理的な関係に対応した論理演算を第 1の検 索結果と第 2の検索結果に実行することにより、第 1の検索条件と第 2の検索条件を 論理的に組み合わせた検索結果を生成する組み合わせ手段と、
を有する。
[0041] 請求項 23に記載された情報処理装置は、ルート'ノードとルート'ノード以外のノー ドである非ルート'ノードを含むツリー型データ構造のデータを記憶する記憶装置を 有し、記憶装置に記憶されたデータを集計する情報処理装置であって、
ルート ·ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノ ード識別子を付与し、非ルート'ノードの各々に付与されたノード識別子に非ルート' ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型 データ構造を構成するノード間の親子関係が表現され、各ノードにデータを表す少 なくとも一つの実体情報を関連付け、ツリー型データ構造を記憶装置上に展開する データ展開手段と、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、集計の対象を表す実体情報を指定し、集計の範囲を表す 少なくとも一つの部分ツリーを指定する条件指定手段と、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群を特定し、当該ノード群の中に集計の対象を表す実体情報が関連付けられ たかどうかを判定し、存在する場合に、当該ノードに関連付けられた実体情報を集計 する集計手段と、
を有する。
[0042] 請求項 24に記載された情報処理装置は、ルート'ノードとルート'ノード以外のノー ドである非ルート'ノードを含むツリー型データ構造のデータを記憶する記憶装置を 有し、記憶装置に記憶されたデータを集計する情報処理装置であって、
ルート ·ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノ ード識別子を付与し、非ルート'ノードの各々に付与されたノード識別子に非ルート' ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型 データ構造を構成するノード間の親子関係が表現され、各ノードにデータを表す少 なくとも一つの実体情報を関連付け、ツリー型データ構造を記憶装置上に展開する データ展開手段と、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、集計の分類対象を表す実体情報を指定し、集計の対象を 表す実体情報を指定し、集計の範囲を表す少なくとも一つの部分ツリーを指定する 条件指定手段と、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群を特定し、当該ノード群の中に集計の対象を表す実体情報が関連付けられ たノードが存在するかどうかを判定し、存在する場合に、当該ノードに関連付けられ た実体情報を、当該部分ツリーに属するノード群に関係した集計の分類対象を表す 実体情報毎に集計する集計手段と、
を有する。
請求項 25に記載された情報処理装置は、ルート'ノードとルート'ノード以外のノー ドである非ルート'ノードを含むツリー型データ構造のデータを記憶する記憶装置を 有し、記憶装置に記憶されたデータの少なくとも二つのノード群に順序を付ける情報 処理装置であって、
ルート ·ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノ ード識別子を付与し、非ルート'ノードの各々に付与されたノード識別子に非ルート' ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型 データ構造を構成するノード間の親子関係が表現され、各ノードにデータを表す少 なくとも一つの実体情報を関連付け、ツリー型データ構造を記憶装置上に展開する データ展開手段と、
部分ツリーはツリー型データ構造のデータの特定のノード及び当該特定のノードの 子孫を含むノード群であり、集計の対象を表す実体情報を指定し、集計の範囲を表 す少なくとも二つの部分ツリーを指定する条件指定手段と、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群を特定し、当該ノード群の中に集計の対象を表す実体情報が関連付けられ たノードが存在するかどうかを判定し、存在する場合に、当該ノードに関連付けられ た実体情報を集計する集計手段と、
部分ツリー毎に集計された項目値情報の順序関係に従って当該少なくとも二つの 部分ツリーに順序を付ける順序付け手段と、
を有する。
[0044] 請求項 26に記載された情報処理装置は、ルート'ノードとルート'ノード以外のノー ドである非ルート'ノードを含むツリー型データ構造のデータを記憶する記憶装置を 有し、記憶装置に記憶されたデータの少なくとも二つのノード群に順序を付ける情報 処理装置であって、
ルート ·ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノ ード識別子を付与し、非ルート'ノードの各々に付与されたノード識別子に非ルート' ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型 データ構造を構成するノード間の親子関係が表現され、各ノードにデータを表す少 なくとも一つの実体情報を関連付け、ツリー型データ構造のデータを記憶装置上に 展開するデータ展開手段と、
部分ツリーはツリー型データ構造のデータの特定のノード及び当該特定のノードの 子孫ノードを含むノード群であり、順序付けの対象となる少なくとも二つの部分ツリー を指定し、順序付けの指標となる実体情報を指定する条件指定手段と、
各ツリーデータに属する各部分ツリーについて、前記ノード間の親子関係を迪つて 当該部分ツリーに属するノード群を特定し、当該ノード群の中で、順序付けの指標と なる実体情報が関連付けられたノードに関連付けられた実体情報を取得する指標取 得手段と、
部分ツリー毎に取得された項目値情報の順序関係に従って当該少なくとも二つの 部分ツリーに順序を付ける順序付け手段と、
を有する。
[0045] また、本発明によれば、請求項 31乃至 45に記載されているように、請求項 1乃至 1
5に係る方法を実行するためのプログラムが提供される。
[0046] 更に、本発明によれば、請求項 31乃至 45に記載されたプログラムを記録した記録 媒体が提供される。
発明の効果
[0047] 本発明によれば、ツリー型データ構造のノード間の親子関係は、「子→親」表現に 基づ!/ヽて表現されて!ヽるので、ツリー型データ構造を操作する際にアクセスされるメ モリの量が低減し、これにより、検索、集計、ソートを高速に実現することが可能となる
発明を実施するための最良の形態
[0048] 以下、添付図面を参照して、本発明の実施の形態につき説明を加える。
[0049] [コンピュータシステム構成]
図 1は、本発明の実施の形態に力かるツリー型データ構造のデータを検索、集計、 ソートするコンピュータシステムのハードウェア構成を示すブロックダイヤグラムである
。図 1に示すように、このコンピュータシステム 10は、通常のものと同様の構成であり、 プログラムを実行することによりシステム全体および個々の構成部分を制御する CPU 12、ワークデータなどを記憶する RAM(Random Access Memory) 14,プログラム等を 記憶する ROM(Read Only Memory) 16,ハードディスク等の固定記憶媒体 18、 CD —ROM19をアクセスするための CD— ROMドライバ 20、 CD— ROMドライバ 20や 外部ネットワーク(図示せず)と接続された外部端子との間に設けられたインタフエ一 ス (IZF) 22、キーボードやマウス力 なる入力装置 24、 CRT表示装置 26を備えて いる。 CPU12、 RAM14、 ROM16、外部記憶媒体 18、 I/F22,入力装置 24およ び表示装置 26は、バス 28を介して相互に接続されている。
[0050] 本実施の形態にかかる、ツリー型データ構造のデータを検索、集計、ソートするプロ グラム、及び、ツリー型データ構造を記憶装置上で変換するプログラムは、 CD—RO M19に収容され、 CD— ROMドライバ 20に読取られても良いし、 ROM16に予め記 憶されていても良い。また、いったん CD— ROM19から読み出したものを、外部記憶 媒体 18の所定の領域に記憶しておいても良い。或いは、上記プログラムは、ネットヮ ーク(図示せず)、外部端子および IZF22を経て外部力 供給されるものであっても 良い。
[0051] また、本発明の実施の形態に力かる情報処理装置は、コンピュータシステム 10にッ リー型データ構造のデータを検索、集計、ソートするプログラムを実行させること〖こより 実現される。
[0052] [ツリー型データ構造]
図 2A、 Bは、ツリー形式データの一例である POSデータの説明図であり、図 2Aは 、このツリー形式データのデータ構造 (即ち、トポロジー)及びデータ値を視覚的に表 現した一例である。図 2Bは、同じツリー形式データを XML形式で表現した一例であ る。同図に示されるようにツリー型データ構造は、ルート'ノード (本例では、 POSデー タ)から始めて、各ノードで枝分かれしてリーフ'ノード (端点)に至るノードとアークの 組み合わせによって表現される。各ノードには、項目名情報、すなわち、ノードのタイ プと、項目値情報、すなわち、ノードの値が関連付けられ、図 2A、 Bの例では、 XML 形式の
く shopName〉フランス店く/ shopName〉
に対応したノードは、「shopName ( =店名)」と 、うノードタイプと「フランス店」と 、ぅノ ード値が関連付けられている。この関連付けは、例えば、ノードタイプ及びノード値を 記述する情報が格納されたノード情報格納領域へのポインタを、ノード識別子に随伴 させること〖こよって実現することができる。しかし、本発明は、ツリー型データ構造の実 体的な値の取り扱い方によって限定されないことに注意する必要がある。
[0053] これに対して、ツリー型データ構造のデータの検索、集計、ソートを効率的に実行 するためには、ツリー型データ構造のトポロジーを表現する手法、すなわち、記憶装 置に展開する手法が非常に重要な役割を果たす。そこで、以下では、主として、ッリ 一型データ構造のトポロジーに関して説明する。
[0054] 従来、このようなツリー型データ構造は、データを蓄えたノード間をポインタで接続 すること〖こよって表現されている。しかし、ポインタ表現は、ポインタ値に必然性がな いという欠点がある。即ち、ある場合には特定のノード Aがある番地 (例えば、 100番 地)に格納され、別の場合には同じノード Aが別の番地 (例えば、 200番地)に格納さ れるので、ポインタ値が一定ではなぐポインタ値は、本質的にノードの格納アドレス を表現するに過ぎない。そのため、例えば、ノードが深さ優先の規則に従ってポイン タで接続されて ヽる場合、これらのノードを幅優先の規則に従ってポインタで再接続 することは困難である。
[0055] これに対して、本発明者は、ツリー型データ構造のトポロジーがアークリストによって 記述可能であることに着目した。アークリストとは、ノード間の親子関係を表すアーク のリストである。図 3A〜Cは、アークリストを用いたツリー型データ構造の表現形式の 一例の説明図である。同図の例では、 0、 10、 20、 30、 40、 50、 60、 70、 80、 90、 1 00及び 110のノード識別子 (ID)が付与された 12個のノード力もなるツリー型データ 構造が示されている。図 3Aはツリー型データ構造の全体を示している。図 3Aにおい て、(ノードのタイプを表している)丸形、ハート形などの図形の中央に記載された数 字は、ノード IDを表し、矢印と矢印の側に記載されたく 0, 10 >などの数字の対は、 アークを表している。尚、ノード IDは、文字列には限られず、数値、特に、整数でもよ い。図 3Bは、親ノード(From— ID)から子ノード (To— ID)へのアークリストを示し、 図 3Cは、ノード IDとノード Typeの対のリストからなるノードリストを示す。尚、ツリー型 データ構造を表現するだけの目的のためにはノードリストが無くても構わない。原理 的には、このようなアークリストを用いることによって、ノード間の関係をポインタによら ずに直接的に記述することが可能である。
[0056] [「子→親」関係に基づく表現]
図 3A〜Cの例では、アークリストは、親ノードに子ノードを対応付ける「親→子」関 係に基づいて記述されている。そのため、一つの親ノード、例えば、ルート'ノード 0に は、 3個の子ノード 10、 60及び 80が存在するため、アークリストの From— IDには、 同じノード IDの 0が 3回出現している。つまり、親ノードを特定しても子ノードを特定す ることができないので、アークリストは、要素 From— IDの配列と要素 To— IDの配列 により構成される。アークリストを使用する場合、あるノードは、 From— IDの配列と、 To— IDの配列の両方の配列に出現する。
[0057] これに対して、親子関係は、「子→親」関係によっても表現することが可能である。こ の場合、ノード間の親子関係は、ルート'ノード以外のノードである非ルート'ノードの 各々と、関連付けられた親ノードと、の組の配列によって表現される。この「子→親」 関係によって親子関係を表現する場合、「親→子」関係の場合には得られな力つた 重要な性質がある。即ち、一つの子ノードには必ず唯一の親ノードが対応するので、 子ノードを特定することによって、この子ノードに対応する唯一の親ノードを直ちに特 定することができる。つまり、アークリストは、実際には、要素 To— IDの配列だけを準 備すればよい。この結果として、アークリストを格納するための記憶容量が削減される 。この記憶容量の削減は、メモリへのアクセス回数が低減するという効果があるので、 結果的に、処理の高速ィ匕が実現できる。
[0058] 図 4A〜Dは、「子→親」関係に基づくツリー型データ構造の表現方法の説明図で ある。図 4Aはツリー全体の説明図であり、図 4Bは「子→親」関係に基づくアークリスト である。図 4Bのアークリストは、ルート'ノードに対する親ノードの格納領域を含んで いるので、ルート'ノードの親ノードとして、便宜的に〃—〃が設定されている。但し、ル ート 'ノードに対応する親ノードは存在しないので、図 4Cに示されるように、「子→親」 関係に基づくアークリストからルート'ノードに対する親ノードの格納領域を除いても 構わない。このように、ルート'ノード以外のノードである非ルート'ノードの各々に対し て、非ルート'ノードの親ノードを関連付けることによりノード間の親子関係を表現する 。そして、「子→親」表現された子のノードから親のノードのリストを迪ることでツリーの トポロジーを表現することができる。
[0059] このような「子→親」関係に基づくツリー型データ構造は、本発明の一実施例によれ ば、図 5に示されるように、図 1に示されたコンピュータシステム 10に、ルート'ノードを 含むノードに固有のノード識別子を付与するノード定義ステップ 501と、前記ルート' ノード以外のノードである非ルート'ノードの各々に付与されたノード識別子に、前記 非ルート'ノードの各々の親ノードに付与されたノード識別子を関連付ける親子関係 定義ステップ 502と、を実行させることによって RAM14上に構築される。このように、 最初に、文字列、浮動小数、整数などの任意の識別情報によってノードにノード識別 子を付与し、次に、「子→親」表現に基づいて親子関係を定義することによって、子ノ ードのノード識別子力 親ノードのノード識別子を引く (ルックアップする)ことでツリー のトポロジーを表現することができる。
[0060] [ノード識別子]
好ましくは、ノード定義ステップはノード識別子として数値を使用し、より好ましくは、 連続する整数を使用し、更に好ましくは、 0又は 1からの整数連番を使用する。これに より、ノード識別子から、そのノードに対応する親ノードのノード識別子が格納されて V、るアドレスを簡単に取得することができるので、子ノードのノード識別子力も親ノード のノード識別子を引く処理を高速ィ匕することができる。
[0061] ツリー型データ構造のノードにノード識別子として順序付きの番号を付与してノード 間の親子関係を表現する場合、番号の付与順序に規則を定めることによって、その 後のツリー型データ構造の取り扱 、が容易になると 、う利点がある。この番号の付与 順序の規則として、同じ世代のノードよりも子ノードを優先する深さ優先モードと、子ノ ードよりも同じ世代のノードを優先する幅優先モードが利用される。
[0062] 図 6A〜Cは、 ID形式のツリー構造型データを整数連番形式のツリー構造型データ へ変換する処理の説明図である。図 6Aには、各ノードに ID番号が付与されたツリー 構造型データが示されている。図 6Bには、変換規則が示され、図 6Cには、各ノード に整数連番が付与されたツリー構造型データが示されて!/ヽる。本例の変換規則は、 深さ優先で連続番号を付与する規則であり、具体的には、複数の子ノードが存在す る場合、長子 (一番上の兄)ノードに最小番号を付与し、末子 (一番下の弟)ノードに 大きい番号を付与し、かつ、兄弟ノードよりも子ノードを優先して番号を付与する。本 例では、昇順に番号付けをしている力 降順に番号付けをしてもよい。
[0063] また、図 7A〜Cは、 ID形式のツリー構造型データを整数連番形式のツリー構造型 データへ変換する処理の説明図である。図 7Aには、各ノードに ID番号が付与された ツリー構造型データが示されている。図 7Bには、変換規則が示され、図 7Cには、各 ノードに整数連番が付与されたツリー構造型データが示されている。本例の変換規 則は、幅優先で連続番号を付与する規則であり、具体的には、複数の子ノードが存 在する場合、長子 (一番上の兄)ノードに最小番号を付与し、末子 (一番下の弟)ノー ドに大きい番号を付与し、かつ、子ノードよりも兄弟ノードを優先して番号を付与する 。本例では、昇順に番号付けをしているが、降順に番号付けをしてもよい。
[0064] このようにノード識別子として番号を使用すると、ノード番号から直ちに、即ち、 0 (1 )のオーダーで、そのノードに関する格納値が格納されているアドレスを引くことがで きる。また、親子関係を「子→親」表現することによって、子ノードから親ノードを直ち に、即ち、 O (l)のオーダーで引くことができる。 [0065] [深さ優先モード]
図 6Cに示されるような深さ優先に基づくツリー型データ構造は、図 1に示されたコン ピュータシステム 10に、
同じ世代のノードよりも子ノードを優先して、ルート'ノードを含むノードに固有の連 続する整数を付与するノード定義ステップと、
ルート ·ノード以外のノードである非ルート ·ノードの各々に付与された整数の順に、 非ルート'ノードの各々の親ノードに付与された整数を並べることにより形成される配 列を前記記憶装置に格納する親子関係定義ステップと、
を実行させることによって、記憶装置上に構築される。これにより、ノードは深さ優先 で連続整数が付与され、ノード間の親子関係は「子→親」関係の配列によって表現さ れる。
[0066] 図 8は、深さ優先に基づくノード定義処理のフローチャートである。このノード定義 処理は、コンピュータシステム 10に
最初にルート'ノードに番号を付与するステップ 801と、
既に番号が付与されたあるノードに唯一の子ノードが存在する場合には、当該子ノ ードに当該あるノードに付与された前記番号の次の番号を付与するステップ 802と、 既に番号が付与されたあるノードに複数の子ノードが存在する場合には、当該複数 の子ノードの間の兄弟関係に従って、弟ノードは直上の兄ノードの全ての子孫ノード に番号が付与された後に次の番号が付与されるように、一番上の兄ノードから一番 下の弟ノードまで番号を付与するステップ 803と、
を実行させる。これにより、深さ優先モードで同一の親ノードから派生した複数の子ノ ードの間に兄弟関係が定義される。
[0067] 図 9は、図 6Cに示された深さ優先のツリー型データ構造から作成された「子→親」 表現に基づく親子関係の配列の説明図である。同図にサブツリー 1又はサブツリー 2 として示されて ヽるように、深さ優先で連続番号が付与されたノードの親子関係を「子 →親」関係に基づいて配列表現すると、あるノードの子孫ノードが連続領域に出現す ると!/ヽぅ優れた性質が得られる。
[0068] 一例として、深さ優先モードの優れた性質を利用することにより、前記配列から、あ るノードに付与された整数以上の値が格納されている連続領域を抽出することにより 、前記あるノードの全ての子孫ノードを特定することができる。これにより、あるノード の子孫ノードを表すノード群が前記配列内の連続ブロックとして獲得できる。例えば、 連続ブロックのサイズを mとすると、あるノードの全ての子孫ノードを特定するための 処理速度は、 O (m)のオーダーになる。
[0069] 既に説明したように、ノード間の親子関係は、「子→親」関係の配列の他に、「親→ 子」関係の配列によっても表現できる。図 10は、図 6Cに示された深さ優先のツリー型 データ構造力 作成された「親→子」表現に基づく親子関係の配列の説明図である。 一つの親ノードに対して複数の子ノードが存在し得るので、親子関係の配列は、各ノ ードに対する子ノードの番号が格納されて 、る領域を示すための配列 Aggrと、子ノ ードの番号が格納されている配列 P→Cの二つの配列により構成される。例えば、配 列 Aggrの先頭から 2番目の要素 Aggr [1]の値は" 3"であり、これは、ノード [1]に対 する子ノードの番号は、配列 P→Cの要素 P→C [3]以降に格納されていることを表し ている。これにより、ノード [0]、即ち、ルート'ノードに対する子ノードは、配列 P→C の先頭から 3個の要素、 P→C[0]の 1、 P→C[1]の 6、及び P→C [2]の 8であること がわカゝる。
[0070] この「親→子」表現に基づく親子関係の配列の求め方を説明する。
(1)ノードの番号が配列 P→Cの最大の添字( = 11)と一致する場合、このノードに属 する子ノードは存在しない。したがって、処理は継続されない。
(2)同図に太字で表された親ノードの番号力も Aggr値を求める。この Aggr値は、配 列 P→Cの開始点を表す。
(3)太字で表された親ノード番号 + 1に対応する Aggr値を求める。この Aggr値 1 が配列 P→Cの終了点である。
[0071] 例えば、ノード 0の子ノードの開始点は、 Aggr[0]、即ち、 0であり、終了点は、 Agg r[l]— 1、即ち、 3— 1 = 2である。したがって、ノード 0の子ノードは、配列 P→Cの 0 〜2番目の要素、即ち、 1、 6及び 8である。
[0072] 或いは、「親→子」表現に基づく親子関係は、より単純に、親ノード番号の配列と、 対応する子ノード番号の配列と、の二つの配列により表現することも可能である。しか し、この配列を利用して親子関係を見つけるためには、親ノードの番号を検索しなけ ればならないので、即ち、 log (n)のアクセス時間を要するので効率が悪い。
[0073] [幅優先モード]
さらに、図 7Cに示されるような幅優先に基づくツリー型データ構造は、図 1に示され たコンピュータシステム 10に、
子ノードよりも同じ世代のノードを優先して、ルート'ノードを含むノードに固有の連 続する整数を付与するノード定義ステップと、
前記ルート'ノード以外のノードである非ルート'ノードの各々に付与された整数の 順に、前記非ルート'ノードの各々の親ノードに付与された整数を並べることにより形 成される配列を前記記憶装置に格納する親子関係定義ステップと、
を実行させることによって、記憶装置上に構築される。これにより、ノードは幅優先モ ードで連続整数が付与され、ノード間の親子関係は「子→親」関係の配列によって表 現される。
[0074] 図 11は、幅優先に基づくノード定義処理のフローチャートである。このノード定義処 理は、コンピュータシステム 10に、
各ノードが前記ルート'ノードから何世代目のノードである力 及び、各世代に含ま れるノード数を算出するステップ 1101と、
最初に前記ルート ·ノードに番号を付与するステップ 1102と、
ある世代に含まれる全てのノードに番号が付与されたならば、当該ある世代の次の 世代にノードが存在しなくなるまで、当該次の世代に含まれる全てのノードに対して、 親ノードが異なる場合には、当該親ノードに番号が付与された順番に当該ノードに番 号を付与し、当該親ノードが同一である場合には、当該親ノードから派生した複数の 子ノードの間に兄弟関係を定義し、一番上の兄ノードから一番下の弟ノードまで直前 に付与された番号の次の番号から連続的に変化する固有の整数を順に付与するス テツプ 1013と、
を実行させる。これにより、幅優先モードで同一の親ノードから派生した複数の子ノー ドの間に兄弟関係が定義される。
[0075] 図 12は、図 7Cに示された幅優先のツリー型データ構造から作成された「子→親」 表現に基づく親子関係の配列の説明図である。同図に示されているように、幅優先 で連続番号が付与されたノードの親子関係を「子→親」関係に基づいて配列表現す ると、あるノードの子ノードは連続領域に出現するという優れた性質が得られる。これ は、幅優先モードで連続番号が付与されたノードの親子関係を「子→親」関係に基 づ 、て配列表現すると、親ノードに付与された番号が前記配列中に順序付き (昇順 又は降順)で出現すること〖こよる。
[0076] したがって、幅優先モードの優れた性質を利用することにより、前記配列から、ある ノードに付与された整数と同じ値が格納されている連続領域を抽出することにより、前 記あるノードの全ての子ノードを特定する。これにより、あるノードの子ノードを、例え ば、二分探索などの手法を用いて検索することが可能であり、即ち、 0 (log (n) )のォ ーダ一で検索することが可能になる。
[0077] 既に説明したように、ノード間の親子関係は、「子→親」関係の配列の他に、「親→ 子」関係の配列によっても表現できる。図 13は、図 7Cに示された幅優先のツリー型 データ構造力 作成された「親→子」表現に基づく親子関係の配列の説明図である。 図 13—つの親ノードに対して複数の子ノードが存在し得るので、親子関係の配列は 、各ノードに対する子ノードの番号が格納されて 、る領域を示すための配列 Aggrと、 子ノードの番号が格納されている配列 P→Cの二つの配列により構成される。例えば 、配列 Aggrの先頭から 2番目の要素 Aggr [1]の値は" 3"であり、これは、ノード [1] に対する子ノードの番号は、配列 P→Cの要素 P→C [3]以降に格納されて!、ることを 表している。これにより、ノード [0]、即ち、ルート'ノードに対する子ノードは、配列 P →Cの先頭から 3個の要素、 P→C[0]の 1、 P→C[1]の 2、及び、 P→C[2]の 3であ ることがゎカゝる。
[0078] この「親→子」表現に基づく親子関係の配列の求め方を説明する。
(1)ノードの番号が配列 P→Cの最大の添字( = 11)と一致する場合、このノードに属 する子ノードは存在しない。したがって、処理は継続されない。
(2)同図に太字で表された親ノードの番号力も Aggr値を求める。この Aggr値は、配 列 P→Cの開始点を表す。
(3)太字で表された親ノード番号 + 1に対応する Aggr値を求める。この Aggr値 1 が配列 P→Cの終了点である。
[0079] 例えば、ノード 0の子ノードの開始点は、 Aggr [0]、即ち、 0であり、終了点は、 Agg r[l]— 1、即ち、 3— 1 = 2である。したがって、ノード 0の子ノードは、配列 P→Cの 0 〜2番目の要素、即ち、 1、 2及び 3である。
[0080] [ツリー型データ構造の表現形式の相互変換]
上述のように、ノードに連続番号を付与するための深さ優先モード及び幅優先モー ドは、それぞれ、固有の優れた性質を備えている。また、一つのツリー型データ構造 は、深さ優先に基づく「子→親」表現形式と、幅優先に基づく「子→親」表現形式と、「 親→子」表現形式の何れの表現形式でも表現可能である。したがって、深さ優先に 基づく「子→親」表現形式と、幅優先に基づく「子→親」表現形式と、「親→子」表現 形式は、適宜に相互変換可能であることに注意する必要がある。
[0081] [頂点ノードおよび部分ツリー群]
ツリー型データ構造のデータを検索、集計、ソートする際に、ツリーデータの全体の 中で特定の部分を処理の対象、例えば、検索の対象範囲とする場合がある。本発明 者は、複数のノードを含む特定の部分を代表する一つのノードを導入することにより、 種々の処理を効率化する手法を提案した。次に、この手法について詳述する。
[0082] ツリー型データ構造をもつツリーデータにおいて、ルート'ノードに最も近いノードの 値で、当該ノードおよびそのノードから枝分かれしてリーフ'ノード (端点)に至るまで の全てのノードを表現することを考える。ここで、あるノードおよびそのノード力も枝分 かれしてリーフ'ノードに至るまでのノード群を、部分ツリーと称する。また、上記ノード (ルート ·ノード)に最も近 ソードを頂点ノードと称する。
[0083] 図 14Aは、前述した幅優先モードに基づくツリー型データ構造、図 14Bは、当該ッ リー型データ構造を、「子→親」表現に基づく親子関係の配列を示す図である。たと えば、頂点ノード [4]は、ノード識別子 {4, 8, 9}を含み、頂点ノード [6]は、ノード識 別子 {6}を含み、また、頂点ノード [3]は、ノード識別子 {3, 7, 10, 11 }を含む。この ような、複数の頂点ノードからなる配列を、頂点ノードリストと称する。頂点ノードリスト により複数の部分ツリーを指定でき、指定された複数の部分ツリーを部分ツリー群と 称する。 [0084] 以下、頂点ノードリストを、 [a, b, · · ·]と表す。ここに、 「a」、 」、 · · ·は、頂点ノード に対応するノード識別子である。頂点ノードリストを構成する頂点ノードの各々を展開 して、当該頂点ノードを頂点とする部分ツリーに含まれるすべてのノードのノード識別 子を求めることを考える。求められたノード識別子のリストにおいて、あるノード識別子 は 1つしか存在しない場合、すなわち、ノード識別子が重複して出現しない場合、こ のような部分ツリー群を、「正規部分ツリー群」と称する。そうでないような部分ツリー群 を、「非正規部分ツリー群」と称する。
[0085] 尚、部分ツリー群は正規部分ツリー群へ変換することが可能であり、この処理を「正 規化」と称する。正規化は、集合演算を効率的に実施する上で重要になる。正規化さ れた部分ツリー群では、どのノードも高々 1つの頂点ノードに属するのみであるため、 各ノードが所属する頂点ノードのリストは、高々頂点ノードの数に等しいサイズの配列 で記述することができる。このため、正規化された状態では、論理積や論理和に代表 される集合演算を効率的に実施することができる。
[0086] 正規部分ツリー群であっても、非正規部分ツリー群であっても、頂点ノードリストによ つて、頂点ノードおよびその子孫ノードからなる部分ツリー群を特定することができる 。たとえば、図 15Aに示すように、頂点ノードリスト [4, 6, 3]により、図 15Bに示すよう な部分ツリー群 (部分ツリー {4, 8, 9}、 {6}、 {3, 7, 10, 11 })が特定される。
[0087] 頂点ノードリストにより特定される部分ツリー群は、検索、集計、ソート、集合演算の 対象とすることができる。
[0088] たとえば、図 15A、 Bの例で、「ハート形」のノードを含む部分ツリーを検索すると、 図 16Bに示すような部分ツリー群が得られる。図 16Aは、この部分ツリー群を表わす 頂点ノードリストである。
[0089] また、各部分ツリーに属するノード数魏計すると、図 17Bに示すようになる。図 17 Aにおいて、配列 1701は頂点ノードリスト、配列 1702は、各頂点ノードにより特定さ れる部分ツリーに属するノード数を示す配列である。
[0090] たとえば、ソートとして、各部分ツリーに属するノード数によるソートを考えることがで きる。図 18A中、配列 1801は、ソートされた頂点ノードリスト、配列 1802は、頂点ノ 一ドリストにより特定される部分ツリーに属するノード数を示す配列である。また、図 1 8Bは、部分ツリーがノード数にしたがってソートされた状態を示す。
[0091] さらに、複数の部分ツリー群の間の集合演算として、論理積について説明する。図 14A、 Bに示すツリーにおいて、図 19Bに示す部分ツリー群 (対応する頂点ノードリス トを図 19Aに示す)と、図 19Dに示す部分ッリ一群 (対応する頂点ノードリストを図 19 Cに示す)との論理積を考える。
[0092] 図 19Bにおける、ノード識別子「4」の頂点ノードにて特定される部分ツリー 1901と 、図 19Dにおける、ノード識別子「1」の頂点ノード識別子にて特定される部分ツリー 1 911とを比較すると、部分ツリー 1901は、部分ツリー 1902に包含される。図 19Bに おける部分ツリー 1902と包含関係をもつような部分ツリーは、図 19Dに示す部分ッリ 一群には存在しない。また、図 19Bにおけるノード識別子「3」の頂点ノードにて特定 される部分ツリー 1903と、図 19Dにおける、ノード識別子「7」にて特定される部分ッ リー 1913とを比較すると、部分ツリー 1913は、部分ツリー 1903に包含される。その 結果、論理積演算の結果を示す頂点ノードリストは、図 20Aに示すように、 [4, 7]と なる。図 20Bは、論理積演算の結果に対応する部分ツリー群である。
[0093] 図 16A、 B〜図 20A、 Bにより理解できるように、頂点ノードリスト (集計においては、 これに加えて、頂点ノードリストと同一サイズの、集計結果 (ノード数)を格納する配列 )によって、それぞれの処理や演算の結果を表わすことができる。
[0094] [集合演算]
本実施の形態に力かる正規部分ツリー群の間では、論理積 (AND)や論理輪 (OR )、否定 (NOT)、減算 (SUB)、排他的論理和 (XOR)を定義することができる。この ような演算の結果も正規部分ツリー群にて表わす。以下、これら演算について説明す る。以下、図 21A、 Bに示す例において、それぞれの演算について説明する。
(1)論理和(OR)
たとえば、正規部分ツリー群 [2]、 [3]の論理和を考える。
[0095] 正規部分ツリー群 [2] : { 2, 6}
正規部分ツリー群 [3] : {3, 7, 10, 11 }
これらの論理和 [2]OR[3] = [2, 3]
( [2, 3] : {2, 6} , {3, 7, 10, 11 }) となる。
[0096] 同様に、正規部分ツリー群 [3]、「7」の論理和を考える。
[0097] 正規部分ツリー群 [3] : {3, 7, 10, 11 }
正規部分ツリー群 [7] : {7, 10, 11 }
したがって、これらの論理和 [3]OR[7] = [3]となる。
(2)論理積 (AND)
正規部分ツリー群 [2, 3]、 [7]の論理積を考える。
[0098] 正規部分ツリー群 [2, 3] : {2, 6, 3, 7, 10, 11 }
正規部分ツリー群 [7] : [7, 10, 11]
したがって、これらの論理積 [2, 3]AND[7] = [7]となる。
[0099] 演算のうち、これらの演算において実行される処理について以下に説明する。
[0100] [論理積演算]
まず、論理積演算の原理について説明する。図 22Aに示すように、 2つの正規部分 ツリー群 2201および 2202を考える。 2つの正規部分ツリー群は、以下に述べるよう な関係を有する。
[0101] たとえば、正規部分ツリー群 2201が正規部分ツリー群 2202を含む場合(図 22B 参照)には、 2つの正規部分ツリー群の論理積は、正規部分ツリー群 2202となる。そ の一方、正規部分ツリー群 2202が正規部分ツリー群 2201を含む場合(図 22C参照 )には、 2つの正規部分ツリー群の論理積は、正規部分ツリー群 2201となる。さらに、 図示しないが、双方の正規部分ツリー群が包含関係を持たない場合には、これらの 間の論理積は空集合となる。
[0102] 図 23は、論理積演算の際にシステムにて実行される処理を示すフローチャートであ る。図 23に示すように、論理積演算の対象となる正規部分ツリー群のそれぞれにつ いて、マーキング配列を生成する (ステップ 2301)。マーキング配列は、正規化演算 にて生成されたフラグ配列および所属ノード配列と等価である。すなわち、正規化演 算の第 1の手法および第 2の手法と同様の処理を実施することでマーキング配列を 取得することができる。
[0103] 次 、で、システム 10は、双方のマーキング配列の対応する値を比較する(ステップ 2302)。より詳細には、システム 10は、 2つのマーキング配列中の対応する値を特定 するためのポインタを初期化し (ステップ 2311)、ポインタが示すマーキング配列の双 方の値を取り出す (ステップ 2312)。双方の値或いは一方の値力 初期値「― 1」であ つた場合には (ステップ 2313でノー (No))、システム 10は、ポインタが配列の末尾を 指して 、なければ (ステップ 2315でノー (No))、ポインタを移動して(ステップ 2316)、 ステップ 2312に戻る。
[0104] マーキング配列の双方の値が初期値「一 1」以外の値であった場合には (ステップ 2 312でイエス (Yes))、マーキング配列の値のうち大きいほうの値力 格納番地、つまり 、対応するノード識別子と等しいか否かが判断される (ステップ 2313)。ステップ 231 3でイエス (Yes)と判断された場合には、システム 10は、当該一致する値を、論理積演 算の結果を示す頂点ノード配列の値として、当該頂点ノード配列に格納する (ステツ プ 2314)。その後、ポインタが配列の末尾を指していなければ (ステップ 2315でノー (No))、ポインタを移動して(ステップ 2316)、ステップ 2312に戻る。
[0105] ステップ 2312でノー (No)と判断された場合には、ポインタが配列の末尾を指してい なければ (ステップ 2315でノー (No))、ポインタを移動して(ステップ 2316)、ステップ 2312に戻る。
[0106] 以下、正規部分ツリー群 [3, 6]と、正規部分ツリー群 [2, 7]の AND演算の例につ いて説明する。図 24は、正規部分ツリー群 [3, 6]および正規部分ツリー群 [2, 7]の それぞれのマーキング配列が生成された状態を示す。図 24において、符号 2401が 、正規部分ツリー群 [3, 6]のマーキング配列(第 1のマーキング配列)を示し、符号 2 402力 正規部分ツリー群 [2, 7]のマーキング配列(第 2のマーキング配列)を示す
[0107] 図 25に示すように、ポインタがノード識別子「6」を示すときに (符号 2501参照)、第 1のマーキング配列の値は「6」であり、かつ、第 2のマーキング配列の値力 「2」である 。大きい方の値は「6」であり、ノード識別子に一致する。したがって、値「6」は、論理 積演算の結果を格納するための頂点ノードリストに格納される。
[0108] また、ポインタがノード識別子「7」を示すときに (符号 2502参照)、第 1のマーキング 配列の値は「3」であり、かつ、第 2のマーキング配列の値力 「7」である。大きいほうの 値は「7」であり、ノード識別子に一致する。したがって、値「7」は、論理積演算の結果 を格納するための頂点ノードリストに格納される。このような処理の結果、 [3, 6] AN D[2, 7] = [6, 7]を得ることができる。
[0109] [論理和演算]
論理和演算は、以下のように記述することができる。
[0110] [al, a2, · · · , an]OR[bl, b2, · · · , bn]
=NORM[al, a2, · · · , an, bl, b2, · · · , bn]
つまり、上述した正規化の手法を用いれば、論理和演算の結果を示す頂点ノードリ ストを得ることができる。
[0111] たとえば、図 24に示す例において、 [3, 6]OR[2, 7] =NORM[3, 6, 2, 7] = [2
, 3]となる。
[0112] [減算]
上述した論理和演算および論理積演算を利用して、正規部分ツリー群の減算は、 以下のように定義することができる。なお、以下において、減算は「一(マイナス)」で 表わす。
[0113] A, Β, C, Dをそれぞれ正規部分ツリー群とする。
[0114] (A-B)AND (C-D) = (A AND C)一(B OR D) (式 1)
(A— B) OR (C— D) = (A OR C)AND (B AND D) (式 2)
A— B— C=A— (B OR C) (式 3)
つまり、ブール代数と同じ演算規則が成立する。
[0115] 正規ィ匕演算などで説明したように、正規部分ツリー群は、頂点ノードリストで表わす ことができる。
[0116] 本例においては、たとえば、(式 1)は、 2つの頂点ノードリスト (A、 Cの論理積演算 結果を示す頂点ノードリスト、および、 B、 Dの論理和演算結果を示す頂点ノードリスト )と、その間の「減算」という演算子とで表わすことができる。つまり、本来であれば、正 規部分ツリー群 A〜Cのそれぞれの 4つの頂点ノードリストおよびそれらの間の演算 子にて表わすべきところ、 2つの頂点リストおよびその間の演算子で表わすことができ る。つまり、被減数の頂点ノードリストと、減数の頂点ノードリスト(除外頂点ノードリスト )とで表わすことが可能となる。
[0117] (式 2)や (式 3)についても同様である。
[0118] [否定、排他的論理和等]
また、正規部分ツリー群の否定 (NOT)も、除外頂点ノードリストとして表わすことが できる。つまり、 ΓΝΟΤ Aj (Aは正規部分ツリー群)は、除外頂点ノードリストにリスト された頂点ノードおよびその子孫のノードを除いた全てのノード力 正規部分ツリー 群 Aの否定となる。
[0119] 同様に、排他的論理和も、頂点ノードリストおよび除外頂点ノードリストで表わすこと が可能である。
[0120] [ツリーデータ検索の概要]
ツリーデータ検索は、パスの検索とノード格納値の検索の二つの側面がある。パス の検索とは、図 2A、 Bにおいて、例えば、 7shop/shopName"というパス条件を満た すノードを抽出することである。また、ノード格納値の検索とは、図 2A、 Bにおいて、 " shopName=フランス店"であるノードを抽出することである。
[0121] そして、一般的なツリーデータ検索は、パスの検索とノード格納値の検索の組み合 わせであり、上記の例では、 7shop/shopName=フランス店〃を満たすノードを抽出す ることに相当する。すなわち、一般的なツリーデータ検索は、パスの条件とノード格納 値の条件を同時に満たす AND条件による検索である。ある頂点ノード力 この AND 条件を満たす力どうかは、パスの条件を調べ、パスの条件を満たすノードのノード格 納値の条件を調べることにより判定することが可能である。また、この AND条件指定 による検索は、パス条件による検索の結果集合とノード格納値条件による検索の結 果集合の AND (論理積)演算を実行することにより実現できる。
[0122] さらに、ツリーデータ検索は、上記のパス条件とノード格納値条件の AND条件指定 による検索に限られない。例えば、パス条件とノード格納値条件の何れかを満たすノ ードを抽出する OR条件指定による検索がある。この OR条件指定による検索は、パス 条件による検索の結果集合とノード格納値条件による検索の結果集合の OR (論理 和)演算を実行することにより実現できる。
[0123] [ノードの実体的な値の取り扱い方] ツリーデータ検索では、検索条件として、パスを表すためのノードの項目名情報 (例 えば、ノードタイプ)と、ノード格納値を表すためのノードの項目値情報(例えば、ノー ド値)のような実体情報が利用される。これらの実体情報は、例えば、図 26に示され るように、ノードタイプ及びノード値を記述する情報が格納されたノード情報格納領域 へのポインタを、ノード識別子に随伴させることによって特定することができる。
[0124] 尚、すべてのノードのノードタイプが同じである場合には、ノード情報格納領域には ノード値だけを格納するように構成することが可能である。
[0125] [子孫のパス条件による検索]
次に、本発明の実施の形態に力かる子孫のパス条件による検索方法を説明する。 子孫のパス条件による検索とは、指定されたノードタイプを有するノードを子孫ノード として含む頂点ノードを抽出する処理である。図 27A、 Bは、本発明の一実施例にか かる子孫のパス条件による検索の対象となるツリー型データ構造と、ノードの親子関 係の「子→親」表現の説明図である。本例では、各ノードの項目名情報であるノードタ ィプは、シンボル番号によって表され、図 27Aでは、各ノードのノード識別子(例えば 、ノード番号)力 そのノードのシンボル番号に対応した図形と共に表されている。例 えば、ルート'ノードは、丸型シンボルである。また、頂点ノードは黒塗りの星印(★)で 示されている。図 27Bは、シンボル番号と表示図形とシンボル名の対応関係を表す 図である。
[0126] 本例では、頂点ノードの子孫ノードの条件を検索条件としてノード抽出を行う。より 具体的には、子孫ノードにボタン型のノードを含む頂点ノードを抽出する。
[0127] 子孫のパス条件による検索においては、子ノード力 親ノードの順番にチェックする 方法 1と、親ノードから子ノードの順番にチェックする方法 2の 2通りの方法がある。方 法 1は、「子→親」表現の先頭力 順にチェックする方法であって、頂点ノードの個数 が多い場合に効果的である。一方、方法 2は、頂点ノードから始めて親力も子へ順に チェックするので、頂点ノード数が少ない場合に効果的である。アプリケーションに応 じて、方法 1と方法 2を選択的に実行してもよい。
[0128] [子孫のパス条件検索の方法 1:子→親でチェックする方法]
本発明の実施の形態にかかるパス条件検索方法 1を実行するコンピュータシステム 10の RAM14には、図 27Aに示されるように、ルート'ノードとルート'ノード以外のノ ードである非ルート'ノードを含むツリー型データ構造のデータが展開されている。よ り具体的には、ルート'ノードを含む全ノードに固有のノード識別子であるノード番号 が付与され、非ルート'ノードの各々に付与されたノード識別子に非ルート'ノードの 各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型デー タ構造を構成するノード間の親子関係、すなわち、深さ優先の「子→親」による親子 関係が表現されている。しかし、パス条件検索の方法 1は、幅優先の「子→親」による 表現形式でも同様に適用できることに注意する必要がある。各ノードは、例えば、図 2 6に示されるように、項目名情報であるノードタイプ (又は、シンボル番号)と、項目値 情報であるノード値とが関連付けられて 、る。
[0129] コンピュータシステム 10は、検索条件として、ノードのシンボル番号 = 1 (シンボル番 号 1はボタン型を表す)という条件を設定する。この条件は、例えば、ユーザがコンビ ユータシステム 10の入力装置 24を介して入力してもよぐ又は、外部記憶媒体 18か ら読み出してもよぐ或いは、 IZF22を介して外部力も設定してもよい。
[0130] コンピュータシステム 10は、次に、各ノードについて、当該ノードに関連付けられた ノードタイプがボタン型と一致するかどうかを判定し、一致した場合に当該ノードに検 索ヒット情報を関連付け、「子→親」表現形式の親子関係を迪つて当該ノードの祖先 ノードに検索ヒット情報を関連付ける。検索ヒット情報は、例えば、各ノード識別子に 対応したフラグ情報領域を準備し、検索がヒットした場合に、そのフラグ情報をセット することによってノード識別子に関連付けることができる。
[0131] 図 28は、本発明の一実施例に力かる子孫のパス条件によるツリー検索方法のフロ 一チャートである。また、図 29A〜図 33Cは、本発明の一実施例にかかる子孫のパ ス条件によるツリー検索方法の動作状態を説明する図である。
[0132] システム 10は、最初に、図 29Aに示されるように、フラグ領域 Flagを初期化し、シン ボル番号読み出しアドレスを初期化する (ステップ 2801)。本例では、フラグ領域は 値 0で初期化され、シンボル番号読み出しアドレスは先頭のアドレス 0で初期化され、 また、シンボル番号 (Symbol
No.)は配列の形で格納されている力 この例に限定されるものではない。次に、シス テム 10は、このシンボル番号読み出しアドレスに対応したシンボル番号 (Symbol No.)を読み出し (ステップ 2802)、このシンボル番号が 1であるかどうかをチェックする (ステップ 2803)。図中、チェック場所を示すポインタは太い矢印で示されている。先 頭アドレス 0に対応するシンボル番号は 2であるため、ステップ 2803のチェック結果 は Noであり、次のアドレスがあるかどうかをチェックすると (ステップ 2808)、次のアド レス 1が存在するので (Yes)、シンボル番号読み出しアドレスを次のアドレス 1に移動 し (ステップ 2805)、ステップ 2802へ戻る。図 29B〖こ示されるよう〖こ、読み出されたシ ンボル番号が 1に合致するか、又は、次のシンボル番号読み出しアドレスがなくなる まで、ステップ 2802、 2803、 2804、 2805力 S繰り返される。本 f列で ίま、 ドレス 0力ら アドレス 6までは、シンボル番号が 1に合致しない。図 29Cに示されるように、シンボル 番号読み出しアドレスが 7まで進むと、シンボル番号は 1に合致する(ステップ 2803)
[0133] システム 10は、ステップ 2803で 1に合致するシンボル番号を見出すと(Yes)、図 3 OAに示されるように、見出したアドレス 7のノードのフラグにマークを付け (ステップ 28 06)、親子関係表現 C→Pを利用して、アドレス 7の親ノードのアドレス、すなわち、ァ ドレス 6を見つけ、着目ノードを親ノードへ移動する (ステップ 2807)。以下では、簡 単のため、アドレス 7のノードをノード 7と称し、一般に、アドレス nのノードをノード nと 称する。次に、システム 10は、図 30Bに示されるように、移動先の親ノード 6がマーキ ングされているかどうかをチェックすると(ステップ 2808)、ノード 6のフラグはマーキン グされていないため(No)、親ノード 6のフラグにマークを付け(ステップ 2809)、さら に親ノードがあるかどうかを調べるためステップ 2807へ戻る。図 30Cに示されるよう に、ノード 6の親ノードはノード 0であり、このノード 0のフラグはマーキングされていな いので (ステップ 2808、 No)、ノード 0のフラグにマークを付け(ステップ 2809)、親ノ ードがあるかどうかをチェックすると (ステップ 2807)、親ノードが存在しないため(No )、システム 10はステップ 2804へ進む。
[0134] システム 10は、図 31Aに示されるように、シンボル番号読み出しアドレスを次のアド レス 8へ移動し (ステップ 2805)、図 31Bに示されるように、読み出されたシンボル番 号が 1に合致するか、又は、次のシンボル番号読み出しアドレスがなくなるまで、ステ ップ 2802、 2803、 2804、 2805を繰り返す。図 31C【こ示されるよう【こ、シンポノレ番号 読み出しアドレス 11まで進むと、シンボル番号は 1に合致する(ステップ 2803)。
[0135] システム 10は、ステップ 2803で 1に合致するシンボル番号を見出したので (Yes)、 図 32Aに示されるように、見出したノード 11のフラグにマークを付け (ステップ 2806) 、親子関係表現 C→Pを利用して、ノード 11の親ノードであるノード 9へ移動する (ス テツプ 2807)。次に、システム 10は、図 32Bに示されるように、移動先の親ノード 9が マーキングされているかどうかをチェックすると(ステップ 2808)、ノード 9のフラグはマ 一キングされていないため(No)、ノード 9のフラグにマークを付け (ステップ 2809)、 さらに親ノードがあるかどうかを調べるためステップ 2807へ戻る。図 32Cに示されるよ うに、ノード 9の親ノードはノード 8であり、ノード 8のフラグはマーキングされていない ため(No)、ノード 8のフラグにマークを付け (ステップ 2809)、さらに親ノードがあるか どうかを調べるためステップ 2807へ戻る。ノード 8の親ノードはノード 0であり、図 32D に示されるように、ノード 0が既にマーキングされているかどうかを調べると (ステップ 2 808)、既にマーキングされているので (Yes)、ステップ 2804へ進む。現在のシンポ ル番号読み出しアドレス 11の次のアドレスがあるかどうかをチェックすると (ステップ 2 804)と、これ以上のアドレスは存在しないため(No)、マーキングが終了する。
[0136] フラグ領域の結果は、ノードの全数検索の結果としてそのまま利用することができる
[0137] さらに、システム 10は、図 33Aに示されるように、検索範囲として、検索前の頂点ノ 一ドリストが指定されている場合、マーキングの終了後に、頂点ノードリストの各頂点ノ ードのフラグがマークされて!/、るかどうかをチェックし、マークされて!/、る頂点ノードを 検索結果として、検索後の頂点ノードリストに格納する。頂点ノード 1は、図 33Aに示 されるように、対応するフラグが 0であるため、ノード 1を頂点とする部分ツリーはボタン 型ノードを含まないが、頂点ノード 6は、図 33Bに示されるように、対応するフラグが 1 であるため(すなわち、マークされているため)、ノード 6を頂点とする部分ツリーはボ タン型ノードを含む。頂点ノード 8も同様にして、ボタン型ノードを含む部分ツリーの頂 点ノードであることがわかる。したがって、図 33Cに示されるように、頂点ノード 6及び 8を含む頂点ノードリストが検索結果として生成される。 [0138] 上記の例では、シンボル番号が 1に合致するノードが検出されたとき、そのノードの すべての親ノードを迪つて、親ノードをマーキングしている力 検索範囲として、子孫 の段数が指定されている場合、例えば、直下の子ノードまで、孫ノードまでなどの条 件が指定されて 、る場合、「子→親」表現による親子関係を迪る段数が制約される。
[0139] さらに、ノード数が膨大になると、フラグ領域の初期化のために要する時間も増加す るので、この初期化の時間を短縮するテクニックを提案する。システム立ち上げ直後 のような初期化時には、整数要素からなるフラグ配列のすべてを 0で初期化する。シ ステム動作時には、フラグ配列の要素がオーバーフローして 0に戻るまで初期化を行 わない。例えば、フラグ配列を格納する領域が 32ビット整数であるならば、 232— 1回 までの検索回数の範囲内では再度初期化をする必要がない。このとき、ヒットしたノー ドは、未使用の最小整数でマーキングする。すなわち、初回は 1であり、以降、 2、 3、 4のように増加する。したがって、頂点ノードリストが検索条件に合致しているかどうか のチェックは、マーキングに使用した値に一致するかどうかをチェックすればよい。
[0140] 尚、上記の例では、初期値は 0とした力 0以外の値でも構わな 、。また、マーキン グに使用する整数は、未使用であれば、最小の整数に限定されない。
[0141] [子孫のパス条件検索の方法 2:親→子でチェックする方法]
次に、親→子の順にチヱックを行う本発明の実施の形態にかかるパス条件検索方 法 2について説明する。ノ ス条件検索方法 2を実行するコンピュータシステム 10の R AM14には、図 27Aに示されるように、ルート'ノードとルート'ノード以外のノードで ある非ルート'ノードを含むツリー型データ構造のデータが展開されている。ツリー型 データ構造を構成するノード間の親子関係は、深さ優先の「子→親」による表現形式 で構築される。パス条件検索方法 2は、深さ優先で連続番号が付与されたノードの親 子関係を「子→親」関係に基づいて配列表現すると、あるノードの子孫ノードが連続 領域に出現するという上述の優れた性質を利用する。また、各ノードは、例えば、図 2 6に示されるように、項目名情報であるノードタイプ (又は、シンボル番号)と、項目値 情報であるノード値とが関連付けられて 、る。
[0142] コンピュータシステム 10は、検索条件として、ノードのシンボル番号 = 1 (シンボル番 号 1はボタン型を表す)という条件を設定する。さらに、システム 10は、検索範囲を表 す少なくとも一つの部分ツリーを設定する。本例では、頂点ノード 1、 6、 8を含む頂点 ノードリスト [1, 6, 8]が指定される。この検索条件と検索範囲は、例えば、ユーザが コンピュータシステム 10の入力装置 24を介して入力してもよぐ又は、外部記憶媒体 18から読み出してもよぐ或いは、 IZF22を介して外部力も設定してもよい。頂点ノ ードはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含む ノード群を代表するノードである。
[0143] コンピュータシステム 10は、次に、各頂点ノードについて、前記ノード間の親子関係 を迪つて当該頂点ノードの子孫ノードを特定し、当該頂点ノード及び Z又は当該頂 点ノードの子孫ノードに関連付けられたノードタイプがボタン型と一致するかどうかを 判定し、一致したノードが存在する場合に、当該頂点ノードに付与されたノード識別 子を検索結果として保存する。
[0144] 図 34は、本発明の一実施例に力かる子孫のパス条件によるツリー検索方法のフロ 一チャートである。また、図 35A〜図 37Cは、本発明の一実施例にかかる子孫のパ ス条件によるツリー検索方法の動作状態を説明する図である。
[0145] システム 10は、最初に、図 35Aに示されるように、頂点ノードリストから頂点ノードを 読み出すためのアドレスを示すポインタを頂点ノードリストの先頭アドレスで初期化し ( ステップ 3401)、頂点ノードリストから先頭の頂点ノード 1を取り出す (ステップ 3402) 。次に、システム 10は、深さ優先の「子→親」による親子関係の表現を参照して、頂 点ノード 1の子孫ノードを特定する (ステップ 3403)。一般に、深さ優先の「子→親」に よる親子関係の表現は上記の優れた性質を備えて!/、るので、特定ノードの子孫ノー ドは、この特定ノードに付与されたノード識別子が格納されて 、る位置の次の位置か ら、この特定ノードに付与されたノード識別子の値以上の値が格納されて 、る連続領 域を抽出することにより特定することができる。本例では、 C→Pにおいて、ノード 1に 付与されたノード識別子 0が格納されている次の位置から、このノード 1のノード識別 子 1以上の値が格納されている位置までの連続領域、すなわち、ノード識別子 1、 2、 2、 1が格納されている領域力 Sノード 1の子孫ノードの範囲である。この領域は、ノード 2、ノード 3、ノード 4及びノード 5に付与されたノード識別子を格納する領域であるた め、ノード 1の子孫ノードは、ノード 2、ノード 3、ノード 4及びノード 5であることがわかる [0146] 次に、システム 10は、特定された子孫ノードの中に、検索条件に合致するノード、 すなわち、ノードタイプがボタン型であるノードが存在するかどうかをチェックする(ス テツプ 3404)。本例の場合、図 35Bに示されるように、頂点ノード 1の子孫ノードの範 囲にボタン型のノードは存在しないので、図 35Cに示されるように、検索結果の頂点 ノードリストには何も登録せずに、システム 10はステップ 3405へ進む。本例の場合、 頂点ノードリストに次の頂点ノード 6が存在するので (ステップ 3405で Yes)、システム 10はポインタを頂点ノード 6へ移動して(ステップ 3406)、ステップ 3402へ戻る。
[0147] 次に、システム 10は、図 36Aに示されるように、頂点ノードリストから頂点ノード 6を 取り出し (ステップ 3402)、既に説明した子孫ノードの特定手法を用いて頂点ノード 6 の子孫ノードとしてノード 7を特定する(ステップ 3403)。続いて、システム 10は、図 3 6Bに示されるように、子孫ノード 7のノードタイプがボタン型であるかどうかをチェック し (ステップ 3404)、子孫ノード 7が検索条件に合致することを判定する (Yes)。した がって、システム 10は、図 36Cに示されるように、頂点ノード 6を検索結果である検索 後の頂点ノードリストに登録し (ステップ 3407)、ステップ 3405へ進む。
[0148] 本例の場合、頂点ノードリストに次の頂点ノード 8が存在するので (ステップ 3405で Yes)、システム 10はポインタを頂点ノード 6へ移動して(ステップ 3406)、ステップ 34 02へ戻る。
[0149] 次に、システム 10は、図 37Aに示されるように、頂点ノードリストから頂点ノード 8を 取り出し (ステップ 3402)、既に説明した子孫ノードの特定手法を用いて頂点ノード 8 の子孫ノードとしてノード 9、ノード 10及びノード 11を特定する(ステップ 3403)。続い て、システム 10は、図 37Bに示されるように、子孫ノードの中にノードタイプがボタン 型であるかどうかをチェックし (ステップ 3404)、子孫ノード 11が検索条件に合致する ことを判定する(Yes)。したがって、システム 10は、図 37Cに示されるように、頂点ノ ード 8を検索結果である検索後の頂点ノードリストに登録し (ステップ 3407)、ステップ 3405へ進む。本例では、頂点ノードリストに次の頂点ノードが存在しないので、シス テム 10は検索処理を終了する。
[0150] 以上の検索処理によって、検索後の頂点ノードリスト [6, 8]が得られる。 [0151] 上記の説明では、頂点ノードの子孫ノードを特定する際に、すべての子孫ノードを 特定している力 例えば、例えば、子ノードまで、孫ノードまでのように、子孫の世代 数を限定することによって検索範囲を限定することも可能である。
[0152] また、上記の例では、検索結果として頂点ノードリストを生成しているが、例えば、図 29A〜Cを参照して説明したようなフラグ領域を準備し、検索条件にヒットしたすべて の子孫ノードのノード識別子を検索結果として生成することも可能である。
[0153] [祖先のパス条件による検索]
次に、本発明の実施の形態に力かる祖先のパス条件による検索方法を説明する。 祖先のパス条件による検索とは、指定されたノードタイプを有するノードを祖先ノード としてもつ頂点ノードを抽出する処理である。図 38A〜Cは、パス条件による検索の 対象となるツリー型データ構造と、ノードの親子関係の「子→親」表現の説明図である 。本例では、頂点ノードは、ノード 2、ノード 7及びノード 9であり、頂点ノードは黒塗り の星印(★)で示されて ヽる。シンボル番号と表示図形とシンボル名の対応関係は、 図 27Bに関して説明した通りである。本例では、頂点ノードの祖先ノードの条件を検 索条件としてノード抽出を行う。より具体的には、祖先ノードにハート型のノードを含 む頂点ノードを抽出する。
[0154] 本例では、親子関係は、深さ優先の「子→親」による表現形式で表されているが、 幅優先の「子→親」による表現形式でも構わない。また、各ノードは、例えば、図 26に 示されるように、項目名情報であるノードタイプ (又は、シンボル番号)と、項目値情報 であるノード値とが関連付けられている。
[0155] コンピュータシステム 10は、検索条件として、ノードのシンボル番号 =3 (シンボル番 号 3はハート形を表す)という条件を設定する。さらに、システム 10は、検索範囲を表 す少なくとも一つの部分ツリーを設定する。本例では、頂点ノード 2、 7、 9を含む頂点 ノードリスト [2, 7, 9]が指定される。この検索条件と検索範囲は、例えば、ユーザが コンピュータシステム 10の入力装置 24を介して入力してもよぐ又は、外部記憶媒体 18から読み出してもよぐ或いは、 IZF22を介して外部力も設定してもよい。頂点ノ ードはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含む ノード群を代表するノードである。 [0156] コンピュータシステム 10は、各頂点ノードについて、前記ノード間の親子関係を迪 つて当該頂点ノードの祖先ノードを特定し、当該頂点ノード又は当該頂点ノードの祖 先ノードに関連付けられた少なくとも一つの実体情報が前記検索条件と一致するか どうかを判定し、一致したノードが存在する場合に、当該頂点ノードに付与されたノー ド識別子を検索結果として保存する。
[0157] 図 39は、本発明の一実施例に力かる祖先のパス条件によるツリー検索方法のフロ 一チャートである。また、図 40A〜図 42Cは、本発明の一実施例に力かる祖先のパ ス条件によるツリー検索方法の動作状態を説明する図である。
[0158] システム 10は、最初に、図 40Aに示されるように、頂点ノードリストから頂点ノードを 読み出すためのアドレスを示すポインタを頂点ノードリストの先頭アドレスで初期化し ( ステップ 3901)、頂点ノードリストから先頭の頂点ノード 2を取り出す (ステップ 3902) 。次に、システム 10は、この頂点ノード 2に対応したシンボル番号 (Symbol No.)を読み 出し (ステップ 3903)、このシンボル番号が 3であるかどうかをチェックする(ステップ 3 904)。頂点ノード 2のシンボル番号は 3ではないため(No)、システム 10はステップ 3 905へ進み、深さ優先の「子→親」による親子関係の表現を参照して、頂点ノード 2の 親ノードがあるかどうかを判定し、この場合、図 40Bに示されるように、親ノード 1が存 在するので (Yes)、システム 10は、親ノード 1に対応したシンボル番号を読み出す( ステップ 3906)。ノード 1に関連付けられたシンボル番号は 5であり、検索条件に合致 しないので (ステップ 3907, No)、システム 10は、ステップ 3905へ戻り、ノード 1の親 ノードが存在するかどうかをチェックする。この場合、図 40Cに示されるように、ノード 1 の親ノード 0が存在し (Yes)、システム 10は、ノード 0に対応したシンボル番号を読み 出す (ステップ 3906)。ノード 0に関連付けられたシンボル番号は 2であり、検索条件 に合致しないので (ステップ 3907, No)、システム 10は、ステップ 3905へ戻り、ノー ド 0の親ノードが存在するかどうかをチェックする。ノード 0はルート'ノードであり、親ノ ードが存在しないため(No)、システム 10はステップ 3909へ進む。
[0159] 頂点ノードリストには次の頂点ノード 7が存在するので、システム 10は、図 41Aに示 されるように、頂点ノードリストから頂点ノードを読み出すためのアドレスを示すポイン タを頂点ノードリストの次のアドレスへ移動し (ステップ 3910)、頂点ノードリストから 2 番目の頂点ノード 7を取り出す (ステップ 3902)。次に、システム 10は、この頂点ノー ド 7に対応したシンボル番号を読み出し (ステップ 3903)、このシンボル番号が 3であ るかどうかをチェックする(ステップ 3904)。頂点ノード 7のシンボル番号は 3ではない ため(No)、システム 10はステップ 3905へ進み、深さ優先の「子→親」による親子関 係の表現を参照して、頂点ノード 7の親ノードがあるかどうかを判定し、この場合、図 4 1Bに示されるように、親ノード 6が存在するので (Yes)、システム 10は、親ノード 6に 対応したシンボル番号を読み出す (ステップ 3906)。ノード 6に関連付けられたシン ボル番号は 3であり、検索条件に合致するので (ステップ 3907, Yes)、システム 10は 、ステップ 3908へ進み、図 41Cに示されるように、現在のポインタが指し示す頂点ノ ード 7を検索結果として検索後の頂点ノードリストに登録する。頂点ノード 7が登録さ れたため、これ以上親ノードを迪る必要がないので、システム 10はステップ 3909へ 進む。
頂点ノードリストには次の頂点ノード 9が存在するので、システム 10は、図 42Aに示 されるように、頂点ノードリストから頂点ノードを読み出すためのアドレスを示すポイン タを頂点ノードリストの次のアドレスへ移動し (ステップ 3910)、頂点ノードリストから 3 番目の頂点ノード 9を取り出す (ステップ 3902)。次に、システム 10は、この頂点ノー ド 9に対応したシンボル番号を読み出し (ステップ 3903)、このシンボル番号が 3であ るかどうかをチェックする(ステップ 3904)。頂点ノード 9のシンボル番号は 3ではない ため(No)、システム 10はステップ 3905へ進み、深さ優先の「子→親」による親子関 係の表現を参照して、頂点ノード 9の親ノードがあるかどうかを判定し、この場合、図 4 2Bに示されるように、親ノード 8が存在するので (Yes)、システム 10は、親ノード 8に 対応したシンボル番号を読み出す (ステップ 3906)。ノード 8に関連付けられたシン ボル番号は 3であり、検索条件に合致するので (ステップ 3907, Yes)、システム 10は 、ステップ 3908へ進み、図 42Cに示されるように、現在のポインタが指し示す頂点ノ ード 9を検索結果として検索後の頂点ノードリストに登録する。頂点ノード 9が登録さ れたため、これ以上親ノードを迪る必要がないので、システム 10はステップ 3909へ 進む。頂点ノードリストには次の頂点ノードが存在しないため(ステップ 3909, No)、 システム 10は検索処理を終了する。 [0161] 以上の検索処理によって、検索後の頂点ノードリスト [7, 9]が得られる。
[0162] 上記の説明では、頂点ノードの祖先ノードを迪る際に、すべての祖先ノードを探索 しているが、祖先の世代数を限定することによって検索範囲を限定することも可能で ある。
[0163] また、上記の例では、検索結果として頂点ノードリストを生成しているが、例えば、図 29A〜Cを参照して説明したようなフラグ領域を準備し、検索条件にヒットしたすべて の子孫ノードのノード識別子を検索結果として生成することも可能である。
[0164] [値条件による検索]
ここまでは、パス条件による検索について説明したが、本発明は値条件による検索 を実施することが可能である。値条件による検索とは、指定された項目値情報 (例え ば、ノード値)が関連付けられたノードを抽出する処理である。例えば、図 26に示され るように、項目名情報 (例えば、ノードタイプ)と項目値情報 (例えば、ノード値)は、ノ ードに対して同じように関連付けられているので、パス条件による検索、すなわち、ノ ードタイプを条件とする検索のアルゴリズムは、値条件による検索、すなわち、ノード 値を条件とする検索に適用できることが明らかである。
[0165] さらに、アプリケーションによっては、すべてのノードが同じノードタイプに関連付け られる場合がある。このようなケースでは、各ノードにノードタイプを関連付ける必要が なくなるので、ノードにはノード値だけが関連付けられ、値条件による検索だけが行わ れる。例えば、本発明のツリー型データ構造が、プログラミング言語の構文解析に適 用される場合、ノードの実体的な値は、分離されたトークン文字列だけであるため、ノ ードには、この文字列だけが関連付けられ、ノードタイプは使用されない。
[0166] [組み合わせ検索]
既に説明したように、検索でヒットしたノードを頂点ノードで代表させることが可能で あり、検索の結果をこの頂点ノードのリスト、すなわち、頂点ノードリストで表現すること ができる。例えば、あるツリー型データ構造のデータを独立した第 1の検索条件と第 2 の検索条件の二つの検索条件で検索した結果をそれぞれ第 1の頂点ノードリストと第 2の頂点ノードリストで表す場合を考える。このとき、第 1の頂点ノードリストと第 2の頂 点ノードリストとの間で上記論理積 (AND)集合演算を実行すると、第 1の検索条件と 第 2の検索条件の両方を満たす検索結果を表す頂点ノードリストが得られる。
[0167] より具体的に、図 27Aのツリー型データ構造のデータに対して、頂点ノードリスト [1 , 6, 8]を検索範囲として、検索条件 1 =「子孫にボタン型 (シンボル番号 = 1)のノー ドが存在する頂点ノード」及び検索条件 2=「子孫に変形四角型 (シンボル番号 =4) のノードが存在する頂点ノード」を検索条件として、検索を実行する例を考える。
[0168] 検索条件 1による検索の結果は、図 28乃至 33を参照して説明したように、頂点ノー ドリスト 1 = [6, 8]である。また、検索条件 2についても検索条件 1と同様の検索を実 行すると、検索の結果は、頂点ノードリスト 2= [1, 8]であることがわかる。さらに、検 索条件 3= (検索条件 1)AND (検索条件 2)を検索条件として、すなわち、検索条件 3=「子孫にボタン型のノードと変形四角型のノードが存在する頂点ノード」を検索条 件として、同様に検索を実行すると、検索の結果は、頂点ノードリスト 3= [8]である。
[0169] 一方、頂点ノードリスト 1 = [6, 8]と頂点ノードリスト 2= [1, 8]の論理積演算を実行 すると、頂点ノードリスト 1と頂点ノードリスト 2は共に正規部分ツリー群であるので、( 頂点ノードリスト 1) AND (頂点ノードリスト 2) = [8] =頂点ノードリスト 3であることがわ かる。
[0170] このように、本発明によれば、複数の検索条件の論理積を検索条件とする検索の結 果は、各検索条件による検索の結果の頂点ノードリストの論理積演算によって得られ る。さらに、論理積の代わりに論理和を用いても同様に、複数の検索条件の論理和を 検索条件とする検索の結果は、各検索条件による検索の結果の頂点ノードリストの論 理和演算によって得られる。
[0171] [ツリーデータ集計の概要]
ツリーデータの集計は、一般に、ツリーのある範囲のノードに関連付けられた項目 値情報を項目名情報ごとに分類して集計する。集計には、集計の測度である項目値 情報の個数のカウント、或いは、合計値、平均値、最大値、最小値などの計算のよう に様々な処理が含まれる。集計の対象である測度は、例えば、ノードに関連付けられ た特定のノードタイプに対応したノード値である。集計の範囲は、例えば、部分ツリー 群であり、部分ツリーの頂点ノードのリスト、すなわち、頂点ノードリストによって指定で きる。集計の分類対象である次元は、例えば、ノードに関連付けられた特定のノード タイプに対応したノード値である。
[0172] 図 43A、 Bは、本発明の一実施例に力かる集計を説明するための図であり、図 43A は集計の対象となるツリー型データ構造とノードの親子関係の「子→親」表現の説明 図であり、図 43Bはシンボル番号と表示図形とシンボル名の対応関係を表す図であ る。図 43A、 Bに示された例を参照して、 2種類のツリーデータ集計を説明する。
[0173] 第 1のツリーデータ集計とは、例えば、メーカ名(次元)ごとに、重量 (測度)の件数と 合計を算出することである。そして、集計の範囲を指定するために、この例では、頂 点ノードリスト = [1, 6, 8]が使用される。勿論、集計の範囲は、ツリー全体でも構わ ない。
[0174] 上記の例では、次元を指定して!/、るが、ツリーデータ集計では次元を指定しな 、集 計、すなわち、第 2のツリーデータ集計も考えられる。例えば、頂点ノードリストを指定 し、頂点ノードごとに測度を集計することができる。第 2のツリーデータ集計は、この頂 点ノード、すなわち、部分ツリーを明示的に指定するタイプの集計である。第 2のッリ 一データ集計は、図 43A、 Bの例では、頂点ノードリスト = [1, 6, 8]を指定し、頂点 ノード 1、頂点ノード 6及び頂点ノード 8のそれぞれについて、頂点ノードで表された 部分ツリーに含まれるノードに関連付けられた重量 (測度)の件数と合計を算出する。
[0175] [第 1のツリーデータ集計]
次に、第 1のツリーデータ集計を詳細に説明する。この集計は、集計の対象 =測度 、集計の範囲 =カテゴリ、集計の分類対象 =次元を指定して集計を行う。
[0176] ツリー型データ構造のデータは、図 43Aに示されるように、ルート'ノードとルート'ノ ード以外のノードである非ルート'ノードを含み、集計を行うコンピュータシステム 10の 記憶装置、例えば、 RAM14に展開されている。ノード間の親子関係は、ルート'ノー ドを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノード識別子を 付与し、非ルート'ノードの各々に付与されたノード識別子に非ルート'ノードの各々 の親ノードに付与されたノード識別子を関連付けることにより定義される。各ノードは データを表す少なくとも一つの実体情報が関連付けられている。また、頂点ノードは ツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含むノード 群を代表するノードである。 [0177] コンピュータシステム 10は、集計の分類対象を表す項目名情報を指定し、集計の 対象を表す項目名情報を指定し、集計の範囲を表す少なくとも一つの部分ツリーを 指定する。集計の分類対象、集計の対象、及び、集計の範囲は、例えば、ユーザが コンピュータシステム 10の入力装置 24を介して入力してもよぐ又は、外部記憶媒体 18から読み出してもよぐ或いは、 IZF22を介して外部力も設定してもよい。
[0178] 次に、コンピュータシステム 10は、各頂点ノードについて、前記ノード間の親子関係 を迪つて当該頂点ノードの子孫ノードを特定し、当該頂点ノード又は当該頂点ノード の子孫ノードに関連付けられた項目名情報が集計の対象を表す項目名情報と一致 するかどうかを判定し、一致したノードに関連付けられた項目値情報を、当該頂点ノ ードによって代表されたノード群に関係した集計の分類対象を表す項目名情報に関 連付けられた項目値情報毎に集計する。
[0179] 第 1のツリーデータ集計の一実施例では、頂点ノードリストと次元と測度を指定して 、頂点ノードリストで指定される範囲のノードに存在している次元値、測度を集計する 。この場合、ある頂点ノードで指定される範囲(すなわち、部分ツリー)に同じ次元の 次元値が関連付けられたノードが複数個存在する場合、測度がどの次元値に属する かを別途指定する必要がある。そこで、以下の例では、簡単のため、「部分ツリー内 に同じ次元の次元値が関連付けられた複数のノードが存在する場合には集計を行 わな 、」 t 、う規則を適用することにする。
[0180] 図 43Aに示された例を参照して、次元と集計実施可能性との関係を詳述する。図 4 4A〜Dは、図 43Aの各頂点ノードによって代表される部分ツリーの説明図である。こ こで、メーカ名(次元)ごとに、重量 (測度)の件数と合計を算出する集計を行うことを 考える。
[0181] 図 44Aは、頂点ノード 1によって代表される部分ツリー 1を表し、ノード 2とノード 5の 二つのノードに次元であるメーカ名が関連付けられて 、るので、ノード 1とノード 3に 関連付けられた重量がどのメーカ名に属しているかを特定できない。したがって、部 分ツリー 1に対する集計は実施しな 、。
[0182] 図 44Bは、頂点ノード 6によって代表される部分ツリー 2を表している。この部分ッリ 一 2には、次元であるメーカ名が関連付けられたノードは存在しないが、測度である 重量が関連付けられたノード 7が存在する。このように、次元が存在しない場合には、 次元値が NULL値であるとして、集計を実施することにする。
[0183] 図 44Cは、頂点ノード 8によって代表される部分ツリー 3を表している。この部分ッリ 一 3には、次元であるメーカ名が関連付けられたノード 10が存在し、測度である重量 が関連付けられたノード 9及びノード 11が存在する。このように、次元が 1個だけ存在 し、 1個以上の測度が存在する部分ツリーの場合、各測度がどの次元値に属するか を特定できるので、唯一の次元値について、 1個以上の測度を集計する。
[0184] 以上の規則に従って、メーカ名(次元)ごとに、重量 (測度)の件数と合計を集計す ると、図 44Dに示されるような集計結果が得られる。すなわち、メーカ名 =「NULL」 に対応した重量は、ノード 7に関連付けられた重量 1件であり、その重量の合計 =「ノ ード 7に関連付けられたノード値」である。また、メーカ名 =「ノード 10に関連付けられ たノード値」に対応した重量は、ノード 9とノード 11に関連付けられた重量 2件であり、 その重量の合計 =「ノード 9に関連付けられたノード値 +ノード 11に関連付けられた ノード値」である。
[0185] 図 45は、本発明の一実施例に力かる第 1のツリーデータ集計方法のフローチャート である。また、図 46乃至 48は、本発明の一実施例に力かる第 1のツリーデータ集計 方法の動作状態を説明する図である。
[0186] システム 10は、最初に、図 46に示されるように、頂点ノードリストから頂点ノードを読 み出すためのアドレスを示すポインタを頂点ノードリストの先頭アドレスで初期化し (ス テツプ 4501)、頂点ノードリストから先頭の頂点ノード 1を取り出す (ステップ 4502)。 次に、システム 10は、深さ優先の「子→親」による親子関係の表現を参照して、頂点 ノード 1の部分ツリーを特定する (ステップ 4504)。一般に、深さ優先の「子→親」によ る親子関係の表現は上記の優れた性質を備えているので、部分ツリーは、頂点ノー ドに付与されたノード識別子が格納されて 、る位置の次の位置から、この頂点ノード に付与されたノード識別子の値以上の値が格納されている連続領域を抽出すること により特定することができる。本例では、 C→Pにおいて、ノード 1に付与されたノード 識別子 0が格納されている位置から、このノード 1のノード識別子 1以上の値が格納さ れている位置までの連続領域、すなわち、ノード識別子 0, 1、 2、 2、 1が格納されて いる領域が頂点ノード 1によって表される部分ツリーである。この領域は、ノード 1、ノ ード 2、ノード 3、ノード 4及びノード 5に付与されたノード識別子を格納する領域であ るため、部分ツリーは、ノード 1、ノード 2、ノード 3、ノード 4及びノード 5であることがわ かる(図 46の※ 1)。
[0187] 次に、システム 10は、特定された部分ツリーの中で、測度(=重量)と次元(=メ一 力名)に関連付けられているノードを特定する (ステップ 4504)。本例では、ノード 1の ノードタイプは重量であり、ノード 2のノードタイプはメーカ名であり、ノード 3のノードタ ィプは重量であり、ノード 4のノードタイプは価格であり、ノード 5のノードタイプはメー 力名である(図 46の※ 2)。したがって、本例では、測度が 2個存在し、次元も 2個存 在する。システム 10は、測度の個数力 ^個であるかどうかを判定すると (ステップ 450
5)、測度の個数は 0個ではないことがわ力り(No)、次に、次元の個数が 2個以上で あるかどうかを判定する(ステップ 4506)。次元の個数は 2個以上であり(Yes)、この 部分ツリーは集計の対象外であるため、システム 10は、次の頂点ノードが存在するか どうかを判定する (ステップ 4511)。本例の場合、頂点ノードリストに次の頂点ノード 6 が存在するので (Yes)、システム 10はポインタを頂点ノード 6へ移動して (ステップ 45 12)、ステップ 4502へ戻る。
[0188] 次に、システム 10は、図 47に示されるように、頂点ノードリストから頂点ノード 6を取 り出し (ステップ 4502)、既に説明した方法と同様に頂点ノード 6で代表される部分ッ リーを特定すると (ステップ 4503)、この部分ツリーにノード 6及びノード 7が属してい ることわかる(図 47の※ 1)。
[0189] 次に、システム 10は、特定された部分ツリーの中で、測度(=重量)と次元(=メ一 力名)に関連付けられているノードを特定する (ステップ 4504)。本例では、ノード 6の ノードタイプは価格であり、ノード 7のノードタイプは重量である(図 47の※ 2)。したが つて、本例では、測度が 1個存在し、次元は 0個である。システム 10は、測度の個数 力 SO個であるかどうかを判定すると (ステップ 4505)、測度の個数は 0個ではないこと がわかり(No)、次に、次元の個数が 2個以上であるかどうかを判定する(ステップ 45
06)。次元の個数は 2個以上ではなく(No)、次元の個数が 1個であるかどうかを判定 すると (ステップ 4507)、次元の個数が 1個ではないため(No)、次元値を NULL値と みなし (ステップ 4508)、測度を集計する (ステップ 4510)。本例では、頂点ノード 6 で代表される部分ツリーの重量の件数は 1件であり、重量の合計は、ノード 7に関連 付けられたノード値の値である(図示されない)。さらに、システム 10は、次の頂点ノー ドが存在するかどうかを判定する (ステップ 4511)。本例の場合、頂点ノードリストに 次の頂点ノード 8が存在するので (Yes)、システム 10はポインタを頂点ノード 8へ移 動して(ステップ 4512)ゝステップ 4502へ戻る。
[0190] 次に、システム 10は、図 48に示されるように、頂点ノードリストから頂点ノード 8を取 り出し (ステップ 4502)、既に説明した方法と同様に頂点ノード 8で代表される部分ッ リーを特定すると (ステップ 4503)、この部分ツリーにノード 8、ノード 9、ノード 10及び ノード 11が属して 、ることわかる(図 48の※ 1)。
[0191] 次に、システム 10は、特定された部分ツリーの中で、測度(=重量)と次元(=メ一 力名)に関連付けられているノードを特定する (ステップ 4504)。本例では、ノード 8の ノードタイプは価格であり、ノード 9のノードタイプは重量であり、ノード 10のノードタイ プはメーカ名であり、ノード 11のノードタイプは重量である(図 48の※ 2)。したがって 、本例では、測度が 2個存在し、次元が 1個存在する。システム 10は、測度の個数が 0個であるかどうかを判定すると (ステップ 4505)、測度の個数は 0個ではないことが わかり(No)、次に、次元の個数が 2個以上であるかどうかを判定する(ステップ 4506 )。次元の個数は 2個以上ではなく(No)、次元の個数が 1個であるかどうかを判定す ると (ステップ 4507)、次元の個数が 1個であるため(Yes)、ノード 10に関連付けられ たノード値を次元値として (ステップ 4509)、測度^^計する(ステップ 4510)。本例 では、頂点ノード 8で代表される部分ツリーの重量の件数は 2件であり、重量の合計 は、ノード 9に関連付けられたノード値の値と、ノード 11に割り当てられたノード値の 値との合計である(図示されない)。
[0192] さらに、システム 10は、次の頂点ノードが存在するかどうかを判定する(ステップ 45 11)。本例の場合、頂点ノードリストにこれ以上頂点ノードが存在しないため(No)、シ ステム 10は、部分ツリー毎に得られた集計結果を統合する (ステップ 4513)。本例で は、集計の次元値は、 NULL値と、ノード 10に割り当てられたメーカ名(ノード 10に 関連付けられたノード値)であり、 NULL値に対応する重量の件数は 1件であり、重 量の合計は、ノード 7〖こ割り当てられた重量 (ノード 7〖こ関連付けられたノード値)であ り、ノード 10に割り当てられたメーカ名に対応する重量の件数は 2件であり、重量の 合計は、ノード 9〖こ関連付けられたノード値の値と、ノード 11に割り当てられたノード 値の値との合計である。以上の処理により、本発明の一実施例による第 1のッリーデ ータ集計方法が終了する。
[0193] 上記の説明では、頂点ノードによって代表される部分ツリーを特定する際に、すべ ての子孫ノードを特定している力 例えば、例えば、子ノードまで、孫ノードまでのよう に、子孫の世代数を限定することによって集計範囲を限定することも可能である。
[0194] また、上記の例では、ノード間の親子関係が深さ優先モードで表現されているが、 幅優先モードで表現し、そこ力 部分ツリーを特定しても構わな 、。
[0195] [第 2のツリーデータ集計]
次に、次元を指定しない第 2のツリーデータ集計方法をより詳しく説明する。
[0196] ツリー型データ構造のデータは、図 43Aに示されるように、ルート'ノードとルート'ノ ード以外のノードである非ルート'ノードを含み、集計を行うコンピュータシステム 10の 記憶装置、例えば、 RAM14に展開されている。ノード間の親子関係は、ルート'ノー ドを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノード識別子を 付与し、非ルート'ノードの各々に付与されたノード識別子に非ルート'ノードの各々 の親ノードに付与されたノード識別子を関連付けることにより定義される。各ノードは データを表す少なくとも一つの実体情報が関連付けられている。また、頂点ノードは ツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含むノード 群を代表するノードである。
[0197] コンピュータシステム 10は、集計の分類対象を表す項目名情報を指定し、集計の 範囲を表す少なくとも一つの部分ツリーを指定する。集計の分類対象、及び、集計の 範囲は、例えば、ユーザがコンピュータシステム 10の入力装置 24を介して入力して もよぐ又は、外部記憶媒体 18から読み出してもよぐ或いは、 IZF22を介して外部 力も設定してもよい。
[0198] 次に、コンピュータシステム 10は、各頂点ノードについて、前記ノード間の親子関係 を迪つて当該頂点ノードの子孫ノードを特定し、当該頂点ノード及び Z又は当該頂 点ノードの子孫ノードに関連付けられた項目名情報が集計の対象と一致するかどう かを判定し、一致したノードに関連付けられた項目値情報を集計する。
[0199] 図 43A、 Bの例では、第 2のツリーデータ集計方法は、頂点ノードリスト = [1, 6, 8] を指定し、頂点ノード 1、頂点ノード 6及び頂点ノード 8のそれぞれについて、頂点ノ ードで表された部分ツリーに含まれるノードに関連付けられた重量 (測度)の件数と合 計を算出する。図 49は本発明の一実施例に力かる第 2のツリーデータ集計方法のフ ローチャートであり、図 50A〜Dはこの第 2のツリーデータ集計方法の動作状態の説 明図である。
[0200] 図 49に示されるように、第 2のツリーデータ集計方法は、図 45に示された第 1のッリ 一データ集計方法と類似した動作を実行するが、次元を定義しないため、次元につ いての処理は省略され、また、部分ツリー毎の集計結果を統合する処理も省かれて いる。
[0201] システム 10は、頂点ノードリストから頂点ノードを取り出し、その部分ツリーを特定す ること〖こより(図 49のステップ 4902、ステップ 4903)、図 50A、 B及び Cに示されるよ うな部分ツリー 1、部分ツリー 2及び部分ツリー 3を特定し、それぞれの部分ツリーにつ いて、重量の件数と重量の合計を算出する(ステップ 4906)。図 50Dには、頂点ノー ド毎の集計結果が示されて 、る。
[0202] 上記の説明では、頂点ノードによって代表される部分ツリーを特定する際に、すべ ての子孫ノードを特定している力 例えば、例えば、子ノードまで、孫ノードまでのよう に、子孫の世代数を限定することによって集計範囲を限定することも可能である。
[0203] また、上記の例では、ノード間の親子関係が深さ優先モードで表現されているが、 幅優先モードで表現し、そこ力 部分ツリーを特定しても構わな 、。
[0204] [ツリーデータソートの概要]
本発明に力かるツリーデータのソート処理は、記憶装置に展開されたルート'ノード とルート'ノード以外のノードである非ルート ·ノードを含むツリー型データ構造のデー タの少なくとも二つのノード群 (ノードの集まり、例えば、部分ツリー)に順序を付ける 処理である。以下では、簡単のため、ノード群が部分ツリーである場合について説明 する。 [0205] 本発明のツリーデータのソート処理は、個々の部分ツリーに関連付けられたある指 標 (比較基準値)を収集し、次に、この指標に順序関係を付けることにより、部分ッリ 一自体に順序を付けることにより実現される。
[0206] ソート処理は、指標の収集の仕方によって二通りに大別できる。第 1のツリーデータ ソート方法は、集計の結果を利用する方法である。例えば、上記の第 2のッリーデ一 タ集計方法では、部分ツリー毎に集計結果が収集されている。したがって、例えば、 図 50A〜Dの例において、部分ツリー 1〜3を「重量の件数」の多い順に並べることが 要求された場合、図 50Dに示された「重量の件数」を指標として用いると、この指標の 大小関係に応じて、部分ツリー 1〜3に順序関係を定義することができ、すなわち、部 分ツリー 1〜3をソートすることができる。
[0207] これに対して、第 2のツリーデータソート方法は、集計結果を利用するのではなぐ 部分ツリーのノードに関連付けられた情報をそのまま指標として利用して、部分ツリー に順序関係を定義する。第 2のツリーデータソート方法は、例えば、図 50A〜Dの例 では、部分ツリーの中で、ノードタイプが「価格」であるノードのノード値、すなわち、「 価格の値」の順に部分ツリーをソートする。
[0208] [第 1のツリーデータソート]
本発明の一実施例に力かる第 1のツリーデータソート方法は、例えば、図 43Aに示 されるようなツリー型データ構造のデータの頂点ノード 1、頂点ノード 6及び頂点ノード 8でそれぞれ表される部分ツリー 1 (図 50A)、部分ツリー 2 (図 50B)及び部分ツリー 3 (図 50C)を重量の件数を指標としてソートする。
[0209] コンピュータシステム 10の記憶装置、例えば、 RAM14には、ルート'ノードとルート •ノード以外のノードである非ルート'ノードを含むツリー型データ構造のデータが展 開されている。ノード間の親子関係は、図 43Aに示されるように、ルート'ノードを含む 全ノードに同じ世代のノードよりも子ノードを優先して固有のノード識別子を付与し、 非ルート ·ノードの各々に付与されたノード識別子に非ルート ·ノードの各々の親ノー ドに付与されたノード識別子を関連付けることにより表現されている。各ノードはデー タの項目を表す項目名情報 (例えば、ノードタイプ)とデータの項目値を表す項目値 情報 (例えば、ノード値)とが関連付けられ、各ノード群 (例えば、部分ツリー 1、部分 ツリー 2及び部分ツリー 3)は当該ノード群を代表する頂点ノード (例えば、頂点ノード 1、頂点ノード 6及び頂点ノード 8)及び当該頂点ノードの子孫ノードを含む。
[0210] コンピュータシステム 10は、集計の対象を表す項目名情報 (例えば、ノードタイプ = 「重量」)を指定し、集計の範囲を表す少なくとも二つの頂点ノード (例えば、頂点ノー ド 1、頂点ノード 6及び頂点ノード 8を含む頂点ノードリストを指定する。集計の対象、 及び、集計の範囲は、例えば、ユーザがコンピュータシステム 10の入力装置 24を介 して入力してもよく、又は、外部記憶媒体 18から読み出してもよぐ或いは、 I/F22 を介して外部力も設定してもよ!/、。
[0211] 次に、コンピュータシステム 10は、各頂点ノードについて、前記ノード間の親子関係 を迪つて当該頂点ノードの子孫ノードを特定し、当該頂点ノード又は当該頂点ノード の子孫ノードに関連付けられた項目名情報が集計の対象と一致するかどうかを判定 し、一致したノードに関連付けられた項目値情報を集計する。この集計は、例えば、 図 49および図 50A〜Dを参照して説明した上記の第 2のツリーデータ集計方法を実 行する。図 51A〜Cは、本発明の一実施例に力かる第 1のツリーデータソート方法の 説明図であり、図 51Aには、第 2のツリーデータ集計方法を実行することにより得られ た比較基準値の収集結果が示されている。本例では、頂点ノード毎の重量の件数が 比較基準値の収集結果である。
[0212] 次に、コンピュータシステム 10は、頂点ノード毎に集計された項目値情報の順序関 係に従って当該少なくとも二つの頂点ノードに順序を付けることにより、当該頂点ノー ドによって代表されるノード群に順序を付ける。本例では、頂点ノード 1に対応する重 量の件数である 2と、頂点ノード 6に対応する重量の件数である 1と、頂点ノード 8に対 応する重量の件数である 2を、昇順に並べ換えることにより、頂点ノードに順序が付け られる。この順序付けにより、頂点ノードは、頂点ノード 6、頂点ノード 1、頂点ノード 8 の順に並べられる。例えば、比較基準値が一致する場合には、元の頂点ノードの順 番を保存して頂点ノードの順序付けを行う。図 51Bは、このようにして得られた比較基 準値のソート結果である。頂点ノードに順序を付けることにより、図 51Cに示されるよう に、これらの頂点ノードによって代表される部分ツリーに順序を付けることができる。
[0213] 上記の説明では、頂点ノードによって代表される部分ツリーを特定する際に、すべ ての子孫ノードを特定している力 例えば、例えば、子ノードまで、孫ノードまでのよう に、子孫の世代数を限定することによって集計範囲を限定することも可能である。
[0214] また、上記の例では、ノード間の親子関係が深さ優先モードで表現されているが、 幅優先モードで表現し、そこ力 部分ツリーを特定しても構わな 、。
[0215] [第 2のツリーデータソート]
次に、本発明の一実施例にかかる第 2のツリーデータソート方法について説明する 。図 52A〜Cは、本発明の一実施例に力かる第 2のツリーデータソート方法の処理の 対象となるツリー型データ構造及びノードの親子関係の「子→親」表現(図 52A)と、 ノードタイプ毎のノード値のリスト(図 52B)と、ノードに関連付けられたノードタイプ及 びノード値 (図 52C)と、を説明する図である。頂点ノードは黒塗りの星印(★)で示さ れている。本例では、各ノードの項目名情報であるノードタイプは、シンボル番号(= Symbol No. )によって表される。図形とシンボル番号との対応関係は、図 43Bに 示されている。
[0216] 本例では、各ノードの項目値情報であるノード値は、シンボル番号と値番号( = VN o)を組み合わせて表される。シンボル番号毎に、すなわち、ノードタイプ毎に、そのノ ードタイプが表す項目の値が昇順 (又は降順)に配置された値リスト(=VL)が設けら れる。値番号は、値リストへのポインタであり、例えば、ノード Xにシンボル番号 iと値番 号 jが関連付けられている場合、ノード Xのノード値は、シンボル番号 iに固有の値リス トの j番目の要素を参照することによって取得できる(例えば、先頭の要素が 0番目の 要素であるとする)。このような値番号と値リストの組み合わせによって実際の値を指 定する方式は、本願発明者によって提案されている(例えば、国際公開第 WOOOZ 10103号パンフレットを参照のこと)。
[0217] 例えば、図 52A〜Cに示されたツリーデータにおいて、頂点ノード 1、頂点ノード 6 及び頂点ノード 8によって代表される部分ツリーをそれぞれ部分ツリー 1、部分ツリー 2及び部分ツリー 3とする。各部分ツリーに属する価格の値を参照するためには、最 初に、各部分ツリーに属するノードの中で、ノードタイプ =「価格」に関連付けられたノ ードを特定し、次に、特定されたノードに関連付けられたノード値を参照することが必 要である。部分ツリー 1には、ノード 1、ノード 2、ノード 3、ノード 4及びノード 5が属して いる。これらのノードの中で、ノードタイプが「価格」であるノードには、シンボル番号 =
「2」が関連付けられている。同図の例では、ノード 4はシンボル番号 =「2」が関連付 けられている。よって、ノード 4はノードタイプ =「価格」である。次に、ノード 4の価格の 値を参照するため、最初に、ノード 4に関連付けられた値番号を参照すると、値番号 =「3」である。したがって、ノード 4〖こ関連付けられたノード値は、シンボル番号 =「2」 に対応した値リスト、すなわち、(価格) VLの値番号 3に対応した要素 (すなわち、先 頭力 4番目の要素)である。本例では、(価格) VLの値番号 3に対応した要素は「2 00」である。このようにして、ノード 4に関連付けられたノード値が取得される。
[0218] コンピュータシステム 10の記憶装置、例えば、 RAM14には、図 52A〜Cに示され るように、ルート'ノードとルート'ノード以外のノードである非ルート ·ノードを含むッリ 一型データ構造のデータが展開されている。ノード間の親子関係は、ルート'ノードを 含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノード識別子を付与 し、非ルート'ノードの各々に付与されたノード識別子に非ルート'ノードの各々の親ノ ードに付与されたノード識別子を関連付けることにより定義される。各ノードはデータ を表す少なくとも一つの実体情報が関連付けられ、各ノード群は当該ノード群を代表 する頂点ノードである特定のノード及び当該特定のノードの子孫ノードを含む。
[0219] 次に、コンピュータシステム 10は、順序付けの対象となる少なくとも二つのノード群 を表す頂点ノードを指定し、順序付けの指標となる項目名情報を指定する順序付け の対象 (例えば、頂点ノードリスト)、及び、順序付けの指標(例えば、ノードタイプ)は 、例えば、ユーザがコンピュータシステム 10の入力装置 24を介して入力してもよぐ 又は、外部記憶媒体 18から読み出してもよぐ或いは、 IZF22を介して外部カも設 定してちよい。
[0220] 次に、コンピュータシステム 10は、各頂点ノードについて、前記ノード間の親子関係 を迪つて当該頂点ノードの子孫ノードを特定し、当該頂点ノード又は当該頂点ノード の子孫ノードの中で、順序付けの指標となる項目名情報が関連付けられたノードに 関連付けられた項目値情報を取得する。図 52A〜Cの例では、上記の方法でノード 値を取得すればよい。
[0221] さらに、コンピュータシステム 10は、頂点ノード毎に取得された項目値情報の順序 関係(例えば、取得されたノード値の大小関係)に従って当該少なくとも二つの頂点ノ ードに順序を付けることにより、当該頂点ノードによって代表されるノード群 (例えば、 部分ツリー)に順序を付ける。
[0222] 次に、ノード値の取得と部分ツリーの順序付けについてより詳細に説明する。図 53 は、本発明の一実施例に力かる第 2のツリーデータソート方法のフローチャートである 。コンピュータシステム 10は、頂点ノードリスト及び指標を指定し (ステップ 5301)、作 業用領域を初期化する (ステップ 5302)。続いて、コンピュータシステム 10は、頂点ノ 一ドリスト(= [1, 6, 8])の各頂点ノードについて、順序付けの指標値(=価格の値) に対応した値番号を取得する(ステップ 5303)。続いて、コンピュータシステム 10は、 各頂点ノードについて取得された値番号の出現回数をカウントし (ステップ 5304)、さ らに、値番号毎にカウントされた出現回数を累計数化する (ステップ 5305)。最後に、 コンピュータシステム 10は、頂点ノードリスト中の各頂点ノードを、累計数に基づいて 、各頂点ノードに対応した値番号の順番にソートする (ステップ 5306)。尚、値番号の 順序 (昇順又は降順)はソートの順番に対応して 、る。
[0223] 図 54乃至 62は、図 52A〜Cに示されたツリー型データ構造のデータに本発明の 一実施例に力かる第 2のツリーデータソート方法を適用したときの動作状態を説明す る図である。
[0224] コンピュータシステム 10は、図 54に示されるように、ソート前頂点ノードリスト = [1, 6, 8]を指定し (ステップ 5301)、このソート前頂点ノードリストと同じサイズの一時的 値番号格納領域 Tmp—VNo、及び、ソート後頂点ノードリスト格納領域を用意し、ま た、価格の値リスト VLと同じサイズのカウント領域 Countを用意する(ステップ 5302)
[0225] 次に、コンピュータシステム 10は、図 55に示されるように、頂点ノードリストから 1番 目の頂点ノード 1を取り出し、頂点ノード 1に対応した部分ツリーを特定する(図 55の ※ェ)。次に、コンピュータシステム 10は、部分ツリーの中で、シンボル番号 = 2である ノード (すなわち、ノードタイプ力 ^価格」であるノード)を特定し、その特定されたノード に関連付けられた値番号 VNoである「3」を、 Tmp— VNoの 1番目の領域に格納す る(図 55の※ 2)。次に、コンピュータシステム 10は、図 56に示されるように、頂点ノー ドリストから 2番目の頂点ノード 6を取り出し、頂点ノード 6に対応した部分ツリーを特定 する(図 56の※ 1)。次に、コンピュータシステム 10は、部分ツリーの中で、シンボル 番号 = 2であるノード (すなわち、ノードタイプが「価格」であるノード)を特定し、その 特定されたノードに関連付けられた値番号 VNoである「2」を、 Tmp— VNoの 2番目 の領域に格納する(図 56の※ 2)。次に、コンピュータシステム 10は、図 57に示される ように、頂点ノードリストから 3番目の頂点ノード 8を取り出し、頂点ノード 8に対応した 部分ツリーを特定する(図 57の※ 1)。次に、コンピュータシステム 10は、部分ツリー の中で、シンボル番号 = 2であるノード(すなわち、ノードタイプが「価格」であるノード )を特定し、その特定されたノードに関連付けられた値番号 VNoである「1」を、 Tmp VNoの 3番目の領域に格納する(図 57の※ 2)。これにより、コンピュータシステム 1 0は頂点ノードに関連した値番号を取得できる (ステップ 5303)。
[0226] コンピュータシステム 10は、次に、頂点ノードリストに対応した Tmp— VNoに格納さ れた値番号の出現回数 (存在数)をカウントする (ステップ 5304)。図 58に示されるよ うに、頂点ノードリストの先頭の要素 =頂点ノード 1に対応した Tmp— VNoの要素 T mp-VNo [0]が「3」であるため、値番号 = 3に対応したカウント領域の要素 Count [ 3]をインクリメントし、同様に、 Tmp— VNo [l] = 2であるため、 Count[2]をインクリ メントし、 Tmp— VNo[2] = lであるため、 Count [1]をインクリメントする。これにより 、図 58の完成した Countが得られる。
[0227] コンピュータシステム 10は、次に、 Countの要素を累計して、カウント配列 Countを 累計数配列 Aggrに変換する (ステップ 5305)。図 59に示されるように、カウント配列 Count 、
Count [0] =0
Count[l] = l
Count[2] = l
Count[3] = l
であるので、累計数配列 Aggrの要素は、
Aggr[0] =0
Aggr [ 1 ] = Count [0] = 0 Aggr[2] = Count [0] + Count [1] = 1
Aggr[3] = Count [0] + Count [1] + Count [2] = 2
となる。尚、説明の便宜上、カウント配列 Countと累計数配列 Aggrは区別されている 力 物理的にはカウント配列 Countの領域と累計数配列 Aggrの領域が同じ領域で も構わない。このようにして得られた累計数配列 Aggrは、ステップ 5303で取得され た値番号を昇順に並べたときに(同じ値番号が 2個以上存在するときには、その個数 分が重複して並べられる)、各値番号の先頭の位置を示している。本例では、値番号
= 3、値番号 = 2、値番号 = 1が 1回ずつ出現しているので、これらの値番号を昇順 に並べると、
値番号 = 1
値番号 = 2
値番号 = 3
の順番になる。このとき、値番号 =0は存在しないので、値番号の昇順配列における 値番号 = 0の先頭の位置はアドレス 0 ( = Aggr [0] )であり、値番号 = 1の先頭の位置 はアドレス 0 (=Aggr[l])であり、値番号 2の先頭の位置はアドレス 1 (= Aggr [2]) であり、値番号 3の先頭の位置はアドレス 2 (= Aggr [3])である。このようにして、図 5 9に示されるよう〖こ、累計数配列 Aggrが得られる。この累計数配列 Aggrは、ソート後 頂点ノードリストの格納位置を示すポインタの配列であるとみなすことができる。
[0228] 最後に、コンピュータシステム 10は、累計数配列 Aggrを利用して、頂点ノードリスト 中の頂点ノードを、その頂点ノードに関連付けられた値番号の順に並べ換える (ステ ップ 5306)。
[0229] コンピュータシステム 10は、図 60に示されるように、頂点ノードリストから 1番目の要 素であるソート前頂点ノードリスト [0] =頂点ノード 1を取り出し、頂点ノード 1に対応し た Tmp— VNo [0] = 3が指し示す累計数配列 Aggrの要素である Aggr [3] = 2によ つて示されるソート後頂点ノードリストの要素、すなわち、ソート後頂点ノードリスト [2] に、ソート前頂点ノードリスト [0] = 1をセットする。そして、 Aggr [3]をインクリメントす る。このインクリメントによって、ソート後頂点ノードリストの格納位置を示すポインタが 次の位置へ移動するので、値番号が重複している場合でも、正しく頂点ノードリストを ソー卜することがでさる。
[0230] コンピュータシステム 10は、図 61に示されるように、ソート前頂点ノードリストの要素 であるソート前頂点ノードリスト [1] =6に対しても同様に、頂点ノード 6に対応した Tm p—VNo [l] = 2が指し示す累計数配列 Aggrの要素である Aggr[2] = 1によって示 されるソート後頂点ノードリストの要素、すなわち、ソート後頂点ノードリスト [1]に、ソ ート前頂点ノードリスト [1] =6をセットする。そして、 Aggr [2]をインクリメントする。
[0231] さらに、コンピュータシステム 10は、図 62Aに示されるように、ソート前頂点ノードリス トの要素であるソート前頂点ノードリスト [3] =8に対しても同様に、頂点ノード 8に対 応した Tmp— VNo [2] = 1が指し示す累計数配列 Aggrの要素である Aggr[l] =0 によって示されるソート後頂点ノードリストの要素、すなわち、ソート後頂点ノードリスト [0]に、ソート前頂点ノードリスト [2] =8をセットする。そして、 Aggr [1]をインクリメン トする。
[0232] 以上の処理により、コンピュータシステム 10は、図 62Bに示されるように、ソート前頂 点ノードリストを、価格で昇順にソートすることにより、ソート後頂点ノードリストに変換 することができる。
[0233] 尚、以上の説明では、ある項目名情報 (例えば、あるノードタイプ)の値カ^ートの指 標として指定されたときに、一つの部分ツリーには、その項目名情報が関連付けられ ているノードが一つである例に関して第 2のツリーデータソートを記述している力 一 つの部分ツリー内に、指標としてヒットするノードが 2個以上存在する場合がある。そ の場合には、ソートの目的や仕様等のアプリケーションに応じて一つのノードを選択 する。また、一つの部分ツリー内に、指標としてヒットするノードが存在しない場合、そ の部分ツリーは、アプリケーションに応じて、ソートの対象から外す、又は、最下位の 順番を付与する、などの取扱をすることができる。
[0234] さらに、上記の説明では、頂点ノードによって代表される部分ツリーを特定する際に 、すべての子孫ノードを特定している力 例えば、例えば、子ノードまで、孫ノードまで のように、子孫の世代数を限定することによって集計範囲を限定することも可能であ る。
[0235] また、上記の例では、ノード間の親子関係が深さ優先モードで表現されているが、 幅優先モードで表現し、そこ力 部分ツリーを特定しても構わな 、。
[0236] [ツリー群への拡張]
ここまでの説明では、ツリー型データ構造のデータの検索、集計及びソートは、ル ート ·ノードとルート ·ノード以外のノードである非ルート'ノードを含む一つのッリーデ ータを処理の対象としている。しかし、実際的なアプリケーションでは、ツリー型データ 構造のデータは、複数のツリーデータにより構成される場合がある。このような場合に は、各ツリーデータは、ツリー識別子が付与され、このツリー識別子によって区別され る。そして、本発明は、各ツリーデータに対して、上記のツリー型データ構造のデータ の検索、集計及びソートの方法を実施することにより、複数のツリーデータを含むッリ 一型データ構造のデータにも適用可能である。
[0237] 図 63A〜Eは、複数のツリーデータにより構成されたツリー型データ構造のデータ、 すなわち、ツリー群の一例を示す図である。同図の例では、ある製品の生産するため に必要な部品の仕入れに関する情報 (仕入先、メーカ、品番、重量、価格など)がッリ 一型データ構造のデータとして表されている。さらに、その部品には、複数の代替品 と複数の仕入先があるため、入手ルート毎に別個のツリーデータが準備されている。 各ノードは、そのノードに関連付けられた項目名情報 (すなわち、ノードタイプ)と項目 値情報 (すなわち、ノード値)を用いて、(ノードタイプ、ノード値)の形で表されている
[0238] 図 63Aのデータは、ツリー識別子がツリーデータ 1であり、ルート'ノードが(品番、 1 )であり、ルート'ノードの子ノードとして、ノード (メーカ、 A)、ノード(重量、 10)、ノー ド (価格、 5000)、ノード (仕入先、 α )が存在する。図 63Α力 Εに示されるように、 各ツリーデータは構造が異なっていても構わない。また、図 63Εに示されたッリーデ ータ 5は、ノードタイプ =メーカに対応したノードを含まない。
[0239] このようなツリー型データ構造のデータに対しても、検索、集計、ソートを行うことが 可能である。検索、集計、ソートは、ツリーデータ毎に個別に行われ、その後、検索、 集計、ソートの結果が統合される。統合された結果は、ツリーデータ識別子を介して、 各ツリーデータと関連付けられる。本例では、各ツリーデータのルート'ノードは頂点 ノードである。 [0240] 例えば、項目名情報 =「メーカ」であるパス条件による検索を実行すると、ッリーデ ータ 1の頂点ノード、ツリーデータ 2の頂点ノード、ツリーデータ 3の頂点ノード、及び、 ツリーデータ 4の頂点ノードが検索にヒットする。し力し、ツリーデータ 5の頂点ノードは 検索にヒットしない。なぜならば、ツリーデータ 5には、項目名情報 =「メーカ」に関連 付けられたノードが存在しないからである。この検索の結果は、ツリーデータのツリー データ識別子と頂点ノードのノード識別子の組の集合により表現される。検索にヒット したノードそのものを検索結果とする場合も同様に、ツリーデータ識別子とノード識別 子の組の集合により検索結果が表現される。
[0241] また、項目名情報 =「価格」、項目値情報≤ 4200であるノードを検索する項目値検 索を行うことが可能である。頂点ノードを検索結果として返却する場合、この検索条件 を満たす頂点ノードは、ツリーデータ 3の頂点ノード、ツリーデータ 4の頂点ノード、ッ リーデータ 5の頂点ノードである。同様に、項目名情報 =「重量」であり、項目値情報
≤ 12であるノードを検索する項目値検索を実行すると、この検索にヒットする頂点ノ ードは、ツリーデータ 1の頂点ノード、ツリーデータ 2の頂点ノード、ツリーデータ 3の頂 点ノードである。
[0242] 次に、検索条件 1 =「項目名情報 =「価格」、項目値情報≤ 4200」と検索条件 2=「 項目名情報 =「重量」、項目値情報≤ 12」を満たす頂点ノードを検索すると、価格の 値力 200以下のノードと、重量の値が 12以下のノードの両方のノードを子孫ノードと して含む頂点ノードは、ツリーデータ 3の頂点ノードであることがわかる。一方、この A ND検索の結果は、検索条件 1の検索結果 =「ツリーデータ 3の頂点ノード、ッリーデ ータ 4の頂点ノード、ツリーデータ 5の頂点ノード」と、検索条件 2の検索結果 =「ッリ 一データ 1の頂点ノード、ツリーデータ 2の頂点ノード、ツリーデータ 3の頂点ノード」と の間の論理積演算の結果と一致している。
[0243] さらに、「仕入先毎の件数」や「重量毎の価格平均」などの集計を行うことが可能で ある。このような集計は、上記の本発明の第 1のノードデータ集計方法において、集 計の範囲を表す頂点ノードリストの要素がツリーデータ識別子とノード識別子の組に よって特定されるように拡張することによって実現できる。
[0244] 最後に、「低価格順」のようなソートも、上記の本発明の第 1のツリーデータソート方 法或いは第 2のツリーデータソート方法において、頂点ノードリストの要素がッリーデ ータ識別子とノード識別子の組によって特定されるように拡張することによって実現で きる。
[0245] 以上のように、本発明は、ノードをツリーデータ識別子とノード識別子の組によって 識別し、各ツリーデータに対して、ツリー型データ構造のデータの検索、集計及びソ ートの方法を実施することにより、複数のツリーデータを含むツリー型データ構造のデ ータにも拡張できる。
[0246] [情報処理装置]
図 64は、本発明の一実施例によるツリー型データ構造のデータを処理する情報処 理装置 6400のブロック図である。情報処理装置 6400は、ツリー型データ構造を表 現するデータを記憶する記憶部 6401と、ツリー型データ構造のデータを記憶部 640 1上に展開するデータ展開部 6402と、ツリーデータ処理のための条件を設定する条 件指定部 6403と、条件指定部 6403によって設定された条件に従って記憶部 6401 上に展開されたデータを処理するツリーデータ処理部 6404と、を含む。
[0247] ツリーデータ処理部 6404は、ツリーデータ検索を実行する検索部 6405と、ツリー データ集計を実行する集計部 6406と、ツリーデータソートのための指標を取得する 指標取得部 6408と、集計部 6406からの集計結果又は指標取得部 6408からの指 標を受け取って、ツリーデータソートを実行する順序付け部 6407と、を含む。
[0248] 記憶部 6401は、ルート'ノードとルート'ノード以外のノードである非ルート'ノードを 含むツリー型データ構造のデータを記憶する。データ展開部 6402は、ルート'ノード を含む全ノードに固有のノード識別子を付与し、非ルート'ノードの各々に付与された ノード識別子に非ルート'ノードの各々の親ノードに付与されたノード識別子を関連 付け、これにより、ツリー型データ構造を構成するノード間の親子関係を表現し、各ノ ードにデータを表す少なくとも一つの実体情報を関連付け、ツリー型データ構造を記 憶装置上に構築する。データ展開部 6402は、ルート'ノードを含む全ノードに同じ世 代のノードよりも子ノードを優先して固有のノード識別子を付与してもよい。
[0249] 条件指定部 6403は、検索、集計、ソートの目的に応じて各種の条件を設定する。
これらの条件は、ユーザによって図示されないユーザ'インタフェース装置を介して指 定され、或いは、外部装置から取り込まれる。各種の条件には、少なくとも一つの実 体情報に関する検索条件、検索範囲を表す少なくとも一つの部分ツリー、集計の対 象を表す項目名情報、集計の範囲を表す少なくとも一つの部分ツリー、順序付けの 対象となる少なくとも二つのノード群を表す頂点ノード、或いは、順序付けの指標とな る項目名情報などが含まれる。
[0250] 検索部 6405は、各ノードについて、当該ノードに関連付けられた少なくとも一つの 実体情報が前記検索条件と一致するかどうかを判定し、一致した場合に当該ノード に検索ヒット情報を関連付け、前記ノード間の親子関係を迪つて当該ノードの祖先ノ ードに検索ヒット情報を関連付ける。また、検索部 6405は、少なくとも一つの頂点ノ ードのうち検索ヒット情報が関連付けられた頂点ノードに付与されたノード識別子を検 索結果として保存してもよい。或いは、検索部 6405は、各頂点ノードについて、前記 ノード間の親子関係を迪つて当該頂点ノードの祖先ノードを特定し、当該頂点ノード 及び Z又は当該頂点ノードの祖先ノードに関連付けられた少なくとも一つの実体情 報が前記検索条件と一致するかどうかを判定し、一致したノードに検索ヒット情報を 関連付ける。
[0251] 他の一実施例では、検索部 6405は、少なくとも一つの実体情報を指定する第 1の 検索条件に従って、前記ノード間の親子関係を迪つて当該第 1の検索条件に一致す るノードが属するノード群を代表する頂点ノードに付与されたノード識別子を第 1の検 索結果として保存し、少なくとも一つの実体情報を指定する第 2の検索条件に従って 、前記ノード間の親子関係を迪つて当該第 1の検索条件に一致するノードが属するノ 一ド群を代表する頂点ノードに付与されたノード識別子を第 2の検索結果として保存 し、第 1の検索条件と第 2の検索条件の論理的な関係に対応した論理演算を第 1の 検索結果と第 2の検索結果に実行することにより、第 1の検索条件と第 2の検索条件 を論理的に組み合わせた検索結果を生成する。
[0252] 集計部 6406は、各頂点ノードについて、前記ノード間の親子関係を迪つて当該頂 点ノードの子孫ノードを特定し、当該頂点ノード及び Z又は当該頂点ノードの子孫ノ ードに関連付けられた項目名情報が集計の対象と一致するかどうかを判定し、一致 したノードに関連付けられた項目値情報を集計する。他の一実施例では、集計部 64 06は、各頂点ノードについて、前記ノード間の親子関係を迪つて当該頂点ノードの 子孫ノードを特定し、当該頂点ノード又は当該頂点ノードの子孫ノードに関連付けら れた項目名情報が集計の対象を表す項目名情報と一致するかどうかを判定し、一致 したノードに関連付けられた項目値情報を、当該頂点ノードによって代表されたノー ド群に関係した集計の分類対象を表す項目名情報に関連付けられた項目値情報毎 に集計する。
[0253] 順序付け部 6407は、頂点ノード毎に集計された項目値情報の順序関係に従って 当該少なくとも二つの頂点ノードに順序を付けることにより、当該頂点ノードによって 代表されるノード群に順序を付ける。
[0254] 他の一実施例では、指標取得部 6408は、各ツリーデータに属する各頂点ノードに ついて、前記ノード間の親子関係を迪つて当該頂点ノードの子孫ノードを特定し、当 該頂点ノード又は当該頂点ノードの子孫ノードの中で、順序付けの指標となる項目名 情報が関連付けられたノードに関連付けられた項目値情報を取得する。順序付け部 6407は、頂点ノード毎に取得された項目値情報の順序関係に従って当該少なくとも 二つの頂点ノードに順序を付けることにより、当該頂点ノードによって代表されるノー ド群に順序を付ける。
[0255] 本発明は、以上の実施の形態に限定されることなぐ特許請求の範囲に記載された 発明の範囲内で、種々の変更が可能であり、それらも本発明の範囲内に包含される ものであることは言うまでもない。
図面の簡単な説明
[0256] [図 1]図 1は、本発明の実施の形態に力かるツリー型データ構造を取り扱うコンビユー タシステムのブロックダイヤグラムである。
[図 2]図 2A、 Bは、ツリー形式データの一例である POSデータの説明図であり、図 2A は、このツリー形式データのデータ構造 (即ち、トポロジー)及びデータ値を視覚的に 表現した例であり、図 2Bは、同じツリー形式データを XML形式で表現した例である。
[図 3]図 3A〜Cは、アークリストを用いたツリー型データ構造の表現形式の一例の説 明図である。
[図 4]図 4A〜Cは、「子→親」関係に基づくツリー型データ構造の表現方法の説明図 である。
[図 5]図 5は、ツリー型データ構造を記憶装置上に構築する方法のフローチャートで ある。
[図 6]図 6A〜Cは、 ID形式のツリー構造型データを整数連番形式のツリー構造型デ ータへ変換する処理の説明図である。
[図 7]図 7A〜Cは、 ID形式のツリー構造型データを整数連番形式のツリー構造型デ ータへ変換する処理の説明図である。
[図 8]図 8は、深さ優先に基づくノード定義処理のフローチャートである。
[図 9]図 9は、「子→親」表現に基づく親子関係の配列の説明図である。
[図 10]図 10は、図 6Cに示された深さ優先のツリー型データ構造から作成された「親
→子」表現に基づく親子関係の配列の説明図である。
[図 11]図 11は、幅優先に基づくノード定義処理のフローチャートである。
[図 12]図 12は、「子→親」表現に基づく親子関係の配列の説明図である。
[図 13]図 13は、図 7Cに示された深さ優先のツリー型データ構造から作成された「親
→子」表現に基づく親子関係の配列の説明図である。
[図 14]図 14Aは、幅優先モードに基づくツリー型データ構造、図 14Bは、当該ツリー 型データ構造を、「子→親」表現に基づく親子関係の配列を示す図である。
[図 15]図 15Aは、頂点ノードリストの例、図 15Bは、頂点ノードリストで特定される部分 ツリー群の例を示す図である。
[図 16]図 16Aは、検索処理により得られた頂点ノードリストの例、図 16Bは、頂点ノー ドリストで特定される部分ツリー群の例を示す図である。
[図 17]図 17Aは、集計処理により得られた頂点ノードリストおよび集計結果を示す配 列の例、図 17Bは、頂点ノードリストで特定される部分ツリー群の例を示す図である。
[図 18]図 18Aは、ノード数でソートされた頂点ノードリスト、および、対応するノード数 を示す配列の例、図 18Bは、頂点ノードリストで特定される部分ツリーの例を示す図 である。
[図 19]図 19A、 Cは、それぞれ、論理積演算の対象となる頂点ノードリストの例、図 19 B、 Dは、それぞれ頂点ノードリストで特定される部分ツリー群の例を示す図である。 [図 20]図 20Aは、論理積演算の結果を示す頂点ノードリストの例、図 20Bは、頂点ノ 一ドリストで特定される部分ツリー群を示す図である。
[図 21]図 21Aは、幅優先モードに基づくツリー型データ構造、図 21Bは、当該ツリー 型データ構造を、「子→親」表現に基づく親子関係の配列を示す図である。
[図 22]図 22A、 Bは、論理積演算を説明する図である。
[図 23]図 23は、論理積演算の処理を示すフローチャートである。
[図 24]図 24は、論理積演算の処理例を示す図である。
[図 25]図 25は、論理積演算の処理例を示す図である。
[図 26]図 26は、実体的な値の取り扱い方の一例を示す図である。
[図 27]図 27Aは、本発明の一実施例に力かる子孫のパス条件による検索の対象とな るツリー型データ構造とノードの親子関係の「子→親」表現の説明図であり、図 27B はシンボル番号と表示図形とシンボル名の対応関係を表す図である。
[図 28]図 28は、本発明の一実施例に力かる子孫のパス条件によるツリー検索方法の フローチャートである。
[図 29]図 29A〜Cは、本発明の一実施例に力かる子孫のパス条件によるツリー検索 方法の動作状態を説明する図である。
[図 30]図 30A〜Cは、本発明の一実施例に力かる子孫のパス条件によるツリー検索 方法の動作状態を説明する図である。
[図 31]図 31A〜Cは、本発明の一実施例に力かる子孫のパス条件によるツリー検索 方法の動作状態を説明する図である。
[図 32]図 32A〜Dは、本発明の一実施例に力かる子孫のパス条件によるツリー検索 方法の動作状態を説明する図である。
[図 33]図 33A〜Cは、本発明の一実施例に力かる子孫のパス条件によるツリー検索 方法の動作状態を説明する図である。
[図 34]図 34は、本発明の一実施例に力かる子孫のパス条件によるツリー検索方法の フローチャートである。
[図 35]図 35A〜Cは、本発明の一実施例に力かる子孫のパス条件によるツリー検索 方法の動作状態を説明する図である。 [図 36]図 36A〜Cは、本発明の一実施例に力かる子孫のパス条件によるツリー検索 方法の動作状態を説明する図である。
[図 37]図 37A〜Cは、本発明の一実施例に力かる子孫のパス条件によるツリー検索 方法の動作状態を説明する図である。
[図 38]図 38A〜Cは、本発明の一実施例に力かる祖先のパス条件による検索の対象 となるツリー型データ構造とノードの親子関係の「子→親」表現の説明図である。
[図 39]図 39は、本発明の一実施例に力かる祖先のパス条件によるツリー検索方法の フローチャートである。
[図 40]図 40A〜Cは、本発明の一実施例に力かる祖先のパス条件によるツリー検索 方法の動作状態を説明する図である。
[図 41]図 41A〜Cは、本発明の一実施例に力かる祖先のパス条件によるツリー検索 方法の動作状態を説明する図である。
[図 42]図 42A〜Cは、本発明の一実施例に力かる祖先のパス条件によるツリー検索 方法の動作状態を説明する図である。
[図 43]図 43Aは、本発明の一実施例に力かる集計の対象となるツリー型データ構造 とノードの親子関係の「子→親」表現の説明図であり、図 43Bはシンボル番号と表示 図形とシンボル名の対応関係を表す図である。
[図 44]図 44A〜Dは、図 43Aの各頂点ノードによって代表される部分ツリーの説明 図である。
[図 45]図 45は、本発明の一実施例に力かる第 1のツリーデータ集計方法のフローチ ヤートである。
[図 46]図 46は、本発明の一実施例に力かる第 1のツリーデータ集計方法の動作状態 を説明する図である。
[図 47]図 47は、本発明の一実施例に力かる第 1のツリーデータ集計方法の動作状態 を説明する図である。
[図 48]図 48は、本発明の一実施例に力かる第 1のツリーデータ集計方法の動作状態 を説明する図である。
[図 49]図 49は、本発明の一実施例に力かる第 2のツリーデータ集計方法のフローチ ヤートである。
[図 50]図 50A〜Dは、本発明の一実施例に力かる第 2のツリーデータ集計方法の動 作状態を説明する図である。
[図 51]図 51A〜Cは、本発明の一実施例に力かる第 1のツリーデータソート方法の説 明図である。
[図 52]図 52Aは本発明の一実施例に力かる第 2のツリーデータソート方法の処理の 対象となるツリー型データ構造及びノードの親子関係の「子→親」表現を示し、図 52 Bはノードタイプ毎のノード値のリストを示し、図 52Cはノードに関連付けられたノード タイプ及びノード値を示す図である。
[図 53]図 53は、本発明の一実施例に力かる第 2のツリーデータ集計方法のフローチ ヤートである。
[図 54]図 54は、図 52A〜Cに示されたツリー型データ構造のデータに本発明の一実 施例に力かる第 2のツリーデータソート方法を適用したときの動作状態の説明図であ る。
[図 55]図 55は、図 52A〜Cに示されたツリー型データ構造のデータに本発明の一実 施例に力かる第 2のツリーデータソート方法を適用したときの動作状態の説明図であ る。
[図 56]図 56は、図 52A〜Cに示されたツリー型データ構造のデータに本発明の一実 施例に力かる第 2のツリーデータソート方法を適用したときの動作状態の説明図であ る。
[図 57]図 57は、図 52A〜Cに示されたツリー型データ構造のデータに本発明の一実 施例に力かる第 2のツリーデータソート方法を適用したときの動作状態の説明図であ る。
[図 58]図 58は、図 52A〜Cに示されたツリー型データ構造のデータに本発明の一実 施例に力かる第 2のツリーデータソート方法を適用したときの動作状態の説明図であ る。
[図 59]図 59は、図 52A〜Cに示されたツリー型データ構造のデータに本発明の一実 施例に力かる第 2のツリーデータソート方法を適用したときの動作状態の説明図であ る。
[図 60]図 60は、図 52A〜Cに示されたツリー型データ構造のデータに本発明の一実 施例に力かる第 2のツリーデータソート方法を適用したときの動作状態の説明図であ る。
[図 61]図 61は、図 52A〜Cに示されたツリー型データ構造のデータに本発明の一実 施例に力かる第 2のツリーデータソート方法を適用したときの動作状態の説明図であ る。
[図 62]図 62A、 Bは、図 52A〜Cに示されたツリー型データ構造のデータに本発明 の一実施例に力かる第 2のツリーデータソート方法を適用したときの動作状態の説明 図である。
[図 63]図 63A〜Eは、複数のツリーデータにより構成されたツリー型データ構造のデ ータの一例を示す図である。
[図 64]図 64は、本発明の一実施例による情報処置装置のブロック図である。
符号の説明
10 コンピュータシステム
12 CPU
14 RAM
16 ROM
18 固定記憶装置
20 CD— ROMドライバ
22 I/F
24 入力装置
26 表示装置
6400 情報処理装置
6401 n己' 1思 ρβ
6402 データ展開部
6403 条件指定部
6404 ツリーデータ処理部 6405 検索部 6406 集計部 6407 順序付け部 6408 指標取得部

Claims

請求の範囲
[1] 記憶装置に展開されたルート'ノードとルート'ノード以外のノードである非ルート'ノ ードを含むツリー型データ構造のデータを検索する方法であって、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
実体情報に関する検索条件を指定する条件指定ステップと、
各ノードについて、当該ノードに関連付けられた実体情報が前記検索条件と一致 するかどうかを判定し、一致した場合に当該ノードに検索ヒット情報を関連付け、前記 ノード間の親子関係を迪つて当該ノードの祖先ノードに検索ヒット情報を関連付ける 検索ステップと、
を有する方法。
[2] 部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、
条件指定ステップは、検索範囲を表す少なくとも一つの部分ツリーを指定するステ ップを含み、
検索ステップの後に、検索ヒット情報が関連付けられたノードを含む部分ツリーを表 す識別子を検索結果として保存するステップをさらに有する、
請求項 1に記載の方法。
[3] 記憶装置に展開されたルート'ノードとルート'ノード以外のノードである非ルート'ノ ードを含むツリー型データ構造のデータを検索する方法であって、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、 部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、
少なくとも一つの実体情報に関する検索条件を指定し、検索範囲を表す少なくとも 一つの部分ツリーを指定するステップと、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群に関連付けられた少なくとも一つの実体情報が前記検索条件と一致するか どうかを判定し、一致したノードに検索ヒット情報を関連付けるステップと、 を有する方法。
[4] 記憶装置に展開されたルート'ノードとルート'ノード以外のノードである非ルート'ノ ードを含むツリー型データ構造のデータを検索する方法であって、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、
少なくとも一つの実体情報に関する検索条件を指定し、検索範囲を表す少なくとも 一つの部分ツリーを指定するステップと、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノードに関連付けられた少なくとも一つの実体情報が前記検索条件と一致するかどう かを判定し、一致したノードが存在する場合に、当該部分ツリーを表す識別子を検索 結果として保存するステップと、
を有する方法。
[5] 記憶装置に展開されたルート'ノードとルート'ノード以外のノードである非ルート'ノ ードを含むツリー型データ構造のデータを検索する方法であって、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、
少なくとも一つの実体情報に関する検索条件を指定し、検索範囲を表す少なくとも 一つの部分ツリーを指定するステップと、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーの祖先ノ ードを特定し、当該部分ツリーの特定のノード及び Z又は祖先ノードに関連付けられ た少なくとも一つの実体情報が前記検索条件と一致するかどうかを判定し、一致した ノードに検索ヒット情報を関連付けるステップと、
を有する方法。
記憶装置に展開されたルート'ノードとルート'ノード以外のノードである非ルート'ノ ードを含むツリー型データ構造のデータを検索する方法であって、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、
少なくとも一つの実体情報に関する検索条件を指定し、検索範囲を表す少なくとも 一つの部分ツリーを指定するステップと、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーの祖先ノ ードを特定し、当該部分ツリーの特定のノード及び Z又は祖先ノードに関連付けられ た少なくとも一つの実体情報が前記検索条件と一致するかどうかを判定し、一致した ノードが存在する場合に、当該部分ツリーを表す識別子を検索結果として保存するス テツプと、 を有する方法。
[7] 記憶装置に展開されたルート'ノードとルート'ノード以外のノードである非ルート'ノ ードを含むツリー型データ構造のデータを第 1の検索条件と第 2の検索条件を論理 的に組み合わせて検索する方法であって、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、
検索範囲を表す少なくとも一つの部分ツリーが指定され、
少なくとも一つの実体情報を指定する第 1の検索条件に従って、前記ノード間の親 子関係を迪つて当該第 1の検索条件に一致するノードが属する部分ツリーを表す識 別子を第 1の検索結果として保存するステップと、
少なくとも一つの実体情報を指定する第 2の検索条件に従って、前記ノード間の親 子関係を迪つて当該第 1の検索条件に一致するノードが属する部分ツリーを表す識 別子を第 2の検索結果として保存するステップと、
第 1の検索条件と第 2の検索条件の論理的な関係に対応した論理演算を第 1の検 索結果と第 2の検索結果に実行することにより、第 1の検索条件と第 2の検索条件を 論理的に組み合わせた検索結果を生成するステップと、
を有する方法。
[8] 記憶装置に展開されたルート'ノードとルート'ノード以外のノードである非ルート'ノ ードを含むツリー型データ構造のデータを集計する方法であって、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、 各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、 部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、
集計の対象を表す実体情報を指定し、集計の範囲を表す少なくとも一つの部分ッ リーを指定するステップと、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群を特定し、当該ノード群の中に集計の対象を表す実体情報が関連付けられ たノードが存在するかどうかを判定し、存在する場合に、当該ノードに関連付けられ た実体情報を集計するステップと、
を有する方法。
[9] 記憶装置に展開されたルート'ノードとルート'ノード以外のノードである非ルート'ノ ードを含むツリー型データ構造のデータを集計する方法であって、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、
集計の分類対象を表す実体情報を指定し、集計の対象を表す実体情報を指定し、 集計の範囲を表す少なくとも一つの部分ツリーを指定するステップと、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群を特定し、当該ノード群の中に集計の対象を表す実体情報が関連付けられ たノードが存在するかどうかを判定し、存在する場合に、当該ノードに関連付けられ た実体情報を、当該部分ツリーに属するノード群に関係した集計の分類対象を表す 実体情報毎に集計するステップと、
を有する方法。
[10] 記憶装置に展開されたルート'ノードとルート'ノード以外のノードである非ルート'ノ ードを含むツリー型データ構造のデータの少なくとも二つのノード群に順序を付ける 方法であって、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造のデータの特定のノード及び当該特定のノードの 子孫ノードを含むノード群であり、
集計の対象を表す実体情報を指定し、集計の範囲を表す少なくとも二つの部分ッ リーを指定するステップと、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群を特定し、当該ノード群の中に集計の対象を表す実体情報が関連付けられ たノードが存在するかどうかを判定し、存在する場合に、当該ノードに関連付けられ た実体情報を集計するステップと、
部分ツリー毎に集計された項目値情報の順序関係に従って当該少なくとも二つの 部分ツリーに順序を付けるステップと、
を有する方法。
記憶装置に展開されたルート'ノードとルート'ノード以外のノードである非ルート'ノ ードを含むツリー型データ構造のデータの少なくとも二つのノード群に順序を付ける 方法であって、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造のデータの特定のノード及び当該特定のノードの 子孫ノードを含むノード群であり、 順序付けの対象となる少なくとも二つの部分ツリーを指定し、順序付けの指標となる 実体情報を指定するステップと、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群を特定し、当該ノード群の中で、順序付けの指標となる実体情報が関連付け られたノードに関連付けられた実体情報を取得するステップと、
部分ツリー毎に取得された実体情報の順序関係に従って当該少なくとも二つの部 分ツリーに順序を付けるステップと、
を有する方法。
[12] 各実体情報はデータの項目を表す項目名情報又はデータの項目値を表す項目値 情報である、請求項 1乃至 11のうち何れか 1項に記載の方法。
[13] 特定のノード及び当該特定のノードの子孫ノードを含む部分ツリーは当該特定のノ ードのノード識別子によって表される、請求項 2乃至 11のうち何れか 1項に記載の方 法。
[14] ルート'ノードを含む全ノードに付与された固有のノード識別子は同じ世代のノード よりも子ノードを優先して付与される、請求項 3、 4、 8、 9、 10又は 11のうち何れか 1項 に記載の方法。
[15] ツリー型データ構造のデータはツリー識別子が付与された複数のツリーデータを含 む、請求項 1乃至 11のうち何れか 1項に記載の方法。
[16] ルート'ノードとルート'ノード以外のノードである非ルート ·ノードを含むツリー型デ ータ構造のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータを検索 する情報処理装置であって、
ルート'ノードを含む全ノードに固有のノード識別子を付与し、非ルート'ノードの各 々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノード 識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係 を表現し、各ノードにデータを表す少なくとも一つの実体情報を関連付け、ツリー型 データ構造を記憶装置上に構築するデータ展開手段と、
少なくとも一つの実体情報に関する検索条件を指定する条件指定手段と、 各ノードについて、当該ノードに関連付けられた少なくとも一つの実体情報が前記 検索条件と一致するかどうかを判定し、一致した場合に当該ノードに検索ヒット情報 を関連付け、前記ノード間の親子関係を迪つて当該ノードの祖先ノードに検索ヒット 情報を関連付ける検索手段と、
を有する情報処理装置。
[17] 部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、
条件指定手段は、検索範囲を表す少なくとも一つの部分ツリーを指定する手段を 含み、
検索手段は、検索ヒット情報が関連付けられたノードを含む部分ツリーを表す識別 子を検索結果として保存する手段を含む、
請求項 16に記載の情報処理装置。
[18] ルート'ノードとルート'ノード以外のノードである非ルート ·ノードを含むツリー型デ ータ構造のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータを検索 する情報処理装置であって、
ルート ·ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノ ード識別子を付与し、非ルート'ノードの各々に付与されたノード識別子に非ルート' ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型 データ構造を構成するノード間の親子関係が表現され、各ノードにデータを表す少 なくとも一つの実体情報を関連付け、ツリー型データ構造を記憶装置上に構築する データ展開手段と、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、少なくとも一つの実体情報に関する検索条件を指定し、検 索範囲を表す少なくとも一つの部分ツリーを指定する条件指定手段と、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群を特定し、当該ノード群に関連付けられた少なくとも一つの実体情報が前記 検索条件と一致するかどうかを判定し、一致したノードに検索ヒット情報を関連付ける 検索手段と、
を有する情報処理装置。 [19] ルート'ノードとルート'ノード以外のノードである非ルート ·ノードを含むツリー型デ ータ構造のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータを検索 する情報処理装置であって、
ルート ·ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノ ード識別子を付与し、非ルート'ノードの各々に付与されたノード識別子に非ルート' ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型 データ構造を構成するノード間の親子関係が表現され、各ノードにデータを表す少 なくとも一つの実体情報を関連付け、ツリー型データ構造を記憶装置上に構築する データ展開手段と、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、少なくとも一つの実体情報に関する検索条件を指定し、検 索範囲を表す少なくとも一つの部分ツリーを指定する条件指定手段と、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群を特定し、当該ノード群に関連付けられた少なくとも一つの実体情報が前記 検索条件と一致するかどうかを判定し、一致したノードが存在する場合に、当該部分 ツリーを表す識別子を検索結果として保存する検索手段と、
を有する情報処理装置。
[20] ルート'ノードとルート'ノード以外のノードである非ルート ·ノードを含むツリー型デ ータ構造のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータを検索 する情報処理装置であって、
ルート'ノードを含む全ノードに固有のノード識別子を付与し、非ルート'ノードの各 々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノード 識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係 が表現され、各ノードにデータを表す少なくとも一つの実体情報を関連付け、ツリー 型データ構造を記憶装置上に構築するデータ展開手段と、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、少なくとも一つの実体情報に関する検索条件を指定し、検 索範囲を表す少なくとも一つの部分ツリーを指定する条件指定手段と、 各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーの祖先ノ ードを特定し、当該部分ツリーの特定のノード及び Z又は祖先ノードに関連付けられ た少なくとも一つの実体情報が前記検索条件と一致するかどうかを判定し、一致した ノードに検索ヒット情報を関連付ける検索手段と、
を有する情報処理装置。
[21] ルート'ノードとルート'ノード以外のノードである非ルート ·ノードを含むツリー型デ ータ構造のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータを検索 する情報処理装置であって、
ルート'ノードを含む全ノードに固有のノード識別子を付与し、非ルート'ノードの各 々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノード 識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係 が表現され、各ノードにデータを表す少なくとも一つの実体情報を関連付け、ツリー 型データ構造を記憶装置上に構築するデータ展開手段と、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、少なくとも一つの実体情報に関する検索条件を指定し、検 索範囲を表す少なくとも一つの部分ツリーを指定する条件指定手段と、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーの祖先ノ ードを特定し、当該部分ツリーの特定のノード及び Z又は祖先ノードに関連付けられ た少なくとも一つの実体情報が前記検索条件と一致するかどうかを判定し、一致した ノードが存在する場合に、当該部分ツリーを表す識別子を検索結果として保存する 検索手段と、
を有する情報処理装置。
[22] ルート'ノードとルート'ノード以外のノードである非ルート ·ノードを含むツリー型デ ータ構造のデータを記憶する記憶装置を有し、第 1の検索条件と第 2の検索条件を 論理的に組み合わせて検索する情報処理装置であって、
ルート'ノードを含む全ノードに固有のノード識別子を付与し、非ルート'ノードの各 々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノード 識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係 が表現され、各ノードにデータを表す少なくとも一つの実体情報を関連付け、ツリー 型データ構造を記憶装置上に構築するデータ展開手段と、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、検索範囲を表す少なくとも一つの部分ツリーを指定する条 件指定手段と、
少なくとも一つの実体情報を指定する第 1の検索条件に従って、前記ノード間の親 子関係を迪つて当該第 1の検索条件に一致するノードが属する部分ツリーを表す識 別子を第 1の検索結果として保存し、少なくとも一つの実体情報を指定する第 2の検 索条件に従って、前記ノード間の親子関係を迪つて当該第 1の検索条件に一致する ノードが部分ツリーを表す識別子を第 2の検索結果として保存する検索手段と、 第 1の検索条件と第 2の検索条件の論理的な関係に対応した論理演算を第 1の検 索結果と第 2の検索結果に実行することにより、第 1の検索条件と第 2の検索条件を 論理的に組み合わせた検索結果を生成する組み合わせ手段と、
を有する情報処理装置。
ルート'ノードとルート'ノード以外のノードである非ルート ·ノードを含むツリー型デ ータ構造のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータ^^計 する情報処理装置であって、
ルート ·ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノ ード識別子を付与し、非ルート'ノードの各々に付与されたノード識別子に非ルート' ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型 データ構造を構成するノード間の親子関係が表現され、各ノードにデータを表す少 なくとも一つの実体情報を関連付け、ツリー型データ構造を記憶装置上に展開する データ展開手段と、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、集計の対象を表す実体情報を指定し、集計の範囲を表す 少なくとも一つの部分ツリーを指定する条件指定手段と、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群を特定し、当該ノード群の中に集計の対象を表す実体情報が関連付けられ たかどうかを判定し、存在する場合に、当該ノードに関連付けられた実体情報を集計 する集計手段と、
を有する情報処理装置。
[24] ルート'ノードとルート'ノード以外のノードである非ルート ·ノードを含むツリー型デ ータ構造のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータ^^計 する情報処理装置であって、
ルート ·ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノ ード識別子を付与し、非ルート'ノードの各々に付与されたノード識別子に非ルート' ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型 データ構造を構成するノード間の親子関係が表現され、各ノードにデータを表す少 なくとも一つの実体情報を関連付け、ツリー型データ構造を記憶装置上に展開する データ展開手段と、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、集計の分類対象を表す実体情報を指定し、集計の対象を 表す実体情報を指定し、集計の範囲を表す少なくとも一つの部分ツリーを指定する 条件指定手段と、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群を特定し、当該ノード群の中に集計の対象を表す実体情報が関連付けられ たノードが存在するかどうかを判定し、存在する場合に、当該ノードに関連付けられ た実体情報を、当該部分ツリーに属するノード群に関係した集計の分類対象を表す 実体情報毎に集計する集計手段と、
を有する情報処理装置。
[25] ルート'ノードとルート'ノード以外のノードである非ルート ·ノードを含むツリー型デ ータ構造のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータの少な くとも二つのノード群に順序を付ける情報処理装置であって、
ルート ·ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノ ード識別子を付与し、非ルート'ノードの各々に付与されたノード識別子に非ルート' ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型 データ構造を構成するノード間の親子関係が表現され、各ノードにデータを表す少 なくとも一つの実体情報を関連付け、ツリー型データ構造を記憶装置上に展開する データ展開手段と、
部分ツリーはツリー型データ構造のデータの特定のノード及び当該特定のノードの 子孫を含むノード群であり、集計の対象を表す実体情報を指定し、集計の範囲を表 す少なくとも二つの部分ツリーを指定する条件指定手段と、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群を特定し、当該ノード群の中に集計の対象を表す実体情報が関連付けられ たノードが存在するかどうかを判定し、存在する場合に、当該ノードに関連付けられ た実体情報を集計する集計手段と、
部分ツリー毎に集計された項目値情報の順序関係に従って当該少なくとも二つの 部分ツリーに順序を付ける順序付け手段と、
を有する情報処理装置。
ルート'ノードとルート'ノード以外のノードである非ルート ·ノードを含むツリー型デ ータ構造のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータの少な くとも二つのノード群に順序を付ける情報処理装置であって、
ルート ·ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノ ード識別子を付与し、非ルート'ノードの各々に付与されたノード識別子に非ルート' ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型 データ構造を構成するノード間の親子関係が表現され、各ノードにデータを表す少 なくとも一つの実体情報を関連付け、ツリー型データ構造のデータを記憶装置上に 展開するデータ展開手段と、
部分ツリーはツリー型データ構造のデータの特定のノード及び当該特定のノードの 子孫ノードを含むノード群であり、順序付けの対象となる少なくとも二つの部分ツリー を指定し、順序付けの指標となる実体情報を指定する条件指定手段と、
各ツリーデータに属する各部分ツリーについて、前記ノード間の親子関係を迪つて 当該部分ツリーに属するノード群を特定し、当該ノード群の中で、順序付けの指標と なる実体情報が関連付けられたノードに関連付けられた実体情報を取得する指標取 得手段と、
部分ツリー毎に取得された項目値情報の順序関係に従って当該少なくとも二つの 部分ツリーに順序を付ける順序付け手段と、
を有する情報処理装置。
[27] 各実体情報はデータの項目を表す項目名情報又はデータの項目値を表す項目値 情報である、請求項 16乃至 26のうち何れか 1項に記載の情報処理装置。
[28] 特定のノード及び当該特定のノードの子孫ノードを含む部分ツリーは当該特定のノ ードのノード識別子によって表される、請求項 17乃至 26のうち何れか 1項に記載の 情報処理装置。
[29] ルート'ノードを含む全ノードに付与された固有のノード識別子は同じ世代のノード よりも子ノードを優先して付与される、請求項 18、 19、 23、 24、 25又は 26のうち何れ 力 1項に記載の情報処理装置。
[30] ツリー型データ構造のデータはツリー識別子が付与された複数のツリーデータを含 む、請求項 16乃至 26のうち何れか 1項に記載の情報処理装置。
[31] ルート'ノードとルート'ノード以外のノードである非ルート ·ノードを含むツリー型デ ータ構造のデータを記憶する記憶装置を有するコンピュータに、記憶装置に記憶さ れたデータを検索する検索機能を実現させるためのプログラムであって、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、
各ノードにデータを表す少なくとも一つの実体情報が関連付けられ、
前記検索機能は、
少なくとも一つの実体情報に関する検索条件を指定する機能と、
各ノードについて、当該ノードに関連付けられた少なくとも一つの実体情報が前記 検索条件と一致するかどうかを判定し、一致した場合に当該ノードに検索ヒット情報 を関連付け、前記ノード間の親子関係を迪つて当該ノードの祖先ノードに検索ヒット 情報を関連付ける機能と、 を含む、プログラム。
[32] 部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、
前記検索機能は、
検索範囲を表す少なくとも一つの部分ツリーを指定する機能と、
検索ヒット情報が関連付けられたノードを含む部分ツリーを表す識別子を検索結果 として保存する機能と、
をさらに含む、請求項 31に記載のプログラム。
[33] ルート'ノードとルート'ノード以外のノードである非ルート ·ノードを含むツリー型デ ータ構造のデータを記憶する記憶装置を有するコンピュータに、記憶装置に記憶さ れたデータを検索する検索機能を実現させるためのプログラムであって、
ルート ·ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノ ード識別子が付与され、非ルート'ノードの各々に付与されたノード識別子に非ルー ト 'ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ッ リー型データ構造を構成するノード間の親子関係が表現され、
各ノードにデータを表す少なくとも一つの実体情報が関連付けられ、
前記検索機能は、
部分ツリーがツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、少なくとも一つの実体情報に関する検索条件を指定し、検 索範囲を表す少なくとも一つの部分ツリーを指定する機能と、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群を特定し、当該ノード群に関連付けられた少なくとも一つの実体情報が前記 検索条件と一致するかどうかを判定し、一致したノードに検索ヒット情報を関連付ける 機能と、
を含む、プログラム。
[34] ルート'ノードとルート'ノード以外のノードである非ルート ·ノードを含むツリー型デ ータ構造のデータを記憶する記憶装置を有するコンピュータに、記憶装置に記憶さ れたデータを検索する検索機能を実現させるためのプログラムであって、 ルート ·ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノ ード識別子が付与され、非ルート'ノードの各々に付与されたノード識別子に非ルー ト 'ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ッ リー型データ構造を構成するノード間の親子関係が表現され、
各ノードにデータを表す少なくとも一つの実体情報が関連付けられ、
前記検索機能は、
部分ツリーがツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、少なくとも一つの実体情報に関する検索条件を指定し、検 索範囲を表す少なくとも一つの部分ツリーを指定する機能と、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群を特定し、当該ノード群に関連付けられた少なくとも一つの実体情報が前記 検索条件と一致するかどうかを判定し、一致したノードが存在する場合に、当該部分 ツリーを表す識別子を検索結果として保存する機能と、
を含む、プログラム。
ルート'ノードとルート'ノード以外のノードである非ルート ·ノードを含むツリー型デ ータ構造のデータを記憶する記憶装置を有するコンピュータに、記憶装置に記憶さ れたデータを検索する検索機能を実現させるためのプログラムであって、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、
各ノードにデータを表す少なくとも一つの実体情報が関連付けられ、
前記検索機能は、
部分ツリーがツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、少なくとも一つの実体情報に関する検索条件を指定し、検 索範囲を表す少なくとも一つの部分ツリーを指定する機能と、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該頂点ノードの祖先ノ ードを特定し、当該部分ツリーの特定のノード及び Z又は祖先ノードに関連付けられ た少なくとも一つの実体情報が前記検索条件と一致するかどうかを判定し、一致した ノードに検索ヒット情報を関連付ける機能と、
を含む、プログラム。
[36] ルート'ノードとルート'ノード以外のノードである非ルート ·ノードを含むツリー型デ ータ構造のデータを記憶する記憶装置を有するコンピュータに、記憶装置に記憶さ れたデータを検索する検索機能を実現させるためのプログラムであって、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、
各ノードにデータを表す少なくとも一つの実体情報が関連付けられ、
前記検索機能は、
部分ツリーがツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、少なくとも一つの実体情報に関する検索条件を指定し、検 索範囲を表す少なくとも一つの部分ツリーを指定する機能と、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーの祖先ノ ードを特定し、当該部分ツリーの特定のノード及び Z又は祖先ノードに関連付けられ た少なくとも一つの実体情報が前記検索条件と一致するかどうかを判定し、一致した ノードが存在する場合に、当該部分ツリーを表す識別子を検索結果として保存する 機能と、
を含む、プログラム。
[37] ルート'ノードとルート'ノード以外のノードである非ルート ·ノードを含むツリー型デ ータ構造のデータを記憶する記憶装置を有するコンピュータに、第 1の検索条件と第 2の検索条件を論理的に組み合わせて検索する検索機能を実現させるためのプログ ラムであって、
ルート ·ノードを含む全ノードに固有のノード識別子が付与され、非ルート ·ノードの 各々に付与されたノード識別子に非ルート'ノードの各々の親ノードに付与されたノ ード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の 親子関係が表現され、
各ノードにデータを表す少なくとも一つの実体情報が関連付けられ、
前記検索機能は、
部分ツリーがツリー型データ構造の特定のノード及び当該特定のノードの子孫ノー ドを含むノード群であり、検索範囲を表す少なくとも一つの部分ツリーを指定する機 能と、
少なくとも一つの実体情報を指定する第 1の検索条件に従って、前記ノード間の親 子関係を迪つて当該第 1の検索条件に一致するノードが属する部分ツリーを表す識 別子を第 1の検索結果として保存し、少なくとも一つの実体情報を指定する第 2の検 索条件に従って、前記ノード間の親子関係を迪つて当該第 1の検索条件に一致する ノードが属する部分ツリーを表すノード識別子を第 2の検索結果として保存する機能 と、
第 1の検索条件と第 2の検索条件の論理的な関係に対応した論理演算を第 1の検 索結果と第 2の検索結果に実行することにより、第 1の検索条件と第 2の検索条件を 論理的に組み合わせた検索結果を生成する機能と、
を含む、プログラム。
ルート'ノードとルート'ノード以外のノードである非ルート ·ノードを含むツリー型デ ータ構造のデータを記憶する記憶装置を有するコンピュータに、記憶装置に記憶さ れたデータを集計する集計機能を実現させるためのプログラムであって、
ルート ·ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノ ード識別子が付与され、非ルート'ノードの各々に付与されたノード識別子に非ルー ト 'ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ッ リー型データ構造を構成するノード間の親子関係が表現され、
各ノードにデータを表す少なくとも一つの実体情報が関連付けられ、
前記集計機能は、
部分ツリーがツリー型データ構造のデータの特定のノード及び当該特定のノードの 子孫ノードを含むノード群であり、集計の対象を表す実体情報を指定し、集計の範囲 を表す少なくとも一つの部分ツリーを指定する機能と、 各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群を特定し、当該ノード群の中に集計の対象を表す実体情報が関連付けられ ているかどうかを判定し、存在する場合に、当該ノードに関連付けられた実体情報を 集計する機能と、
を含む、プログラム。
[39] ルート'ノードとルート'ノード以外のノードである非ルート ·ノードを含むツリー型デ ータ構造のデータを記憶する記憶装置を有するコンピュータに、記憶装置に記憶さ れたデータを集計する集計機能を実現させるためのプログラムであって、
ルート ·ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノ ード識別子が付与され、非ルート'ノードの各々に付与されたノード識別子に非ルー ト 'ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ッ リー型データ構造を構成するノード間の親子関係が表現され、
各ノードにデータを表す少なくとも一つの実体情報が関連付けられ、
前記集計機能は、
頂点ノードがツリー型データ構造のデータの特定のノード及び当該特定のノードの 子孫ノードを含むノード群であり、集計の分類対象を表す実体情報を指定し、集計の 対象を表す実体情報を指定し、集計の範囲を表す少なくとも一つの部分ツリーを指 定する機能と、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群を特定し、当該ノード群の中に集計の対象を表す実体情報が関連付けられ たノードが存在するかどうかを判定し、存在する場合に、当該ノードに関連付けられ た実体情報を、当該部分ツリーに属するノード群に関係した集計の分類対象を表す 実体情報毎に集計する機能と、
を含む、プログラム。
[40] ルート'ノードとルート'ノード以外のノードである非ルート ·ノードを含むツリー型デ ータ構造のデータを記憶する記憶装置を有するコンピュータに、記憶装置に記憶さ れたデータの少なくとも二つのノード群に順序を付ける順序付け機能を実現させるた めのプログラムであって、 ルート ·ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノ ード識別子が付与され、非ルート'ノードの各々に付与されたノード識別子に非ルー ト 'ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ッ リー型データ構造を構成するノード間の親子関係が表現され、
各ノードにデータを表す少なくとも一つの実体情報が関連付けられ、
前記順序付け機能は、
部分ツリーがツリー型データ構造のデータの特定のノード及び当該特定のノードの 子孫を含むノード群であり、集計の対象を表す実体情報を指定し、集計の範囲を表 す少なくとも二つの部分ツリーを指定する機能と、
各部分ツリーについて、前記ノード間の親子関係を迪つて当該部分ツリーに属する ノード群を特定し、当該ノード群の中に集計の対象を表す実体情報が関連付けられ たノードが存在するかどうかを判定し、存在する場合に、当該ノードに関連付けられ た実体情報を集計する機能と、
部分ツリー毎に集計された項目値情報の順序関係に従って当該少なくとも二つの 部分ツリーに順序を付ける機能と、
を含む、プログラム。
ルート'ノードとルート'ノード以外のノードである非ルート ·ノードを含むツリー型デ ータ構造のデータを記憶する記憶装置を有するコンピュータに、記憶装置に記憶さ れたデータの少なくとも二つのノード群に順序を付ける順序付け機能を実現させるた めのプログラムであって、
ルート ·ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノ ード識別子が付与され、非ルート'ノードの各々に付与されたノード識別子に非ルー ト 'ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ッ リー型データ構造を構成するノード間の親子関係が表現され、
各ノードにデータを表す少なくとも一つの実体情報が関連付けられ、
前記順序付け機能は、
部分ツリーがツリー型データ構造のデータの特定のノード及び当該特定のノードの 子孫ノードを含むノード群であり、順序付けの対象となる少なくとも二つの部分ツリー を指定し、順序付けの指標となる実体情報を指定する機能と、
各ツリーデータに属する各部分ツリーについて、前記ノード間の親子関係を迪つて 当該部分ツリーに属するノード群を特定し、当該ノード群の中で、順序付けの指標と なる実体情報が関連付けられたノードに関連付けられた実体情報を取得する機能と 部分ツリー毎に取得された項目値情報の順序関係に従って当該少なくとも二つの 部分ツリーに順序を付ける機能と、
を含む、プログラム。
[42] 各実体情報はデータの項目を表す項目名情報又はデータの項目値を表す項目値 情報である、請求項 31乃至 41のうち何れか 1項に記載のプログラム。
[43] 特定のノード及び当該特定のノードの子孫ノードを含む部分ツリーは当該特定のノ ードのノード識別子によって表される、請求項 32乃至 41のうち何れか 1項に記載の プログラム。
[44] ルート'ノードを含む全ノードに付与された固有のノード識別子は同じ世代のノード よりも子ノードを優先して付与される、請求項 33、 34、 38、 39、 40又は 41のうち何れ 力 1項に記載のプログラム。
[45] ツリー型データ構造のデータはツリー識別子が付与された複数のツリーデータを含 む、請求項 31乃至 41のうち何れ力 1項に記載のプログラム。
[46] 請求項 31乃至 45のうちいずれか 1項に記載のプログラムを記録したコンピュータ読 み取り可能な記録媒体。
PCT/JP2005/020808 2004-11-17 2005-11-14 ツリーデータの検索・集計・ソート方法及びプログラム WO2006054506A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006544997A JP4796970B2 (ja) 2004-11-17 2005-11-14 ツリーデータの検索・集計・ソート方法及びプログラム

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2004-333783 2004-11-17
JP2004333783 2004-11-17

Publications (1)

Publication Number Publication Date
WO2006054506A1 true WO2006054506A1 (ja) 2006-05-26

Family

ID=36407049

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2005/020808 WO2006054506A1 (ja) 2004-11-17 2005-11-14 ツリーデータの検索・集計・ソート方法及びプログラム

Country Status (2)

Country Link
JP (1) JP4796970B2 (ja)
WO (1) WO2006054506A1 (ja)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010523057A (ja) * 2007-03-26 2010-07-08 クゥアルコム・インコーポレイテッド チャネルツリー演算を実行する方法および装置
JP2013054459A (ja) * 2011-09-01 2013-03-21 Fuji Xerox Co Ltd 診療情報検索装置、及びプログラム
CN110765123A (zh) * 2018-07-09 2020-02-07 株式会社日立制作所 基于树形结构的材料数据的存储方法、装置和系统
CN110889022A (zh) * 2018-08-17 2020-03-17 迈普通信技术股份有限公司 数据查询方法、装置及电子设备
JP2020514894A (ja) * 2017-03-15 2020-05-21 センシェア アーゲー データベースにおけるトライデータ構造の有効使用
CN111314245A (zh) * 2020-01-17 2020-06-19 鹏城实验室 报文调度方法及装置、存储介质及电子设备
CN111414347A (zh) * 2019-01-04 2020-07-14 阿里巴巴集团控股有限公司 节点信息处理方法及装置,输出方法及存储和电子设备
CN111553637A (zh) * 2020-04-29 2020-08-18 杭州网易再顾科技有限公司 提货路径生成方法、装置、电子设备及存储介质
CN116150436A (zh) * 2023-04-14 2023-05-23 北京锐服信科技有限公司 一种基于节点树的数据展示方法与系统
CN116680252A (zh) * 2023-06-13 2023-09-01 智研汇(上海)科技有限公司 树形数据结构及其节点批量移动方法
CN117194739A (zh) * 2023-09-12 2023-12-08 北京云枢创新软件技术有限公司 基于命中状态查找层次树节点的方法、电子设备和介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07319918A (ja) * 1994-05-24 1995-12-08 Fuji Xerox Co Ltd 文書検索対象指示装置
JPH10240741A (ja) * 1997-02-28 1998-09-11 Nippon Telegr & Teleph Corp <Ntt> 木構造型データの管理方法
JPH11110384A (ja) * 1997-07-01 1999-04-23 Hitachi Ltd 構造化文書検索表示方法及び装置
JPH11195026A (ja) * 1997-12-26 1999-07-21 Hitachi Ltd ディレクトリ・サーバおよびそれに用いられる情報管理方法
JP2004120657A (ja) * 2002-09-27 2004-04-15 Internatl Business Mach Corp <Ibm> 木構造文書送受システム、木構造文書送信装置、木構造文書受信装置、木構造文書送受方法、木構造文書送信方法、木構造文書受信方法、及びプログラム
JP2004178084A (ja) * 2002-11-25 2004-06-24 Systems Engineering Constructions Co Ltd Xmlデータの格納方法及び格納装置、並びにプログラムおよびプログラムを記録した記録媒体

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07319918A (ja) * 1994-05-24 1995-12-08 Fuji Xerox Co Ltd 文書検索対象指示装置
JPH10240741A (ja) * 1997-02-28 1998-09-11 Nippon Telegr & Teleph Corp <Ntt> 木構造型データの管理方法
JPH11110384A (ja) * 1997-07-01 1999-04-23 Hitachi Ltd 構造化文書検索表示方法及び装置
JPH11195026A (ja) * 1997-12-26 1999-07-21 Hitachi Ltd ディレクトリ・サーバおよびそれに用いられる情報管理方法
JP2004120657A (ja) * 2002-09-27 2004-04-15 Internatl Business Mach Corp <Ibm> 木構造文書送受システム、木構造文書送信装置、木構造文書受信装置、木構造文書送受方法、木構造文書送信方法、木構造文書受信方法、及びプログラム
JP2004178084A (ja) * 2002-11-25 2004-06-24 Systems Engineering Constructions Co Ltd Xmlデータの格納方法及び格納装置、並びにプログラムおよびプログラムを記録した記録媒体

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010523057A (ja) * 2007-03-26 2010-07-08 クゥアルコム・インコーポレイテッド チャネルツリー演算を実行する方法および装置
US8718030B2 (en) 2007-03-26 2014-05-06 Qualcomm Incorporated Methods and apparatus for performing channel tree operations
JP2013054459A (ja) * 2011-09-01 2013-03-21 Fuji Xerox Co Ltd 診療情報検索装置、及びプログラム
US11347741B2 (en) 2017-03-15 2022-05-31 Censhare Gmbh Efficient use of TRIE data structure in databases
JP2020514894A (ja) * 2017-03-15 2020-05-21 センシェア アーゲー データベースにおけるトライデータ構造の有効使用
US11899667B2 (en) 2017-03-15 2024-02-13 Censhare Gmbh Efficient use of trie data structure in databases
US11275740B2 (en) 2017-03-15 2022-03-15 Censhare Gmbh Efficient use of trie data structure in databases
JP7171592B2 (ja) 2017-03-15 2022-11-15 センシェア ゲーエムベーハー データベースにおけるトライデータ構造の有効使用
CN110765123A (zh) * 2018-07-09 2020-02-07 株式会社日立制作所 基于树形结构的材料数据的存储方法、装置和系统
CN110889022A (zh) * 2018-08-17 2020-03-17 迈普通信技术股份有限公司 数据查询方法、装置及电子设备
CN111414347A (zh) * 2019-01-04 2020-07-14 阿里巴巴集团控股有限公司 节点信息处理方法及装置,输出方法及存储和电子设备
CN111414347B (zh) * 2019-01-04 2023-06-20 阿里巴巴集团控股有限公司 节点信息处理方法及装置,输出方法及存储和电子设备
CN111314245A (zh) * 2020-01-17 2020-06-19 鹏城实验室 报文调度方法及装置、存储介质及电子设备
CN111314245B (zh) * 2020-01-17 2023-10-24 鹏城实验室 报文调度方法及装置、存储介质及电子设备
CN111553637B (zh) * 2020-04-29 2023-09-26 杭州网易再顾科技有限公司 提货路径生成方法、装置、电子设备及存储介质
CN111553637A (zh) * 2020-04-29 2020-08-18 杭州网易再顾科技有限公司 提货路径生成方法、装置、电子设备及存储介质
CN116150436B (zh) * 2023-04-14 2023-08-08 北京锐服信科技有限公司 一种基于节点树的数据展示方法与系统
CN116150436A (zh) * 2023-04-14 2023-05-23 北京锐服信科技有限公司 一种基于节点树的数据展示方法与系统
CN116680252A (zh) * 2023-06-13 2023-09-01 智研汇(上海)科技有限公司 树形数据结构及其节点批量移动方法
CN117194739A (zh) * 2023-09-12 2023-12-08 北京云枢创新软件技术有限公司 基于命中状态查找层次树节点的方法、电子设备和介质
CN117194739B (zh) * 2023-09-12 2024-04-19 北京云枢创新软件技术有限公司 基于命中状态查找层次树节点的方法、电子设备和介质

Also Published As

Publication number Publication date
JPWO2006054506A1 (ja) 2008-08-07
JP4796970B2 (ja) 2011-10-19

Similar Documents

Publication Publication Date Title
JP4796970B2 (ja) ツリーデータの検索・集計・ソート方法及びプログラム
JP4653157B2 (ja) ツリーの検索、集計、ソート方法、情報処理装置、および、ツリーの検索、集計、ソートプログラム
JP4537391B2 (ja) ツリー型データ構造を取り扱う方法、情報処理装置、及び、プログラム
JP4681544B2 (ja) 配列の生成方法、情報処理装置、及び、プログラム
JP4116329B2 (ja) 文書情報表示システム、文書情報表示方法及び文書検索方法
US7962524B2 (en) Computer program, device, and method for sorting dataset records into groups according to frequent tree
JP5423676B2 (ja) データ分類システム、データ分類方法、及びデータ分類プログラム
US20060179051A1 (en) Methods and apparatus for steering the analyses of collections of documents
WO2006038498A1 (ja) 配列の生成方法、及び、配列生成プログラム
WO2006001241A1 (ja) ノードを挿入する方法、装置及びプログラム
JP5716966B2 (ja) データ分析装置、データ分析方法及びプログラム
Wellenzohn et al. Dynamic interleaving of content and structure for robust indexing of semi-structured hierarchical data (extended version)
JP4125951B2 (ja) テキスト自動分類方法及び装置並びにプログラム及び記録媒体
JP4951407B2 (ja) コンテンツ部品検索方法及び装置
JPH07225770A (ja) データ検索装置
JPH10320402A (ja) 検索式作成方法、検索式作成装置、及び記録媒体
Paik et al. A framework for data structure-guided extraction of XML association rules
Ding et al. Mining Association Rules from XML Data
Ho et al. SF-Tree: An efficient and flexible structure for estimating selectivity of simple path expressions with statistical accuracy guarantee
Ho et al. ÀF-Tree: An Efficient and Flexible Àtructure for Estimating Àelectivity of Àimple Path Expressions with Àtatistical Accuracy Guarantee
Ho et al. SF-Tree: An Efficient and Flexible Structure for Selectivity Estimation
JPH10222538A (ja) データ検索方法及び装置
JP2006228070A (ja) データの検索方法

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): AE AG AL AM AT AU AZ BA BB BG BR BW BY BZ CA CH CN CO CR CU CZ DE DK DM DZ EC EE EG ES FI GB GD GE GH GM HR HU ID IL IN IS JP KE KG KM KN KP KR KZ LC LK LR LS LT LU LV LY MA MD MG MK MN MW MX MZ NA NG NI NO NZ OM PG PH PL PT RO RU SC SD SE SG SK SL SM SY TJ TM TN TR TT TZ UA UG US UZ VC VN YU ZA ZM ZW

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): BW GH GM KE LS MW MZ NA SD SL SZ TZ UG ZM ZW AM AZ BY KG KZ MD RU TJ TM AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HU IE IS IT LT LU LV MC NL PL PT RO SE SI SK TR BF BJ CF CG CI CM GA GN GQ GW ML MR NE SN TD TG

121 Ep: the epo has been informed by wipo that ep was designated in this application
DPE1 Request for preliminary examination filed after expiration of 19th month from priority date (pct application filed from 20040101)
WWE Wipo information: entry into national phase

Ref document number: 2006544997

Country of ref document: JP

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 05806305

Country of ref document: EP

Kind code of ref document: A1

WWW Wipo information: withdrawn in national office

Ref document number: 5806305

Country of ref document: EP