JP4796970B2 - Tree data search / aggregation / sorting method and program - Google Patents

Tree data search / aggregation / sorting method and program Download PDF

Info

Publication number
JP4796970B2
JP4796970B2 JP2006544997A JP2006544997A JP4796970B2 JP 4796970 B2 JP4796970 B2 JP 4796970B2 JP 2006544997 A JP2006544997 A JP 2006544997A JP 2006544997 A JP2006544997 A JP 2006544997A JP 4796970 B2 JP4796970 B2 JP 4796970B2
Authority
JP
Japan
Prior art keywords
node
tree
vertex
nodes
parent
Prior art date
Legal status (The legal status 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 status listed.)
Expired - Fee Related
Application number
JP2006544997A
Other languages
Japanese (ja)
Other versions
JPWO2006054506A1 (en
Inventor
晋二 古庄
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Turbo Data Laboratories Inc
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/en
Publication of JPWO2006054506A1 publication Critical patent/JPWO2006054506A1/en
Application granted granted Critical
Publication of JP4796970B2 publication Critical patent/JP4796970B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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

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)

Description

本発明はツリー型データ構造を取り扱う方法、特に、ツリー型データ構造のデータを検索・集計・ソートする方法に関する。また、本発明は、このような方法を実施する情報処理装置に関する。更に、本発明は、このような方法を実行するためのプログラム、及び、このプログラムを記録した記録媒体に関する。   The present invention relates to a method for handling a tree-type data structure, and more particularly to a method for searching / aggregating / sorting data having a tree-type data structure. The present invention also relates to an information processing apparatus that implements such a method. Furthermore, the present invention relates to a program for executing such a method and a recording medium on which the program is recorded.

データベースは種々の用途に用いられているが、中規模ないし大規模システムにおいては、論理的な矛盾が排除できるリレーショナルデータベース(RDB)の使用が主流となっている。たとえば、RDBは飛行機の座席予約等のシステムに利用されている。この場合、キー項目を指定することにより、(多くの場合1件の)ターゲットを迅速に検索することもでき、或いは、予約の確定、キャンセル或いは変更などを行うことができる。また、各便の座席数はせいぜい数百であるため、特定の航空便の空席数を求めることも可能である。   Databases are used for various purposes, but in medium to large-scale systems, the use of relational databases (RDB) that can eliminate logical contradictions is the mainstream. For example, RDB is used in a system such as airplane seat reservation. In this case, by specifying a key item, it is possible to quickly search for a target (in many cases, one), or to confirm, cancel or change a reservation. In addition, since the number of seats for each flight is at most several hundred, it is possible to obtain the number of vacant seats for a specific flight.

このようなRDBは、表形式データの取り扱いに適しているが、ツリー形式データの取り扱いには適していないことが知られている(例えば、非特許文献1を参照。)。   Such an RDB is known to be suitable for handling tabular data, but not suitable for handling tree data (see, for example, Non-Patent Document 1).

更に、アプリケーションの中には、表形式による表現よりもツリー形式による表現の方が適しているものが存在する。特に、近年、イントラネットやインターネットのアプリケーションのデータ標準として、ツリー型データ構造を採用するXMLが普及している(XMLの詳細については、例えば、非特許文献2を参照。)。   Furthermore, there are some applications in which the representation in the tree format is more suitable than the representation in the table format. In particular, in recent years, XML that employs a tree-type data structure has become widespread as a data standard for intranet and Internet applications (see, for example, Non-Patent Document 2 for details of XML).

しかし、ツリー型データ構造の取り扱い、例えば、ツリー形式データの検索は、一般に、大変効率が悪い。この効率の悪さの第1の理由は、データが各所のノードに分散して存在するため、データの存在すべき場所を直ちに特定することが困難である点にある。RDBでは、例えば、「年齢」というデータは、あるテーブルの「年齢」という項目だけに格納されている。しかし、ツリー型データ構造では、「年齢」というデータを保持するノードが各所に散在しているので、一般的には、ツリー型データ構造の全体を調べなければ、該当するデータを検索することができない。   However, handling of tree-type data structures, for example, retrieval of tree format data, is generally very inefficient. The first reason for this inefficiency is that it is difficult to immediately identify the location where the data should exist, because the data is distributed in various nodes. In the RDB, for example, the data “age” is stored only in the item “age” of a certain table. However, in the tree-type data structure, nodes holding data “age” are scattered in various places. Generally, if the entire tree-type data structure is not examined, the corresponding data can be searched. Can not.

効率の悪さの第2の理由は、検索の結果を表現するために時間がかかるという点にある。検索にヒットしたノード群を表現しようとすると、屡々、そのノードの子孫にあたるノードも表現しなければならないが、RDBMSとは異なりデータ構造が非定型であるため、子孫ノードを表現するために時間がかかる。   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 a node that is a descendant of that node, but unlike RDBMS, the data structure is atypical, so it takes time to express the descendant nodes. Take it.

そこで、データベースの主流であるRDBの利点をいかすため、従来、ツリー型データ構造をデータベース化するとき、ツリー形式データをRDB化する方法(例えば、特許文献1を参照。)が提案されている。RDBでは、データはテーブル(表)に分解して保持される。そのため、実際のツリー形式データをRDB化するには、ツリー形式データをテーブルに押し込める必要がある。しかし、様々のツリー型データ構造を取り扱うためには、その構造毎に個別にデータをテーブルに押し込め、システム設計を行わなければならない。したがって、RDBに基づくシステム構築は非常に手間のかかる作業である。   Therefore, in order to take advantage of the RDB which is the mainstream of the database, conventionally, a method of converting the tree format data into an RDB when the tree data structure is converted into a database has been proposed (for example, see Patent Document 1). In the RDB, data is stored after being decomposed into tables. Therefore, in order to convert the actual tree format data into RDB, it is necessary to push the tree format data into the table. However, in order to handle various tree-type data structures, the system design must be performed by pushing data into the table individually for each structure. Therefore, system construction based on RDB is a very time-consuming work.

これに対して、ツリー形式データ、特に、XMLデータをそのままの形でデータベース化する方法も提案されている。ツリー型データ構造の場合、一つのノードに子孫ノードをぶら下げることができ、多様な表現が可能であるため、システム設計の手間を大幅に削減することができる。したがって、XMLのようなツリー構造を取り扱える技術を核として、ツリー形式データを処理することへのニーズが高まっている。   On the other hand, a method of creating a database of tree format data, particularly XML data as it is, has been proposed. In the case of a tree-type data structure, descendant nodes can be hung from one node, and various expressions are possible, so that the time and effort for system design can be greatly reduced. Accordingly, there is an increasing need for processing tree format data with a technique capable of handling a tree structure such as XML as a core.

XMLデータをそのままの形でデータベース化する方法の一例のアプローチは、ツリー構造に記入されているデータのコピーを取り出し、例えば、「年齢」という項目であれば、「年齢」の検索用インデックスデータを別途保持する(例えば、特許文献2を参照。)。これにより、データ自身に属性を付加できるというXMLデータのメリットを十分に活用すると共に、タグを用いて表現された各項目の関係構造をそのまま記憶できるようにしている。   An example of an approach for creating a database of XML data as it is is to take a copy of the data written in the tree structure. For example, if the item is “age”, search index data for “age” is used. It is held separately (see, for example, Patent Document 2). As a result, the advantage of XML data that attributes can be added to the data itself is fully utilized, and the relational structure of each item expressed using tags can be stored as it is.

また、XML文書をツリー構造でメモリ上に展開するためのDOMと呼ばれるオブジェクトモデルのインタフェースが公開されている(例えば、非特許文献3を参照。)。
特開2003−248615号公報 特開2001−195406号公報 株式会社セック、"Karearea White Paper"、[online]、[平成16年2月19日検索]、インターネット<URL:http://www.sec.co.jp/products/karearea/> W3C、"Extensible Markup Language (XML) 1.0 (ThirdEdition)"、[online]、2004年2月4日、[平成16年2月19日検索]、インターネット<URL:http://www.w3.org/TR/2004/REC-xml-20040204/> R. アラン ワイク、ブラッド ルーペン、サルタン ルーマン、「プログラミングXML」、日経DPソフトプレス、2002年、p.59−84
Also, an object model interface called DOM for expanding an XML document on a memory in a tree structure is disclosed (for example, see Non-Patent Document 3).
JP2003-248615A JP 2001-195406 A SECK Co., Ltd., “Karearea White Paper”, [online], [Search February 19, 2004], Internet <URL: http://www.sec.co.jp/products/karearea/> W3C, "Extensible Markup Language (XML) 1.0 (ThirdEdition)", [online], February 4, 2004, [February 19, 2004 search], Internet <URL: http://www.w3.org / TR / 2004 / REC-xml-20040204 /> R. Alan Wyke, Brad Lupen, Sultan Luman, "Programming XML", Nikkei DP Soft Press, 2002, p. 59-84

しかし、上記の検索用インデックスデータを別途保持するようなアプローチでは、少なくともデータは二重に保持され、かつ、インデックスを作成するコスト及びインデックスを格納するためのデータ領域が必要となり、大規模なデータを保持する上で不利である。   However, in the approach of separately holding the index data for search described above, at least the data is held twice, and the cost for creating the index and the data area for storing the index are required. Is disadvantageous in holding.

このようなメカニズムによって、実際に検索を行い、ノードを特定したとしても、そのノードを表現するためには時間がかかる。また、このメカニズムは、ノード間の関係を問題とする検索(例えば、祖先に「60歳」という「年齢」を含み、子孫に「1歳」という「年齢」を含むツリーの抽出)には利用できない。   Even if a search is actually performed and a node is specified by such a mechanism, it takes time to express the node. In addition, this mechanism is used for a search in which the relation between nodes is a problem (for example, extraction of a tree including “age” “60 years old” as an ancestor and “age” “1 year” as a descendant). Can not.

このような従来技術の根本的な問題点は、個々のデータのみに着目し、データを蓄えたノード間をポインタで接続することによりツリー型データ構造が表現されているため、データ間の関係、例えば、親子、祖先、子孫、兄弟(シブリング)、世代などの関係を効率的にトレースすることができないことにある。換言すると、ポインタは、その値が一定しないため、データの格納アドレスを示すという用途にしか使用できず、ノード間の関係を直接的に表現することができない。その結果として、従来技術では、ツリー型データ構造のデータを検索、集計、ソートすることが困難であった。また、上記のDOMは、ツリー型データ構造のトポロジーを編集する操作のインタフェースを規定するだけであり、操作の具体的手法を規定するものではない。   The fundamental problem of such prior art is that the tree-type data structure is expressed by connecting the nodes that store the data with pointers, focusing only on the individual data. For example, the relationship between parent and child, ancestor, descendant, sibling (sibling), generation, etc. cannot be traced efficiently. In other words, since the value of the pointer is not constant, it can be used only for the purpose of indicating the data storage address, and the relationship between the nodes cannot be expressed directly. As a result, in the prior art, it has been difficult to search, aggregate, and sort data having a tree-type data structure. Further, the above DOM only defines an operation interface for editing the topology of the tree-type data structure, and does not define a specific method of operation.

そこで、本発明は、効率的にツリー型データ構造のデータを検索、集計、ソートすることができる方法、情報処理装置、プログラム、および、プログラムを記録した記録媒体の提供を目的とする。   SUMMARY An advantage of some aspects of the invention is that it provides a method, an information processing apparatus, a program, and a recording medium on which a program is recorded, which can efficiently search, aggregate, and sort data having a tree-type data structure.

上記目的を達成するため、本発明は、ツリー型データ構造を構成するノード間の親子関係を、親ノードに子ノードを対応付ける「親→子」関係ではなく、子ノードに親ノードを対応付ける「子→親」関係によって表現するという親子関係表現に基づいて、ツリー型データ構造のデータを検索、集計、ソートする。   To achieve the above object, according to the present invention, a parent-child relationship between nodes constituting a tree-type data structure is not a “parent → child” relationship in which a child node is associated with a parent node, but a “child” that associates a parent node with a child node. Based on the parent-child relationship expression expressed by the “parent” relationship, the data of the tree type data structure is searched, aggregated, and sorted.

したがって、本発明によれば、記憶装置に展開されたルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを検索する方法は、請求項1に記載されるように、
ルート・ノードを含む全ノードに固有のノード識別子が付与され、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
実体情報に関する検索条件を指定する条件指定ステップと、
各ノードについて、当該ノードに関連付けられた実体情報が前記検索条件と一致するかどうかを判定し、一致した場合に当該ノードに検索ヒット情報を関連付け、前記ノード間の親子関係を辿って当該ノードの祖先ノードに検索ヒット情報を関連付ける検索ステップと、
を有する。これにより、実体情報を指定して、全ツリーを検査し、条件に合致するノードを検出することができる。
Therefore, according to the present invention, a method for retrieving 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 is described in claim 1. As
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, thereby , The parent-child relationship between the nodes that make up the tree data structure is represented,
Each node is associated with at least one entity information representing data,
A condition specifying step for specifying a search condition for entity 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 traced. A search step for associating search hit information with an ancestor node;
Have As a result, it is possible to specify the entity information, inspect the entire tree, and detect nodes that meet the conditions.

従来から知られている「親→子」関係によって親子関係を表現する場合、一つの親ノードに複数の子ノードが対応する場合があるので、親ノードと子ノードの二つの要素を特定しなければ親子関係を定義できない。即ち、親ノードを特定しても、その親ノードと親子関係にある子ノードを特定することができない。これに対して、本発明のように「子→親」関係によって親子関係を表現する場合、一つの子ノードには必ず唯一の親ノードが対応するので、子ノードを特定することによって、この子ノードに対応する唯一の親ノードを直ちに特定することができる。これにより、ツリー型データ構造のデータを高速に検索できるようになる。   When a parent-child relationship is expressed by a conventionally known “parent → child” relationship, a single parent node may correspond to a plurality of child nodes, so two elements of the parent node and the child node must be specified. A parent-child relationship cannot be defined. That is, even if a parent node is specified, a child node having a parent-child relationship with the parent node cannot be specified. On the other hand, when the parent-child relationship is expressed by the “child → parent” relationship as in the present invention, since only one parent node always corresponds to one child node, this child node can be specified by specifying the child node. The only parent node corresponding to the node can be immediately identified. As a result, data having a tree-type data structure can be retrieved at high speed.

特に、ノード識別子を整数により定義すると、親子関係を定義する際に、子ノードの識別子を収容する配列が不要になるので(すなわち、ツリー型データ構造のトポロジーは一つの配列で記述できるので)、メモリ使用量が削減され、処理速度が高速化する。好ましくは、ノード識別子は整数連番にされる。   In particular, if node identifiers are defined by integers, an array that accommodates child node identifiers is not required when defining a parent-child relationship (that is, the topology of a tree-type data structure can be described by a single array). Memory usage is reduced and processing speed is increased. Preferably, the node identifier is an integer serial number.

また、本発明は、請求項2に記載されるように、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含むノード群であり、
条件指定ステップは、検索範囲を表す少なくとも一つの部分ツリーを指定するステップを含み、
検索ステップの後に、検索ヒット情報が関連付けられたノードを含む部分ツリーを表す識別子を検索結果として保存するステップをさらに有する。これにより、検索結果が部分ツリーを表す識別子のリストとして得られる。
The present invention also 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,
After the search step, 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. Thereby, the search result is obtained as a list of identifiers representing the partial tree.

このように、特定のノードとその特定のノードの子孫ノードは部分ツリーという形でまとめて取り扱うと、この部分ツリーを用いて検索の範囲を指定したり、検索の結果を表したりすることができるので、非常に便利である。   In this way, when a specific node and descendant nodes of the specific node are handled together in the form of a partial tree, the search range can be specified and the search result can be expressed using the partial tree. So it is very convenient.

また、本発明によれば、記憶装置に展開されたルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを検索する方法は、請求項3に記載されるように、
ルート・ノードを含む全ノードに固有のノード識別子が付与され、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含むノード群であり、
少なくとも一つの実体情報に関する検索条件を指定し、検索範囲を表す少なくとも一つの部分ツリーを指定するステップと、
各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーに属するノード群に関連付けられた少なくとも一つの実体情報が前記検索条件と一致するかどうかを判定し、一致したノードに検索ヒット情報を関連付けるステップと、
を有する。これにより、指定された部分ツリーを検査し、ヒットしたノードを検索結果として得ることができる。
According to the present invention, there is provided a method for retrieving 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. As
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, thereby , The parent-child relationship between the nodes that make up the tree data structure is represented,
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 a search condition for at least one entity information and specifying at least one subtree representing a search range;
For each partial tree, the parent-child relationship between the nodes is traced to determine whether at least one entity information associated with a node group belonging to the partial tree matches the search condition, and search hit information is sent to the matched node. A step of associating with
Have As a result, the specified partial tree is inspected, and the hit node can be obtained as a search result.

また、本発明によれば、記憶装置に展開されたルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを検索する方法は、請求項4に記載されるように、
ルート・ノードを含む全ノードに固有のノード識別子が付与され、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含むノード群であり、
少なくとも一つの実体情報に関する検索条件を指定し、検索範囲を表す少なくとも一つの部分ツリーを指定するステップと、
各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーに属するノードに関連付けられた少なくとも一つの実体情報が前記検索条件と一致するかどうかを判定し、一致したノードが存在する場合に、当該部分ツリーを表す識別子を検索結果として保存するステップと、
を有する。これにより、実体情報を検索条件として指定し、部分ツリーを検査し、部分ツリーの識別子を検索結果として得ることができる。
According to the present invention, there is provided a method for retrieving 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. As
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, thereby , The parent-child relationship between the nodes that make up the tree data structure is represented,
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 a search condition for at least one entity information and specifying at least one subtree representing a search range;
For each partial tree, the parent-child relationship between the nodes is traced to determine whether at least one entity information associated with the node belonging to the partial tree matches the search condition. Storing an identifier representing the partial tree as a search result;
Have Thereby, entity information can be designated as a search condition, a partial tree can be inspected, and an identifier of the partial tree can be obtained as a search result.

また、本発明によれば、記憶装置に展開されたルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを検索する方法は、請求項5に記載されるように、
ルート・ノードを含む全ノードに固有のノード識別子が付与され、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含むノード群であり、
少なくとも一つの実体情報に関する検索条件を指定し、検索範囲を表す少なくとも一つの部分ツリーを指定するステップと、
各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーの祖先ノードを特定し、当該部分ツリーの特定のノード及び/又は祖先ノードに関連付けられた少なくとも一つの実体情報が前記検索条件と一致するかどうかを判定し、一致したノードに検索ヒット情報を関連付けるステップと、
を有する。これにより、実体情報を検索条件として指定し、祖先ノードを検査して、検索条件に合致したノードを検索結果として得ることができる。
According to the present invention, there is provided a method for retrieving 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. As
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, thereby , The parent-child relationship between the nodes that make up the tree data structure is represented,
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 a search condition for at least one entity information and specifying at least one subtree representing a search range;
For each partial tree, an ancestor node of the partial tree is identified by tracing the parent-child relationship between the nodes, and at least one entity information associated with the specific node and / or ancestor node of the partial tree is the search condition. Determining whether they match and associating search hit information with the matched nodes;
Have Thereby, entity information is designated as a search condition, an ancestor node is inspected, and a node that matches the search condition can be obtained as a search result.

また、本発明によれば、記憶装置に展開されたルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを検索する方法は、請求項6に記載されるように、
ルート・ノードを含む全ノードに固有のノード識別子が付与され、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含むノード群であり、
少なくとも一つの実体情報に関する検索条件を指定し、検索範囲を表す少なくとも一つの部分ツリーを指定するステップと、
各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーの祖先ノードを特定し、当該部分ツリーの特定のノード及び/又は祖先ノードに関連付けられた少なくとも一つの実体情報が前記検索条件と一致するかどうかを判定し、一致したノードが存在する場合に、当該部分ツリーを表す識別子を検索結果として保存するステップと、
を有する。これにより、検索条件として実体情報を指定し、祖先ノードを検査し、検索にヒットした祖先ノードを有する部分ツリーの識別子を検索結果として得ることができる。
According to the present invention, there is provided a method for retrieving 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. As
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, thereby , The parent-child relationship between the nodes that make up the tree data structure is represented,
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 a search condition for at least one entity information and specifying at least one subtree representing a search range;
For each partial tree, an ancestor node of the partial tree is identified by tracing the parent-child relationship between the nodes, and at least one entity information associated with the specific node and / or ancestor node of the partial tree is the search condition. Determining whether they match, and if there is a matching node, storing an identifier representing the partial tree as a search result;
Have Thereby, entity information can be designated 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.

また、本発明によれば、記憶装置に展開されたルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを第1の検索条件と第2の検索条件を論理的に組み合わせて検索する方法は、請求項7に記載されるように、
ルート・ノードを含む全ノードに固有のノード識別子が付与され、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含むノード群であり、
検索範囲を表す少なくとも一つの部分ツリーが指定され、
少なくとも一つの実体情報を指定する第1の検索条件に従って、前記ノード間の親子関係を辿って当該第1の検索条件に一致するノードが属する部分ツリーを表す識別子を第1の検索結果として保存するステップと、
少なくとも一つの実体情報を指定する第2の検索条件に従って、前記ノード間の親子関係を辿って当該第1の検索条件に一致するノードが属する部分ツリーを表す識別子を第2の検索結果として保存するステップと、
第1の検索条件と第2の検索条件の論理的な関係に対応した論理演算を第1の検索結果と第2の検索結果に実行することにより、第1の検索条件と第2の検索条件を論理的に組み合わせた検索結果を生成するステップと、
を有する。これにより、検索条件を組み合わせた検索が、個別の検索条件による検索と、個別の検索の検索結果の論理演算として実現される。
Further, according to the present invention, the first search condition and the second search condition are used for the data of the tree type data structure including the root node developed in the storage device and the non-root node which is a node other than the root node. As described in claim 7, a method of searching by logically combining
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, thereby , The parent-child relationship between the nodes that make up the tree data structure is represented,
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,
In accordance with a first search condition that specifies at least one entity information, the parent-child relationship between the nodes is traced, and an identifier representing a partial tree to which a node that matches the first search condition belongs is stored as a first search result. Steps,
According to a second search condition designating at least one entity information, the parent-child relationship between the nodes is traced, and an identifier representing a partial tree to which a node that matches the first search condition belongs is stored as a second search result. Steps,
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 condition Generating search results that are logically combined, and
Have Thereby, the search combining the search conditions is realized as a logical operation of the search by the individual search conditions and the search result of the individual search.

また、本発明によれば、記憶装置に展開されたルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを集計する方法は、請求項8に記載されるように、
ルート・ノードを含む全ノードに固有のノード識別子が付与され、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含むノード群であり、
集計の対象を表す実体情報を指定し、集計の範囲を表す少なくとも一つの部分ツリーを指定するステップと、
各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーに属するノード群を特定し、当該ノード群の中に集計の対象を表す実体情報が関連付けられたノードが存在するかどうかを判定し、存在する場合に、当該ノードに関連付けられた実体情報を集計するステップと、
を有する。この方法は、各部分ツリーを明示的に指定することにより、次元を指定しない集計、すなわち、部分ツリー内の測度の集計を実現する。
According to the present invention, there is provided a method for aggregating data of a tree type data structure including a root node expanded in a storage device and a non-root node which is a node other than the root node. As
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, thereby , The parent-child relationship between the nodes that make up the tree data structure is represented,
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 target of aggregation and specifying at least one partial tree representing a range of aggregation;
For each partial tree, the node group belonging to the partial tree is identified by tracing the parent-child relationship between the nodes, and it is determined whether there is a node associated with entity information representing the target of aggregation in the node group. And, if present, counting the entity information associated with the node;
Have This method realizes tabulation without specifying a dimension, that is, tabulation of measures in the subtree by explicitly specifying each subtree.

また、本発明によれば、記憶装置に展開されたルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを集計する方法は、請求項9に記載されるように、
ルート・ノードを含む全ノードに固有のノード識別子が付与され、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含むノード群であり、
集計の分類対象を表す実体情報を指定し、集計の対象を表す実体情報を指定し、集計の範囲を表す少なくとも一つの部分ツリーを指定するステップと、
各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーに属するノード群を特定し、当該ノード群の中に集計の対象を表す実体情報が関連付けられたノードが存在するかどうかを判定し、存在する場合に、当該ノードに関連付けられた実体情報を、当該部分ツリーに属するノード群に関係した集計の分類対象を表す実体情報毎に集計するステップと、
を有する。この方法は、集計の対象=測度、集計の範囲=カテゴリ、及び、集計の分類対象=次元を指定して、部分ツリー内の測度を集計することができる。
According to the present invention, a method for aggregating 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 is described in claim 9. As
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, thereby , The parent-child relationship between the nodes that make up the tree data structure is represented,
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, the node group belonging to the partial tree is identified by tracing the parent-child relationship between the nodes, and it is determined whether there is a node associated with entity information representing the target of aggregation in the node group. And, when present, summing up entity information associated with the node for each entity information representing a classification target of aggregation related to a node group belonging to the partial tree;
Have This method can aggregate the measures in the partial tree by specifying the aggregation target = measure, the aggregation range = category, and the classification target = dimension.

また、本発明によれば、記憶装置に展開されたルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータの少なくとも二つのノード群に順序を付ける方法は、請求項10に記載されるように、
ルート・ノードを含む全ノードに固有のノード識別子が付与され、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造のデータの特定のノード及び当該特定のノードの子孫ノードを含むノード群であり、
集計の対象を表す実体情報を指定し、集計の範囲を表す少なくとも二つの部分ツリーを指定するステップと、
各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーに属するノード群を特定し、当該ノード群の中に集計の対象を表す実体情報が関連付けられたノードが存在するかどうかを判定し、存在する場合に、当該ノードに関連付けられた実体情報を集計するステップと、
部分ツリー毎に集計された項目値情報の順序関係に従って当該少なくとも二つの部分ツリーに順序を付けるステップと、
を有する。この方法は、集計結果を利用して、部分ツリーをソートすることができる。
Further, according to the present invention, there is provided a method for ordering 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. 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, thereby , The parent-child relationship between the nodes that make up the tree data structure is represented,
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 data of a tree-type data structure and descendant nodes of the specific node,
Designating entity information representing a target of aggregation, specifying at least two partial trees representing a range of aggregation;
For each partial tree, the node group belonging to the partial tree is identified by tracing the parent-child relationship between the nodes, and it is determined whether there is a node associated with entity information representing the target of aggregation in the node group. And, if present, counting the entity information associated with the node;
Ordering the at least two partial trees according to the order relation of the item value information aggregated for each partial tree;
Have In this method, the partial tree can be sorted using the aggregation result.

また、本発明によれば、記憶装置に展開されたルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータの少なくとも二つのノード群に順序を付ける方法は、
ルート・ノードを含む全ノードに固有のノード識別子が付与され、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、
各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、
部分ツリーはツリー型データ構造のデータの特定のノード及び当該特定のノードの子孫ノードを含むノード群であり、
順序付けの対象となる少なくとも二つの部分ツリーを指定し、順序付けの指標となる実体情報を指定するステップと、
各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーに属するノード群を特定し、当該ノード群の中で、順序付けの指標となる実体情報が関連付けられたノードに関連付けられた実体情報を取得するステップと、
部分ツリー毎に取得された実体情報の順序関係に従って当該少なくとも二つの部分ツリーに順序を付けるステップと、
を有する。この方法は、実体情報を利用して部分ツリーをソートすることができる。
Further, according to the present invention, there is provided a method for ordering 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. ,
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, thereby , The parent-child relationship between the nodes that make up the tree data structure is represented,
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 data of a tree-type data structure and descendant nodes of the specific node,
Specifying at least two partial trees to be ordered, and specifying entity information to be an index of ordering;
For each partial tree, the parent-child relationship between the nodes is traced to identify a node group belonging to the partial tree, and the entity information associated with the node associated with the entity information serving as an index for ordering in the node group Step to get the
Ordering the at least two partial trees according to the order relation of the entity information acquired for each partial tree;
Have This method can sort partial trees using entity information.

本発明の好ましい実施の形態によれば、請求項12に記載されるように、各実体情報はデータの項目を表す項目名情報又はデータの項目値を表す項目値情報である。   According to a preferred embodiment of the present invention, as described in claim 12, each entity information is item name information representing a data item or item value information representing a data item value.

また、本発明の好ましい実施の形態によれば、請求項13に記載されるように、特定のノード及び当該特定のノードの子孫ノードを含む部分ツリーは当該特定のノードのノード識別子によって表される。これにより、一つの頂点ノードで部分ツリーを代表させることができる。検索の結果や、検索や集計の対象範囲をこの頂点ノードで記述することが可能になる。   According to a preferred embodiment of the present invention, as described in claim 13, a partial tree including a specific node and descendant nodes of the specific node is represented by a node identifier of the specific node. . Thereby, a partial tree can be represented by one vertex node. It becomes possible to describe the result of the search and the target range of the search and aggregation by this vertex node.

また、本発明の一部の好ましい実施の形態では、請求項14に記載されるように、ルート・ノードを含む全ノードに付与された固有のノード識別子は同じ世代のノードよりも子ノードを優先して付与される。このような深さ優先の親子表現を利用すると、あるノードの子孫ノードが親子表現の連続領域に出現するという優れた性質が得られ、検索、集計、ソートの処理を高速化することが可能である。   Also, in some preferred embodiments of the present invention, as described in claim 14, the unique node identifier given to all nodes including the root node gives priority to child nodes over nodes of the same generation. To be granted. By using such a depth-priority parent-child expression, it is possible to obtain an excellent property that a descendant node of a certain node appears in a continuous region of the parent-child expression, and it is possible to speed up the search, aggregation, and sort processing. is there.

本発明の別の実施の形態では、請求項15に記載されるように、ツリー型データ構造のデータはツリー識別子が付与された複数のツリーデータを含む。これにより、複数のツリーデータを検索、集計、ソートの対象として処理することが可能になる。   In another embodiment of the present invention, as described in claim 15, 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 a plurality of tree data as search, aggregation, and sort targets.

請求項1乃至15に記載された方法を実施する情報処理装置は請求項16乃至30に記載されている。本発明の情報処理装置は、請求項16に記載されるように、ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータを検索する情報処理装置であって、
ルート・ノードを含む全ノードに固有のノード識別子を付与し、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係を表現し、各ノードにデータを表す少なくとも一つの実体情報を関連付け、ツリー型データ構造を記憶装置上に構築するデータ展開手段と、
少なくとも一つの実体情報に関する検索条件を指定する条件指定手段と、
各ノードについて、当該ノードに関連付けられた少なくとも一つの実体情報が前記検索条件と一致するかどうかを判定し、一致した場合に当該ノードに検索ヒット情報を関連付け、前記ノード間の親子関係を辿って当該ノードの祖先ノードに検索ヒット情報を関連付ける検索手段と、
を有する。
An information processing apparatus that performs the method according to claims 1 to 15 is described in claims 16 to 30. An information processing apparatus according to the present invention 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 storage device,
Assign a unique node identifier to all nodes including the root node and associate the node identifier assigned to each non-root node with the node identifier assigned to each parent node of the non-root node, thereby Data expansion means for expressing a parent-child relationship between nodes constituting a tree-type data structure, associating each node with at least one entity information representing data, and building a tree-type data structure on a storage device;
A condition specifying means for specifying a search condition for at least one entity information;
For each node, it is determined whether or not at least one 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 traced. Search means for associating search hit information with an ancestor node of the node;
Have

この情報処理装置において、請求項17に記載されるように、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含むノード群であり、
条件指定手段は、検索範囲を表す少なくとも一つの部分ツリーを指定する手段を含み、
検索手段は、検索ヒット情報が関連付けられたノードを含む部分ツリーを表す識別子を検索結果として保存する手段を含む。
In this information processing apparatus, as described in claim 17,
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 a search range,
The search means includes means for storing an identifier representing a partial tree including a node associated with the search hit information as a search result.

また、請求項18に記載された情報処理装置は、ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータを検索する情報処理装置であって、
ルート・ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノード識別子を付与し、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、各ノードにデータを表す少なくとも一つの実体情報を関連付け、ツリー型データ構造を記憶装置上に構築するデータ展開手段と、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含むノード群であり、少なくとも一つの実体情報に関する検索条件を指定し、検索範囲を表す少なくとも一つの部分ツリーを指定する条件指定手段と、
各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーに属するノード群を特定し、当該ノード群に関連付けられた少なくとも一つの実体情報が前記検索条件と一致するかどうかを判定し、一致したノードに検索ヒット情報を関連付ける検索手段と、
を有する。
An information processing apparatus according to claim 18 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 stored data,
All nodes including the root node are given a unique node identifier in preference to the child node over the same generation node, and each parent node of the non-root node is assigned to the node identifier assigned to each non-root node As a result, 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 stored on the storage device. Data development means to build on,
A partial tree is a node group including a specific node of a tree-type data structure and descendant nodes of the specific node, specifies a search condition for at least one entity information, and specifies at least one partial tree representing a search range. Condition specifying means;
For each partial tree, trace a parent-child relationship between the nodes to identify a node group belonging to the partial tree, 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;
Have

請求項19に記載された情報処理装置は、ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータを検索する情報処理装置であって、
ルート・ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノード識別子を付与し、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、各ノードにデータを表す少なくとも一つの実体情報を関連付け、ツリー型データ構造を記憶装置上に構築するデータ展開手段と、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含むノード群であり、少なくとも一つの実体情報に関する検索条件を指定し、検索範囲を表す少なくとも一つの部分ツリーを指定する条件指定手段と、
各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーに属するノード群を特定し、当該ノード群に関連付けられた少なくとも一つの実体情報が前記検索条件と一致するかどうかを判定し、一致したノードが存在する場合に、当該部分ツリーを表す識別子を検索結果として保存する検索手段と、
を有する。
The information processing apparatus according to claim 19 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 is stored in the storage device. An information processing device for retrieving stored data,
All nodes including the root node are given a unique node identifier in preference to the child node over the same generation node, and each parent node of the non-root node is assigned to the node identifier assigned to each non-root node As a result, 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 stored on the storage device. Data development means to build on,
A partial tree is a node group including a specific node of a tree-type data structure and descendant nodes of the specific node, specifies a search condition for at least one entity information, and specifies at least one partial tree representing a search range. Condition specifying means;
For each partial tree, trace a parent-child relationship between the nodes to identify a node group belonging to the partial tree, determine whether at least one entity information associated with the node group matches the search condition, Search means for storing an identifier representing the partial tree as a search result when a matching node exists;
Have

請求項20に記載された情報処理装置は、ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータを検索する情報処理装置であって、
ルート・ノードを含む全ノードに固有のノード識別子を付与し、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、各ノードにデータを表す少なくとも一つの実体情報を関連付け、ツリー型データ構造を記憶装置上に構築するデータ展開手段と、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含むノード群であり、少なくとも一つの実体情報に関する検索条件を指定し、検索範囲を表す少なくとも一つの部分ツリーを指定する条件指定手段と、
各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーの祖先ノードを特定し、当該部分ツリーの特定のノード及び/又は祖先ノードに関連付けられた少なくとも一つの実体情報が前記検索条件と一致するかどうかを判定し、一致したノードに検索ヒット情報を関連付ける検索手段と、
を有する。
The information processing apparatus according to claim 20 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 is stored in the storage device. An information processing device for retrieving stored data,
Assign a unique node identifier to all nodes including the root node and associate the node identifier assigned to each non-root node with the node identifier assigned to each parent node of the non-root node, thereby Data expansion means for expressing a parent-child relationship between nodes constituting a tree-type data structure, associating at least one entity information representing data with each node, and constructing the tree-type data structure on a storage device;
A partial tree is a node group including a specific node of a tree-type data structure and descendant nodes of the specific node, specifies a search condition for at least one entity information, and specifies at least one partial tree representing a search range. Condition specifying means;
For each partial tree, an ancestor node of the partial tree is identified by tracing the parent-child relationship between the nodes, and at least one entity information associated with the specific node and / or ancestor node of the partial tree is the search condition. A search means for determining whether or not to match, and associating search hit information with the matched node;
Have

請求項21に記載された情報処理装置は、ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータを検索する情報処理装置であって、
ルート・ノードを含む全ノードに固有のノード識別子を付与し、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、各ノードにデータを表す少なくとも一つの実体情報を関連付け、ツリー型データ構造を記憶装置上に構築するデータ展開手段と、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含むノード群であり、少なくとも一つの実体情報に関する検索条件を指定し、検索範囲を表す少なくとも一つの部分ツリーを指定する条件指定手段と、
各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーの祖先ノードを特定し、当該部分ツリーの特定のノード及び/又は祖先ノードに関連付けられた少なくとも一つの実体情報が前記検索条件と一致するかどうかを判定し、一致したノードが存在する場合に、当該部分ツリーを表す識別子を検索結果として保存する検索手段と、
を有する。
The information processing apparatus according to claim 21 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 is stored in the storage device. An information processing device for retrieving stored data,
Assign a unique node identifier to all nodes including the root node and associate the node identifier assigned to each non-root node with the node identifier assigned to each parent node of the non-root node, thereby Data expansion means for expressing a parent-child relationship between nodes constituting a tree-type data structure, associating at least one entity information representing data with each node, and constructing the tree-type data structure on a storage device;
A partial tree is a node group including a specific node of a tree-type data structure and descendant nodes of the specific node, specifies a search condition for at least one entity information, and specifies at least one partial tree representing a search range. Condition specifying means;
For each partial tree, an ancestor node of the partial tree is identified by tracing the parent-child relationship between the nodes, and at least one entity information associated with the specific node and / or ancestor node of the partial tree is the search condition. A search unit that determines whether or not a match is found, and stores a identifier representing the partial tree as a search result when a matching node exists;
Have

請求項22に記載された情報処理装置は、ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを記憶する記憶装置を有し、第1の検索条件と第2の検索条件を論理的に組み合わせて検索する情報処理装置であって、
ルート・ノードを含む全ノードに固有のノード識別子を付与し、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、各ノードにデータを表す少なくとも一つの実体情報を関連付け、ツリー型データ構造を記憶装置上に構築するデータ展開手段と、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含むノード群であり、検索範囲を表す少なくとも一つの部分ツリーを指定する条件指定手段と、
少なくとも一つの実体情報を指定する第1の検索条件に従って、前記ノード間の親子関係を辿って当該第1の検索条件に一致するノードが属する部分ツリーを表す識別子を第1の検索結果として保存し、少なくとも一つの実体情報を指定する第2の検索条件に従って、前記ノード間の親子関係を辿って当該第1の検索条件に一致するノードが部分ツリーを表す識別子を第2の検索結果として保存する検索手段と、
第1の検索条件と第2の検索条件の論理的な関係に対応した論理演算を第1の検索結果と第2の検索結果に実行することにより、第1の検索条件と第2の検索条件を論理的に組み合わせた検索結果を生成する組み合わせ手段と、
を有する。
An information processing apparatus according to claim 22 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 condition And an information processing apparatus that performs a logical combination of the second search condition and
Assign a unique node identifier to all nodes including the root node and associate the node identifier assigned to each non-root node with the node identifier assigned to each parent node of the non-root node, thereby Data expansion means for expressing a parent-child relationship between nodes constituting a tree-type data structure, associating at least one entity information representing data with each node, and constructing the tree-type data structure on a storage device;
The partial tree is a node group including a specific node of the tree-type data structure and descendant nodes of the specific node, and condition specifying means for specifying at least one partial tree representing a search range;
According to a first search condition that specifies at least one entity information, the parent-child relationship between the nodes is traced, and an identifier representing a partial tree to which a node that matches the first search condition belongs is stored as a first search result. In accordance with a second search condition designating at least one entity information, the parent-child relationship between the nodes is traced, and an identifier in which a node matching the first search condition represents a partial tree is stored as a second search result. Search means;
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 condition A combination means for generating a search result that logically combines
Have

請求項23に記載された情報処理装置は、ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータを集計する情報処理装置であって、
ルート・ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノード識別子を付与し、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、各ノードにデータを表す少なくとも一つの実体情報を関連付け、ツリー型データ構造を記憶装置上に展開するデータ展開手段と、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含むノード群であり、集計の対象を表す実体情報を指定し、集計の範囲を表す少なくとも一つの部分ツリーを指定する条件指定手段と、
各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーに属するノード群を特定し、当該ノード群の中に集計の対象を表す実体情報が関連付けられたかどうかを判定し、存在する場合に、当該ノードに関連付けられた実体情報を集計する集計手段と、
を有する。
The information processing apparatus according to claim 23 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 is stored in the storage device. An information processing device for collecting collected data,
All nodes including the root node are given a unique node identifier in preference to the child node over the same generation node, and each parent node of the non-root node is assigned to the node identifier assigned to each non-root node As a result, 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 stored on the storage device. Data expansion means to expand to,
A partial tree is a node group including a specific node of a tree-type data structure and descendant nodes of the specific node, specifies entity information indicating a target of aggregation, and specifies at least one partial tree indicating a range of aggregation. Condition specifying means;
For each partial tree, the node group belonging to the partial tree is identified by tracing the parent-child relationship between the nodes, and it is determined whether entity information representing the aggregation target is associated with the node group. And a counting means for counting the entity information associated with the node,
Have

請求項24に記載された情報処理装置は、ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータを集計する情報処理装置であって、
ルート・ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノード識別子を付与し、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、各ノードにデータを表す少なくとも一つの実体情報を関連付け、ツリー型データ構造を記憶装置上に展開するデータ展開手段と、
部分ツリーはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含むノード群であり、集計の分類対象を表す実体情報を指定し、集計の対象を表す実体情報を指定し、集計の範囲を表す少なくとも一つの部分ツリーを指定する条件指定手段と、
各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーに属するノード群を特定し、当該ノード群の中に集計の対象を表す実体情報が関連付けられたノードが存在するかどうかを判定し、存在する場合に、当該ノードに関連付けられた実体情報を、当該部分ツリーに属するノード群に関係した集計の分類対象を表す実体情報毎に集計する集計手段と、
を有する。
An information processing apparatus according to claim 24 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 is stored in the storage device. An information processing device for collecting collected data,
All nodes including the root node are given a unique node identifier in preference to the child node over the same generation node, and each parent node of the non-root node is assigned to the node identifier assigned to each non-root node As a result, 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 stored on the storage device. Data expansion means to expand to,
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 classification target of aggregation, specifies entity information that represents the aggregation target, and totals A condition specifying means for specifying at least one partial tree representing a range of
For each partial tree, the node group belonging to the partial tree is identified by tracing the parent-child relationship between the nodes, and it is determined whether there is a node associated with entity information representing the target of aggregation in the node group. And, if present, a totaling means for counting the 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;
Have

請求項25に記載された情報処理装置は、ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータの少なくとも二つのノード群に順序を付ける情報処理装置であって、
ルート・ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノード識別子を付与し、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、各ノードにデータを表す少なくとも一つの実体情報を関連付け、ツリー型データ構造を記憶装置上に展開するデータ展開手段と、
部分ツリーはツリー型データ構造のデータの特定のノード及び当該特定のノードの子孫を含むノード群であり、集計の対象を表す実体情報を指定し、集計の範囲を表す少なくとも二つの部分ツリーを指定する条件指定手段と、
各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーに属するノード群を特定し、当該ノード群の中に集計の対象を表す実体情報が関連付けられたノードが存在するかどうかを判定し、存在する場合に、当該ノードに関連付けられた実体情報を集計する集計手段と、
部分ツリー毎に集計された項目値情報の順序関係に従って当該少なくとも二つの部分ツリーに順序を付ける順序付け手段と、
を有する。
An information processing apparatus according to claim 25 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 is stored in the storage device. An information processing apparatus for ordering at least two nodes of the data,
All nodes including the root node are given a unique node identifier in preference to the child node over the same generation node, and each parent node of the non-root node is assigned to the node identifier assigned to each non-root node As a result, 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 stored on the storage device. Data expansion means to expand to,
A partial tree is a node group that includes a specific node of data in a tree-type data structure and descendants of the specific node, specifies entity information that represents the target of aggregation, and specifies at least two partial trees that represent the range of aggregation A condition designating means,
For each partial tree, the node group belonging to the partial tree is identified by tracing the parent-child relationship between the nodes, and it is determined whether there is a node associated with entity information representing the target of aggregation in the node group. And, if present, a counting means for counting the entity information associated with the node,
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;
Have

請求項26に記載された情報処理装置は、ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータの少なくとも二つのノード群に順序を付ける情報処理装置であって、
ルート・ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノード識別子を付与し、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、各ノードにデータを表す少なくとも一つの実体情報を関連付け、ツリー型データ構造のデータを記憶装置上に展開するデータ展開手段と、
部分ツリーはツリー型データ構造のデータの特定のノード及び当該特定のノードの子孫ノードを含むノード群であり、順序付けの対象となる少なくとも二つの部分ツリーを指定し、順序付けの指標となる実体情報を指定する条件指定手段と、
各ツリーデータに属する各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーに属するノード群を特定し、当該ノード群の中で、順序付けの指標となる実体情報が関連付けられたノードに関連付けられた実体情報を取得する指標取得手段と、
部分ツリー毎に取得された項目値情報の順序関係に従って当該少なくとも二つの部分ツリーに順序を付ける順序付け手段と、
を有する。
An information processing apparatus according to claim 26 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 is stored in the storage device. An information processing apparatus for ordering at least two nodes of the data,
All nodes including the root node are given a unique node identifier in preference to the child node over the same generation node, and each parent node of the non-root node is assigned to the node identifier assigned to each non-root node As a result, 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 data of the tree-type data structure is stored. Data expansion means for expanding on the device;
The partial tree is a group of nodes including a specific node of data having a tree-type data structure and descendant nodes of the specific node, and specifies at least two partial trees to be ordered, and includes entity information serving as an index for ordering. A condition specifying means to be specified;
For each partial tree belonging to each tree data, the node group belonging to the partial tree is identified by tracing the parent-child relationship between the nodes, and the node information associated with the entity information serving as an index for ordering is specified in the node group. Index acquisition means for acquiring associated entity information;
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;
Have

また、本発明によれば、請求項31乃至45に記載されているように、請求項1乃至15に係る方法を実行するためのプログラムが提供される。   Further, according to the present invention, as described in claims 31 to 45, a program for executing the method according to claims 1 to 15 is provided.

更に、本発明によれば、請求項31乃至45に記載されたプログラムを記録した記録媒体が提供される。   Furthermore, according to the present invention, there is provided a recording medium on which the program according to claims 31 to 45 is recorded.

本発明によれば、ツリー型データ構造のノード間の親子関係は、「子→親」表現に基づいて表現されているので、ツリー型データ構造を操作する際にアクセスされるメモリの量が低減し、これにより、検索、集計、ソートを高速に実現することが可能となる。   According to the present invention, since the parent-child relationship between the nodes of the tree-type data structure is expressed based on the “child → parent” expression, the amount of memory accessed when manipulating the tree-type data structure is reduced. As a result, search, tabulation, and sorting can be realized at high speed.

以下、添付図面を参照して、本発明の実施の形態につき説明を加える。   Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings.

[コンピュータシステム構成]
図1は、本発明の実施の形態にかかるツリー型データ構造のデータを検索、集計、ソートするコンピュータシステムのハードウェア構成を示すブロックダイヤグラムである。図1に示すように、このコンピュータシステム10は、通常のものと同様の構成であり、プログラムを実行することによりシステム全体および個々の構成部分を制御するCPU12、ワークデータなどを記憶するRAM(Random Access Memory)14、プログラム等を記憶するROM(Read Only Memory)16、ハードディスク等の固定記憶媒体18、CD−ROM19をアクセスするためのCD−ROMドライバ20、CD−ROMドライバ20や外部ネットワーク(図示せず)と接続された外部端子との間に設けられたインタフェース(I/F)22、キーボードやマウスからなる入力装置24、CRT表示装置26を備えている。CPU12、RAM14、ROM16、外部記憶媒体18、I/F22、入力装置24および表示装置26は、バス28を介して相互に接続されている。
[Computer system configuration]
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 according to an embodiment of the present invention. As shown in FIG. 1, this computer system 10 has the same configuration as a normal one. A CPU 12 that controls the entire system and individual components by executing a program, a RAM (Random) that stores work data, and the like. (Access Memory) 14, a ROM (Read Only Memory) 16 for storing programs, a fixed storage medium 18 such as a hard disk, a CD-ROM driver 20 for accessing the CD-ROM 19, a CD-ROM driver 20 and an external network (FIG. An interface (I / F) 22 provided between an external terminal and a connected external terminal, an input device 24 including a keyboard and a mouse, and a CRT display device 26. 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.

本実施の形態にかかる、ツリー型データ構造のデータを検索、集計、ソートするプログラム、及び、ツリー型データ構造を記憶装置上で変換するプログラムは、CD−ROM19に収容され、CD−ROMドライバ20に読取られても良いし、ROM16に予め記憶されていても良い。また、いったんCD−ROM19から読み出したものを、外部記憶媒体18の所定の領域に記憶しておいても良い。或いは、上記プログラムは、ネットワーク(図示せず)、外部端子およびI/F22を経て外部から供給されるものであっても良い。   A program for searching, summing up, and sorting data having 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-ROM 19 and a CD-ROM driver 20 Or may be stored in the ROM 16 in advance. Further, 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 from the outside via a network (not shown), an external terminal, and the I / F 22.

また、本発明の実施の形態にかかる情報処理装置は、コンピュータシステム10にツリー型データ構造のデータを検索、集計、ソートするプログラムを実行させることにより実現される。   In addition, the information processing apparatus according to the embodiment of the present invention is realized by causing the computer system 10 to execute a program that searches, aggregates, and sorts data having a tree-type data structure.

[ツリー型データ構造]
図2A、Bは、ツリー形式データの一例であるPOSデータの説明図であり、図2Aは、このツリー形式データのデータ構造(即ち、トポロジー)及びデータ値を視覚的に表現した一例である。図2Bは、同じツリー形式データをXML形式で表現した一例である。同図に示されるようにツリー型データ構造は、ルート・ノード(本例では、POSデータ)から始めて、各ノードで枝分かれしてリーフ・ノード(端点)に至るノードとアークの組み合わせによって表現される。各ノードには、項目名情報、すなわち、ノードのタイプと、項目値情報、すなわち、ノードの値が関連付けられ、図2A、Bの例では、XML形式の
<shopName>フランス店</shopName>
に対応したノードは、「shopName(=店名)」というノードタイプと「フランス店」というノード値が関連付けられている。この関連付けは、例えば、ノードタイプ及びノード値を記述する情報が格納されたノード情報格納領域へのポインタを、ノード識別子に随伴させることによって実現することができる。しかし、本発明は、ツリー型データ構造の実体的な値の取り扱い方によって限定されないことに注意する必要がある。
[Tree type data structure]
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. FIG. 2B is an example in which the same tree format data is expressed in XML format. As shown in the figure, the tree-type data structure is represented by a combination of an arc starting from a root node (POS data in this example) and branching at each node to a leaf node (end point). . Each node is associated with item name information, that is, the type of the node, and item value information, that is, the value of the node. In the examples of FIGS.
<shopName> France store </ shopName>
Is associated with a node type of “shopName (= store name)” and a node value of “France store”. 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. However, it should be noted that the present invention is not limited by how the substantial values of the tree-type data structure are handled.

これに対して、ツリー型データ構造のデータの検索、集計、ソートを効率的に実行するためには、ツリー型データ構造のトポロジーを表現する手法、すなわち、記憶装置に展開する手法が非常に重要な役割を果たす。そこで、以下では、主として、ツリー型データ構造のトポロジーに関して説明する。   On the other hand, in order to efficiently search, aggregate, and sort data with a tree-type data structure, a technique that expresses the topology of the tree-type data structure, that is, a technique that expands to a storage device is very important. Play an important role. Therefore, in the following, the topology of the tree data structure will be mainly described.

従来、このようなツリー型データ構造は、データを蓄えたノード間をポインタで接続することによって表現されている。しかし、ポインタ表現は、ポインタ値に必然性がないという欠点がある。即ち、ある場合には特定のノードAがある番地(例えば、100番地)に格納され、別の場合には同じノードAが別の番地(例えば、200番地)に格納されるので、ポインタ値が一定ではなく、ポインタ値は、本質的にノードの格納アドレスを表現するに過ぎない。そのため、例えば、ノードが深さ優先の規則に従ってポインタで接続されている場合、これらのノードを幅優先の規則に従ってポインタで再接続することは困難である。   Conventionally, such a tree-type data structure is expressed by connecting nodes storing data with pointers. However, the pointer expression has a drawback that the pointer value is not necessarily required. 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). Instead of being constant, the pointer value essentially represents the storage address of the node. Therefore, for example, when nodes are connected with a pointer according to a depth priority rule, it is difficult to reconnect these nodes with a pointer according to a width priority rule.

これに対して、本発明者は、ツリー型データ構造のトポロジーがアークリストによって記述可能であることに着目した。アークリストとは、ノード間の親子関係を表すアークのリストである。図3A〜Cは、アークリストを用いたツリー型データ構造の表現形式の一例の説明図である。同図の例では、0、10、20、30、40、50、60、70、80、90、100及び110のノード識別子(ID)が付与された12個のノードからなるツリー型データ構造が示されている。図3Aはツリー型データ構造の全体を示している。図3Aにおいて、(ノードのタイプを表している)丸形、ハート形などの図形の中央に記載された数字は、ノードIDを表し、矢印と矢印の側に記載された<0,10>などの数字の対は、アークを表している。尚、ノードIDは、文字列には限られず、数値、特に、整数でもよい。図3Bは、親ノード(From−ID)から子ノード(To−ID)へのアークリストを示し、図3Cは、ノードIDとノードTypeの対のリストからなるノードリストを示す。尚、ツリー型データ構造を表現するだけの目的のためにはノードリストが無くても構わない。原理的には、このようなアークリストを用いることによって、ノード間の関係をポインタによらずに直接的に記述することが可能である。   On the other hand, the present inventor noticed that the topology of the tree-type data structure can be described by an arc list. The arc list is a list of arcs representing a parent-child relationship between nodes. 3A to 3C are explanatory diagrams of examples of the expression format of the tree-type data structure using the arc list. In the example of the figure, a tree-type data structure consisting of 12 nodes to which node identifiers (IDs) of 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, and 110 are assigned. It is shown. FIG. 3A shows the entire tree-type data structure. In FIG. 3A, a number written in the center of a figure such as a round shape or a heart shape (representing a node type) represents a node ID, such as <0,10> written on the arrow and arrow sides. A pair of numbers represents an arc. The node ID is not limited to a character string, and may be a numerical value, particularly an integer. FIG. 3B 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 pairs of node IDs and node types. Note that the node list may be omitted for the purpose of merely representing the tree-type data structure. In principle, by using such an arc list, it is possible to directly describe the relationship between nodes without using a pointer.

[「子→親」関係に基づく表現]
図3A〜Cの例では、アークリストは、親ノードに子ノードを対応付ける「親→子」関係に基づいて記述されている。そのため、一つの親ノード、例えば、ルート・ノード0には、3個の子ノード10、60及び80が存在するため、アークリストのFrom−IDには、同じノードIDの0が3回出現している。つまり、親ノードを特定しても子ノードを特定することができないので、アークリストは、要素From−IDの配列と要素To−IDの配列により構成される。アークリストを使用する場合、あるノードは、From−IDの配列と、To−IDの配列の両方の配列に出現する。
[Expression based on “child → parent” relationship]
3A to 3C, the arc list is described based on a “parent → child” relationship in which a child node is associated with a parent node. Therefore, since one child node, for example, root node 0, has three child nodes 10, 60, and 80, 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 configured by an element From-ID array and an element To-ID array. When using an arc list, a node appears in both the From-ID array and the To-ID array.

これに対して、親子関係は、「子→親」関係によっても表現することが可能である。この場合、ノード間の親子関係は、ルート・ノード以外のノードである非ルート・ノードの各々と、関連付けられた親ノードと、の組の配列によって表現される。この「子→親」関係によって親子関係を表現する場合、「親→子」関係の場合には得られなかった重要な性質がある。即ち、一つの子ノードには必ず唯一の親ノードが対応するので、子ノードを特定することによって、この子ノードに対応する唯一の親ノードを直ちに特定することができる。つまり、アークリストは、実際には、要素To−IDの配列だけを準備すればよい。この結果として、アークリストを格納するための記憶容量が削減される。この記憶容量の削減は、メモリへのアクセス回数が低減するという効果があるので、結果的に、処理の高速化が実現できる。   On the other hand, the parent-child relationship can also be expressed by a “child → parent” relationship. In this case, the parent-child relationship between the nodes is expressed by an array of pairs of each non-root node that is a node other than the root node and the associated parent node. When the parent-child relationship is expressed by this “child → parent” relationship, there is an important property 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, it is possible to immediately specify the only parent node corresponding to this child node by specifying the child node. That is, in the arc list, it is actually only necessary to prepare 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, processing speed can be increased.

図4A〜Dは、「子→親」関係に基づくツリー型データ構造の表現方法の説明図である。図4Aはツリー全体の説明図であり、図4Bは「子→親」関係に基づくアークリストである。図4Bのアークリストは、ルート・ノードに対する親ノードの格納領域を含んでいるので、ルート・ノードの親ノードとして、便宜的に"−"が設定されている。但し、ルート・ノードに対応する親ノードは存在しないので、図4Cに示されるように、「子→親」関係に基づくアークリストからルート・ノードに対する親ノードの格納領域を除いても構わない。このように、ルート・ノード以外のノードである非ルート・ノードの各々に対して、非ルート・ノードの親ノードを関連付けることによりノード間の親子関係を表現する。そして、「子→親」表現された子のノードから親のノードのリストを辿ることでツリーのトポロジーを表現することができる。   4A to 4D are explanatory diagrams of a method for expressing a tree-type data structure based on the “child → parent” relationship. FIG. 4A is an explanatory diagram of the entire tree, and FIG. 4B is an arc list based on a “child → parent” relationship. Since the arc list of FIG. 4B includes a storage area of a 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, as shown in FIG. 4C, the storage area of the parent node for the root node may be excluded from the arc list based on the “child → parent” relationship. In this way, the parent-child relationship between the nodes is expressed by associating the parent node of the non-root node with each of the non-root nodes that are nodes other than the root node. Then, the topology of the tree can be expressed by tracing the list of parent nodes from the child nodes expressed as “child → parent”.

このような「子→親」関係に基づくツリー型データ構造は、本発明の一実施例によれば、図5に示されるように、図1に示されたコンピュータシステム10に、ルート・ノードを含むノードに固有のノード識別子を付与するノード定義ステップ501と、前記ルート・ノード以外のノードである非ルート・ノードの各々に付与されたノード識別子に、前記非ルート・ノードの各々の親ノードに付与されたノード識別子を関連付ける親子関係定義ステップ502と、を実行させることによってRAM14上に構築される。このように、最初に、文字列、浮動小数、整数などの任意の識別情報によってノードにノード識別子を付与し、次に、「子→親」表現に基づいて親子関係を定義することによって、子ノードのノード識別子から親ノードのノード識別子を引く(ルックアップする)ことでツリーのトポロジーを表現することができる。   According to one embodiment of the present invention, a tree-type data structure based on such a “child → parent” relationship has a root node added to the computer system 10 shown in FIG. 1 as shown in FIG. A node definition step 501 for assigning a unique node identifier to the included node, a node identifier assigned to each of the non-root nodes other than the root node, and a parent node of each of the non-root nodes It is constructed on the RAM 14 by executing a parent-child relationship definition step 502 for associating the given node identifier. Thus, by first assigning a node identifier to a node by arbitrary identification information such as a character string, a float, an integer, etc., and then defining a parent-child relationship based on the expression “child → parent”, the child The topology of the tree can be expressed by subtracting (looking up) the node identifier of the parent node from the node identifier of the node.

[ノード識別子]
好ましくは、ノード定義ステップはノード識別子として数値を使用し、より好ましくは、連続する整数を使用し、更に好ましくは、0又は1からの整数連番を使用する。これにより、ノード識別子から、そのノードに対応する親ノードのノード識別子が格納されているアドレスを簡単に取得することができるので、子ノードのノード識別子から親ノードのノード識別子を引く処理を高速化することができる。
[Node identifier]
Preferably, the node definition step uses a numerical value as the node identifier, more preferably uses a continuous integer, and more preferably uses an integer sequence number from 0 or 1. This makes it easy to obtain the address where the node identifier of the parent node corresponding to the node is stored from the node identifier, thus speeding up the process of subtracting the node identifier of the parent node from the node identifier of the child node. can do.

ツリー型データ構造のノードにノード識別子として順序付きの番号を付与してノード間の親子関係を表現する場合、番号の付与順序に規則を定めることによって、その後のツリー型データ構造の取り扱いが容易になるという利点がある。この番号の付与順序の規則として、同じ世代のノードよりも子ノードを優先する深さ優先モードと、子ノードよりも同じ世代のノードを優先する幅優先モードが利用される。   When expressing a parent-child relationship between nodes by assigning an ordered number as a node identifier to a node of the tree type data structure, it is easy to handle the tree type data structure thereafter by defining rules in the order of number assignment There is an advantage of becoming. As a rule of the numbering order, a depth priority mode that prioritizes child nodes over the same generation node and a width priority mode that prioritizes nodes of the same generation over child nodes are used.

図6A〜Cは、ID形式のツリー構造型データを整数連番形式のツリー構造型データへ変換する処理の説明図である。図6Aには、各ノードにID番号が付与されたツリー構造型データが示されている。図6Bには、変換規則が示され、図6Cには、各ノードに整数連番が付与されたツリー構造型データが示されている。本例の変換規則は、深さ優先で連続番号を付与する規則であり、具体的には、複数の子ノードが存在する場合、長子(一番上の兄)ノードに最小番号を付与し、末子(一番下の弟)ノードに大きい番号を付与し、かつ、兄弟ノードよりも子ノードを優先して番号を付与する。本例では、昇順に番号付けをしているが、降順に番号付けをしてもよい。   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. FIG. 6A shows tree structure type data in which an ID number is assigned to each node. FIG. 6B shows conversion rules, and FIG. 6C shows tree structure type data in which integer sequential numbers are assigned to the respective nodes. The conversion rule of 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, A large number is assigned to the youngest child (bottom brother) node, and the child node is given priority over the sibling node. In this example, numbering is performed in ascending order, but numbering may be performed in descending order.

また、図7A〜Cは、ID形式のツリー構造型データを整数連番形式のツリー構造型データへ変換する処理の説明図である。図7Aには、各ノードにID番号が付与されたツリー構造型データが示されている。図7Bには、変換規則が示され、図7Cには、各ノードに整数連番が付与されたツリー構造型データが示されている。本例の変換規則は、幅優先で連続番号を付与する規則であり、具体的には、複数の子ノードが存在する場合、長子(一番上の兄)ノードに最小番号を付与し、末子(一番下の弟)ノードに大きい番号を付与し、かつ、子ノードよりも兄弟ノードを優先して番号を付与する。本例では、昇順に番号付けをしているが、降順に番号付けをしてもよい。   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. FIG. 7A shows tree structure type data in which an ID number is assigned to each node. FIG. 7B shows conversion rules, and FIG. 7C shows tree structure type data in which integer sequential numbers are assigned to each node. The conversion rule of this example is a rule that assigns a sequential number with width priority. Specifically, when there are a plurality of child nodes, a minimum number is assigned to the first child (top brother) node, and the last child ( A lower number is assigned to a node, and a sibling node is given priority over a child node. In this example, numbering is performed in ascending order, but numbering may be performed in descending order.

このようにノード識別子として番号を使用すると、ノード番号から直ちに、即ち、O(1)のオーダーで、そのノードに関する格納値が格納されているアドレスを引くことができる。また、親子関係を「子→親」表現することによって、子ノードから親ノードを直ちに、即ち、O(1)のオーダーで引くことができる。   When a number is used as a node identifier in this way, the address at which the stored value for the node is stored can be subtracted immediately from the node number, that is, in the order of O (1). Further, by expressing the parent-child relationship as “child → parent”, the parent node can be immediately drawn from the child node, that is, in the order of O (1).

[深さ優先モード]
図6Cに示されるような深さ優先に基づくツリー型データ構造は、図1に示されたコンピュータシステム10に、
同じ世代のノードよりも子ノードを優先して、ルート・ノードを含むノードに固有の連続する整数を付与するノード定義ステップと、
ルート・ノード以外のノードである非ルート・ノードの各々に付与された整数の順に、非ルート・ノードの各々の親ノードに付与された整数を並べることにより形成される配列を前記記憶装置に格納する親子関係定義ステップと、
を実行させることによって、記憶装置上に構築される。これにより、ノードは深さ優先で連続整数が付与され、ノード間の親子関係は「子→親」関係の配列によって表現される。
[Depth priority mode]
A tree-type data structure based on depth priority as shown in FIG. 6C is stored in the computer system 10 shown in FIG.
A node definition step for giving a unique continuous integer to a node including a root node in preference to a child node over a node of the same generation;
An array formed by arranging the integers assigned to the parent nodes of the non-root nodes in the order of the integers assigned to the non-root nodes that are nodes other than the root node is stored in the storage device. A parent-child relationship definition step,
Is built on the storage device. Thereby, a continuous integer is given to the nodes with depth priority, and the parent-child relationship between the nodes is expressed by an array of “child → parent” relationship.

図8は、深さ優先に基づくノード定義処理のフローチャートである。このノード定義処理は、コンピュータシステム10に
最初にルート・ノードに番号を付与するステップ801と、
既に番号が付与されたあるノードに唯一の子ノードが存在する場合には、当該子ノードに当該あるノードに付与された前記番号の次の番号を付与するステップ802と、
既に番号が付与されたあるノードに複数の子ノードが存在する場合には、当該複数の子ノードの間の兄弟関係に従って、弟ノードは直上の兄ノードの全ての子孫ノードに番号が付与された後に次の番号が付与されるように、一番上の兄ノードから一番下の弟ノードまで番号を付与するステップ803と、
を実行させる。これにより、深さ優先モードで同一の親ノードから派生した複数の子ノードの間に兄弟関係が定義される。
FIG. 8 is a flowchart of node definition processing based on depth priority. This node definition process includes the step 801 of first assigning a number to the root node to the computer system 10;
If there is only one child node in a node that has already been assigned a number, step 802 for assigning the child node a number next to the number assigned to that node;
When there are multiple child nodes in a node that has already been assigned a number, the brother node is assigned a number to all descendant nodes of the immediately above brother node according to the sibling relationship between the multiple child nodes. Step 803 for assigning numbers from the top brother node to the bottom brother node so that the next number is given later;
Is executed. Thereby, a sibling relationship is defined between a plurality of child nodes derived from the same parent node in the depth priority mode.

図9は、図6Cに示された深さ優先のツリー型データ構造から作成された「子→親」表現に基づく親子関係の配列の説明図である。同図にサブツリー1又はサブツリー2として示されているように、深さ優先で連続番号が付与されたノードの親子関係を「子→親」関係に基づいて配列表現すると、あるノードの子孫ノードが連続領域に出現するという優れた性質が得られる。   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. As shown as subtree 1 or subtree 2 in the figure, when the parent-child relationship of nodes assigned consecutive numbers with depth priority is arranged based on the “child → parent” relationship, An excellent property of appearing in a continuous region is obtained.

一例として、深さ優先モードの優れた性質を利用することにより、前記配列から、あるノードに付与された整数以上の値が格納されている連続領域を抽出することにより、前記あるノードの全ての子孫ノードを特定することができる。これにより、あるノードの子孫ノードを表すノード群が前記配列内の連続ブロックとして獲得できる。例えば、連続ブロックのサイズをmとすると、あるノードの全ての子孫ノードを特定するための処理速度は、O(m)のオーダーになる。   As an example, by using a superior property of the depth priority mode, by extracting a continuous area in which a value greater than or equal to an integer assigned to a node is stored from the array, all the nodes of the certain node are extracted. Descendant nodes can be specified. Thereby, 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 the continuous block is m, the processing speed for specifying all descendant nodes of a certain node is on the order of O (m).

既に説明したように、ノード間の親子関係は、「子→親」関係の配列の他に、「親→子」関係の配列によっても表現できる。図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であることがわかる。   As already described, the parent-child relationship between nodes can be expressed not only by the array of “child → parent” but also by the array of “parent → child”. FIG. 10 is an explanatory diagram of an array of parent-child relationships based on the “parent → child” expression created from the depth-first tree-type data structure shown in FIG. 6C. Since a plurality of child nodes can exist for one parent node, the parent-child relationship array stores an array Aggr for indicating an area in which the child node number for each node is stored, and the child node number. It is composed of two arrays P → C. For example, the value of the second element Aggr [1] from the top of the array Aggr is “3”. This is because the child node number for the node [1] is the element P → C [3] of the array P → C. It indicates that it is stored after that. As a result, the node [0], that is, the child node for the root node has three elements from the top of the array P → C, P → C [0] 1, P → C [1] 6, and P → It can be seen that C [2] is 8.

この「親→子」表現に基づく親子関係の配列の求め方を説明する。
(1)ノードの番号が配列P→Cの最大の添字(=11)と一致する場合、このノードに属する子ノードは存在しない。したがって、処理は継続されない。
(2)同図に太字で表された親ノードの番号からAggr値を求める。このAggr値は、配列P→Cの開始点を表す。
(3)太字で表された親ノード番号+1に対応するAggr値を求める。このAggr値−1が配列P→Cの終了点である。
A method for obtaining an array of parent-child relationships based on the expression “parent → child” will be described.
(1) When the node number matches the maximum index (= 11) of the array P → C, there is no child node belonging to this node. Therefore, the process is not continued.
(2) An Aggr value is obtained from the parent node number shown in bold in the figure. This Aggr value represents the starting point of the array P → C.
(3) An Aggr value corresponding to the parent node number +1 represented in bold is obtained. This Aggr value −1 is the end point of the array P → C.

例えば、ノード0の子ノードの開始点は、Aggr[0]、即ち、0であり、終了点は、Aggr[1]−1、即ち、3−1=2である。したがって、ノード0の子ノードは、配列P→Cの0〜2番目の要素、即ち、1、6及び8である。   For example, the start point of the child node of node 0 is Aggr [0], that is, 0, and the end point is Aggr [1] -1, that is, 3-1 = 2. Therefore, the child nodes of the node 0 are the 0th to 2nd elements of the array P → C, that is, 1, 6 and 8.

或いは、「親→子」表現に基づく親子関係は、より単純に、親ノード番号の配列と、対応する子ノード番号の配列と、の二つの配列により表現することも可能である。しかし、この配列を利用して親子関係を見つけるためには、親ノードの番号を検索しなければならないので、即ち、log(n)のアクセス時間を要するので効率が悪い。   Alternatively, the 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. However, in order to find the 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 the efficiency is poor.

[幅優先モード]
さらに、図7Cに示されるような幅優先に基づくツリー型データ構造は、図1に示されたコンピュータシステム10に、
子ノードよりも同じ世代のノードを優先して、ルート・ノードを含むノードに固有の連続する整数を付与するノード定義ステップと、
前記ルート・ノード以外のノードである非ルート・ノードの各々に付与された整数の順に、前記非ルート・ノードの各々の親ノードに付与された整数を並べることにより形成される配列を前記記憶装置に格納する親子関係定義ステップと、
を実行させることによって、記憶装置上に構築される。これにより、ノードは幅優先モードで連続整数が付与され、ノード間の親子関係は「子→親」関係の配列によって表現される。
[Width priority mode]
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 of giving priority to a node of the same generation over a child node, and giving a unique continuous integer to a node including a root node;
An array formed by arranging the integers assigned to the parent nodes of the non-root nodes in the order of the integers assigned to the non-root nodes that are nodes other than the root node; A parent-child relationship definition step stored in
Is built on the storage device. As a result, the nodes are given a continuous integer in the width priority mode, and the parent-child relationship between the nodes is represented by an array of “child → parent” relationship.

図11は、幅優先に基づくノード定義処理のフローチャートである。このノード定義処理は、コンピュータシステム10に、
各ノードが前記ルート・ノードから何世代目のノードであるか、及び、各世代に含まれるノード数を算出するステップ1101と、
最初に前記ルート・ノードに番号を付与するステップ1102と、
ある世代に含まれる全てのノードに番号が付与されたならば、当該ある世代の次の世代にノードが存在しなくなるまで、当該次の世代に含まれる全てのノードに対して、親ノードが異なる場合には、当該親ノードに番号が付与された順番に当該ノードに番号を付与し、当該親ノードが同一である場合には、当該親ノードから派生した複数の子ノードの間に兄弟関係を定義し、一番上の兄ノードから一番下の弟ノードまで直前に付与された番号の次の番号から連続的に変化する固有の整数を順に付与するステップ1013と、
を実行させる。これにより、幅優先モードで同一の親ノードから派生した複数の子ノードの間に兄弟関係が定義される。
FIG. 11 is a flowchart of node definition processing based on width priority. This node definition process is performed by the computer system 10.
Step 1101 for calculating the number of generations of each node from the root node and the number of nodes included in each generation;
First assigning a number to the root node 1102;
If numbers are assigned to all nodes included in a generation, the parent node is different for all nodes included in the next generation until there is no node in the next generation of the generation. In this case, numbers are assigned to the nodes in the order in which the numbers are assigned to the parent nodes. When the parent nodes are the same, a sibling relationship is established between a plurality of child nodes derived from the parent node. Step 1013 for defining and sequentially assigning unique integers that sequentially change from the number next to the number assigned immediately before from the top brother node to the bottom brother node;
Is executed. Thereby, a sibling relationship is defined between a plurality of child nodes derived from the same parent node in the width priority mode.

図12は、図7Cに示された幅優先のツリー型データ構造から作成された「子→親」表現に基づく親子関係の配列の説明図である。同図に示されているように、幅優先で連続番号が付与されたノードの親子関係を「子→親」関係に基づいて配列表現すると、あるノードの子ノードは連続領域に出現するという優れた性質が得られる。これは、幅優先モードで連続番号が付与されたノードの親子関係を「子→親」関係に基づいて配列表現すると、親ノードに付与された番号が前記配列中に順序付き(昇順又は降順)で出現することによる。   FIG. 12 is an explanatory diagram of an array of parent-child relationships based on the “child → parent” expression created from the breadth-first tree-type data structure shown in FIG. 7C. As shown in the figure, when the parent-child relationship of nodes assigned consecutive numbers with breadth priority is arranged based on the “child → parent” relationship, the child nodes of a certain node appear in a continuous region. 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. By appearing.

したがって、幅優先モードの優れた性質を利用することにより、前記配列から、あるノードに付与された整数と同じ値が格納されている連続領域を抽出することにより、前記あるノードの全ての子ノードを特定する。これにより、あるノードの子ノードを、例えば、二分探索などの手法を用いて検索することが可能であり、即ち、O(log(n))のオーダーで検索することが可能になる。   Therefore, by using the superior property of the breadth-first mode, by extracting a continuous region in which the same value as the integer assigned to a certain node is stored from the array, all the child nodes of the certain node are extracted. Identify. As a result, it is possible to search a child node of a certain node using a technique such as binary search, for example, in the order of O (log (n)).

既に説明したように、ノード間の親子関係は、「子→親」関係の配列の他に、「親→子」関係の配列によっても表現できる。図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であることがわかる。   As already described, the parent-child relationship between nodes can be expressed not only by the array of “child → parent” but also by the array of “parent → child”. FIG. 13 is an explanatory diagram of an array of parent-child relationships based on the “parent → child” expression created from the breadth-first tree-type data structure shown in FIG. 7C. Since there can be a plurality of child nodes for one parent node, the parent-child relationship array includes an array Aggr for indicating an area in which child node numbers for each node are stored, and child node numbers. Is composed of two arrays P → C. For example, the value of the second element Aggr [1] from the top of the array Aggr is “3”. This is because the child node number for the node [1] is the element P → C [3] of the array P → C. It indicates that it is stored after that. Thus, the node [0], that is, the child node for the root node, has three elements from the top of the array P → C, 1 of P → C [0], 2 of P → C [1], and It can be seen that P → C [2] is 3.

この「親→子」表現に基づく親子関係の配列の求め方を説明する。
(1)ノードの番号が配列P→Cの最大の添字(=11)と一致する場合、このノードに属する子ノードは存在しない。したがって、処理は継続されない。
(2)同図に太字で表された親ノードの番号からAggr値を求める。このAggr値は、配列P→Cの開始点を表す。
(3)太字で表された親ノード番号+1に対応するAggr値を求める。このAggr値−1が配列P→Cの終了点である。
A method for obtaining an array of parent-child relationships based on the expression “parent → child” will be described.
(1) When the node number matches the maximum index (= 11) of the array P → C, there is no child node belonging to this node. Therefore, the process is not continued.
(2) An Aggr value is obtained from the parent node number shown in bold in the figure. This Aggr value represents the starting point of the array P → C.
(3) An Aggr value corresponding to the parent node number +1 represented in bold is obtained. This Aggr value −1 is the end point of the array P → C.

例えば、ノード0の子ノードの開始点は、Aggr[0]、即ち、0であり、終了点は、Aggr[1]−1、即ち、3−1=2である。したがって、ノード0の子ノードは、配列P→Cの0〜2番目の要素、即ち、1、2及び3である。   For example, the start point of the child node of node 0 is Aggr [0], that is, 0, and the end point is Aggr [1] -1, that is, 3-1 = 2. Therefore, the child nodes of the node 0 are the 0th to 2nd elements of the array P → C, that is, 1, 2, and 3.

[ツリー型データ構造の表現形式の相互変換]
上述のように、ノードに連続番号を付与するための深さ優先モード及び幅優先モードは、それぞれ、固有の優れた性質を備えている。また、一つのツリー型データ構造は、深さ優先に基づく「子→親」表現形式と、幅優先に基づく「子→親」表現形式と、「親→子」表現形式の何れの表現形式でも表現可能である。したがって、深さ優先に基づく「子→親」表現形式と、幅優先に基づく「子→親」表現形式と、「親→子」表現形式は、適宜に相互変換可能であることに注意する必要がある。
[Converting tree data structure representation]
As described above, each of the depth priority mode and the width priority mode for assigning serial numbers to nodes has unique and excellent properties. In addition, 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 is necessary to note that the “child → parent” representation format based on depth priority, the “child → parent” representation format based on width priority, and the “parent → child” representation format can be appropriately converted to each other. is there.

[頂点ノードおよび部分ツリー群]
ツリー型データ構造のデータを検索、集計、ソートする際に、ツリーデータの全体の中で特定の部分を処理の対象、例えば、検索の対象範囲とする場合がある。本発明者は、複数のノードを含む特定の部分を代表する一つのノードを導入することにより、種々の処理を効率化する手法を提案した。次に、この手法について詳述する。
[Vertex nodes and subtrees]
When data having a tree-type data structure is searched, aggregated, and sorted, a specific portion of the entire tree data may be set as a processing target, for example, a search target range. The present inventor has proposed a method for improving the efficiency of various processes by introducing one node representing a specific part including a plurality of nodes. Next, this method will be described in detail.

ツリー型データ構造をもつツリーデータにおいて、ルート・ノードに最も近いノードの値で、当該ノードおよびそのノードから枝分かれしてリーフ・ノード(端点)に至るまでの全てのノードを表現することを考える。ここで、あるノードおよびそのノードから枝分かれしてリーフ・ノードに至るまでのノード群を、部分ツリーと称する。また、上記ノード(ルート・ノード)に最も近いノードを頂点ノードと称する。   In tree data having a tree-type data structure, it is assumed that the value of the node closest to the root node is used to represent the node and all the nodes that branch from the node and reach the leaf node (end point). Here, a node and a node group from the node to the leaf node are referred to as a partial tree. A node closest to the node (root node) is referred to as a vertex node.

図14Aは、前述した幅優先モードに基づくツリー型データ構造、図14Bは、当該ツリー型データ構造を、「子→親」表現に基づく親子関係の配列を示す図である。たとえば、頂点ノード[4]は、ノード識別子{4,8,9}を含み、頂点ノード[6]は、ノード識別子{6}を含み、また、頂点ノード[3]は、ノード識別子{3,7,10,11}を含む。このような、複数の頂点ノードからなる配列を、頂点ノードリストと称する。頂点ノードリストにより複数の部分ツリーを指定でき、指定された複数の部分ツリーを部分ツリー群と称する。   FIG. 14A is a diagram illustrating a tree-type data structure based on the above-described breadth-first mode, and FIG. 14B is a diagram illustrating an array of a parent-child relationship based on the tree-type data structure based on a “child → parent” expression. For example, the vertex node [4] includes a node identifier {4, 8, 9}, the vertex node [6] includes a node identifier {6}, and the vertex node [3] includes a node identifier {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 designated by the vertex node list, and the plurality of designated partial trees are referred to as a partial tree group.

以下、頂点ノードリストを、[a,b,・・・]と表す。ここに、「a」、「b」、・・・は、頂点ノードに対応するノード識別子である。頂点ノードリストを構成する頂点ノードの各々を展開して、当該頂点ノードを頂点とする部分ツリーに含まれるすべてのノードのノード識別子を求めることを考える。求められたノード識別子のリストにおいて、あるノード識別子は1つしか存在しない場合、すなわち、ノード識別子が重複して出現しない場合、このような部分ツリー群を、「正規部分ツリー群」と称する。そうでないような部分ツリー群を、「非正規部分ツリー群」と称する。   Hereinafter, the vertex node list is represented as [a, b,...]. Here, “a”, “b”,... Are node identifiers corresponding to the vertex nodes. Suppose that each of the vertex nodes 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. If there is only one node identifier in the obtained list of node identifiers, that is, if node identifiers do not appear in duplicate, such a partial tree group is referred to as a “regular partial tree group”. Such a partial tree group is referred to as a “non-normal partial tree group”.

尚、部分ツリー群は正規部分ツリー群へ変換することが可能であり、この処理を「正規化」と称する。正規化は、集合演算を効率的に実施する上で重要になる。正規化された部分ツリー群では、どのノードも高々1つの頂点ノードに属するのみであるため、各ノードが所属する頂点ノードのリストは、高々頂点ノードの数に等しいサイズの配列で記述することができる。このため、正規化された状態では、論理積や論理和に代表される集合演算を効率的に実施することができる。   The 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. In the normalized partial tree group, since every node belongs to at most one vertex node, the list of vertex nodes to which each node belongs can be described by an array having a size equal to the number of vertex nodes at most. it can. For this reason, in the normalized state, a set operation represented by logical product or logical sum can be efficiently performed.

正規部分ツリー群であっても、非正規部分ツリー群であっても、頂点ノードリストによって、頂点ノードおよびその子孫ノードからなる部分ツリー群を特定することができる。たとえば、図15Aに示すように、頂点ノードリスト[4,6,3]により、図15Bに示すような部分ツリー群(部分ツリー{4,8,9}、{6}、{3,7,10,11})が特定される。   Whether it is a normal partial tree group or a non-normal partial tree group, a partial tree group including a vertex node and its descendant nodes can be specified by the vertex node list. For example, as shown in FIG. 15A, by using the vertex node list [4, 6, 3], 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.

たとえば、図15A、Bの例で、「ハート形」のノードを含む部分ツリーを検索すると、図16Bに示すような部分ツリー群が得られる。図16Aは、この部分ツリー群を表わす頂点ノードリストである。   For example, in the example of FIGS. 15A and 15B, when a partial tree including a “heart-shaped” node is searched, a partial tree group as shown in FIG. 16B is obtained. FIG. 16A is a vertex node list representing this partial tree group.

また、各部分ツリーに属するノード数を集計すると、図17Bに示すようになる。図17Aにおいて、配列1701は頂点ノードリスト、配列1702は、各頂点ノードにより特定される部分ツリーに属するノード数を示す配列である。   Further, the total number of nodes belonging to each partial tree is as shown in FIG. 17B. In FIG. 17A, an array 1701 is a vertex node list, and an array 1702 is an array indicating the number of nodes belonging to the partial tree specified by each vertex node.

たとえば、ソートとして、各部分ツリーに属するノード数によるソートを考えることができる。図18A中、配列1801は、ソートされた頂点ノードリスト、配列1802は、頂点ノードリストにより特定される部分ツリーに属するノード数を示す配列である。また、図18Bは、部分ツリーがノード数にしたがってソートされた状態を示す。   For example, sorting by the number of nodes belonging to each partial tree can be considered as sorting. In FIG. 18A, an array 1801 is a sorted vertex node list, and an array 1802 is an array indicating the number of nodes belonging to the partial tree specified by the vertex node list. FIG. 18B shows a state where the partial tree is sorted according to the number of nodes.

さらに、複数の部分ツリー群の間の集合演算として、論理積について説明する。図14A、Bに示すツリーにおいて、図19Bに示す部分ツリー群(対応する頂点ノードリストを図19Aに示す)と、図19Dに示す部分ツリー群(対応する頂点ノードリストを図19Cに示す)との論理積を考える。   Further, a logical product will be described as a set operation between a plurality of partial tree groups. In the trees shown in FIGS. 14A and B, the partial tree group shown in FIG. 19B (corresponding vertex node list is shown in FIG. 19A) and the partial tree group shown in FIG. 19D (corresponding vertex node list is shown in FIG. 19C) Consider the logical product of.

図19Bにおける、ノード識別子「4」の頂点ノードにて特定される部分ツリー1901と、図19Dにおける、ノード識別子「1」の頂点ノード識別子にて特定される部分ツリー1911とを比較すると、部分ツリー1901は、部分ツリー1902に包含される。図19Bにおける部分ツリー1902と包含関係をもつような部分ツリーは、図19Dに示す部分ツリー群には存在しない。また、図19Bにおけるノード識別子「3」の頂点ノードにて特定される部分ツリー1903と、図19Dにおける、ノード識別子「7」にて特定される部分ツリー1913とを比較すると、部分ツリー1913は、部分ツリー1903に包含される。その結果、論理積演算の結果を示す頂点ノードリストは、図20Aに示すように、[4,7]となる。図20Bは、論理積演算の結果に対応する部分ツリー群である。   When comparing the partial tree 1901 specified by the vertex node of the node identifier “4” in FIG. 19B with the partial tree 1911 specified by the vertex node identifier of the node identifier “1” in FIG. 19D, the partial tree 1901 is included in the partial tree 1902. A partial tree having an inclusion relationship with the partial tree 1902 in FIG. 19B does not exist in the partial tree group shown in FIG. 19D. Further, when the partial tree 1903 specified by the vertex node of the node identifier “3” in FIG. 19B is compared with the partial tree 1913 specified by the node identifier “7” in FIG. It is included in the partial tree 1903. As a result, the vertex node list indicating the result of the AND 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.

図16A、B〜図20A、Bにより理解できるように、頂点ノードリスト(集計においては、これに加えて、頂点ノードリストと同一サイズの、集計結果(ノード数)を格納する配列)によって、それぞれの処理や演算の結果を表わすことができる。   As can be understood from FIGS. 16A and B to FIGS. 20A and 20B, according to the vertex node list (in addition to this, an array having the same size as the vertex node list and storing the aggregation result (number of nodes)), respectively. It is possible to represent the results of the processes and operations.

[集合演算]
本実施の形態にかかる正規部分ツリー群の間では、論理積(AND)や論理輪(OR)、否定(NOT)、減算(SUB)、排他的論理和(XOR)を定義することができる。このような演算の結果も正規部分ツリー群にて表わす。以下、これら演算について説明する。以下、図21A、Bに示す例において、それぞれの演算について説明する。
(1)論理和(OR)
たとえば、正規部分ツリー群[2]、[3]の論理和を考える。
[Set operations]
Between the normal partial tree groups according to the present embodiment, logical product (AND), logical ring (OR), negation (NOT), subtraction (SUB), and exclusive OR (XOR) can be defined. The result of such an operation is also represented by a normal partial tree group. Hereinafter, these calculations will be described. Hereinafter, each calculation will be described in the example shown in FIGS.
(1) OR (OR)
For example, consider the logical sum of normal subtree groups [2] and [3].

正規部分ツリー群[2]:{2,6}
正規部分ツリー群[3]:{3,7,10,11}
これらの論理和[2]OR[3]=[2,3]
([2,3]:{2,6},{3,7,10,11})
となる。
Regular subtree group [2]: {2, 6}
Regular subtree group [3]: {3, 7, 10, 11}
OR of these [2] OR [3] = [2, 3]
([2,3]: {2,6}, {3, 7, 10, 11})
It becomes.

同様に、正規部分ツリー群[3]、「7」の論理和を考える。   Similarly, consider the logical sum of the regular subtree groups [3] and “7”.

正規部分ツリー群[3]:{3,7,10,11}
正規部分ツリー群[7]:{7,10,11}
したがって、これらの論理和[3]OR[7]=[3]となる。
(2)論理積(AND)
正規部分ツリー群[2,3]、[7]の論理積を考える。
Regular subtree group [3]: {3, 7, 10, 11}
Regular subtree group [7]: {7, 10, 11}
Therefore, these logical sums [3] OR [7] = [3].
(2) Logical product (AND)
Consider a logical product of normal subtree groups [2, 3] and [7].

正規部分ツリー群[2,3]:{2,6,3,7,10,11}
正規部分ツリー群[7]:[7,10,11]
したがって、これらの論理積[2,3]AND[7]=[7]となる。
Regular subtree group [2, 3]: {2, 6, 3, 7, 10, 11}
Regular subtree group [7]: [7, 10, 11]
Therefore, the logical product [2, 3] AND [7] = [7] is obtained.

演算のうち、これらの演算において実行される処理について以下に説明する。   Of the calculations, processes executed in these calculations will be described below.

[論理積演算]
まず、論理積演算の原理について説明する。図22Aに示すように、2つの正規部分ツリー群2201および2202を考える。2つの正規部分ツリー群は、以下に述べるような関係を有する。
[AND operation]
First, the principle of the logical product operation will be described. Consider two normal subtree groups 2201 and 2202 as shown in FIG. 22A. The two normal subtree groups have a relationship as described below.

たとえば、正規部分ツリー群2201が正規部分ツリー群2202を含む場合(図22B参照)には、2つの正規部分ツリー群の論理積は、正規部分ツリー群2202となる。その一方、正規部分ツリー群2202が正規部分ツリー群2201を含む場合(図22C参照)には、2つの正規部分ツリー群の論理積は、正規部分ツリー群2201となる。さらに、図示しないが、双方の正規部分ツリー群が包含関係を持たない場合には、これらの間の論理積は空集合となる。   For example, when the normal partial tree group 2201 includes the normal partial tree group 2202 (see FIG. 22B), the logical product of the two normal partial tree groups becomes the normal partial tree group 2202. On the other hand, when the normal partial tree group 2202 includes the normal partial tree group 2201 (see FIG. 22C), the logical product of the two normal partial tree groups becomes the normal partial tree group 2201. Furthermore, although not shown, when both normal partial tree groups do not have an inclusion relationship, the logical product between them becomes an empty set.

図23は、論理積演算の際にシステムにて実行される処理を示すフローチャートである。図23に示すように、論理積演算の対象となる正規部分ツリー群のそれぞれについて、マーキング配列を生成する(ステップ2301)。マーキング配列は、正規化演算にて生成されたフラグ配列および所属ノード配列と等価である。すなわち、正規化演算の第1の手法および第2の手法と同様の処理を実施することでマーキング配列を取得することができる。   FIG. 23 is a flowchart showing processing executed by the system during the logical product operation. As shown in FIG. 23, a marking array is generated for each of the normal partial tree groups 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 the normalization operation. That is, the marking array can be acquired by performing the same processing as the first method and the second method of normalization calculation.

次いで、システム10は、双方のマーキング配列の対応する値を比較する(ステップ2302)。より詳細には、システム10は、2つのマーキング配列中の対応する値を特定するためのポインタを初期化し(ステップ2311)、ポインタが示すマーキング配列の双方の値を取り出す(ステップ2312)。双方の値或いは一方の値が、初期値「−1」であった場合には(ステップ2313でノー(No))、システム10は、ポインタが配列の末尾を指していなければ(ステップ2315でノー(No))、ポインタを移動して(ステップ2316)、ステップ2312に戻る。   The system 10 then compares the corresponding values of both marking sequences (step 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 array indicated by the pointers (step 2312). If both values or one value is the initial value “−1” (No in step 2313), the system 10 does not point to the end of the array (No in step 2315). (No)), the pointer is moved (step 2316), and the process returns to step 2312.

マーキング配列の双方の値が初期値「−1」以外の値であった場合には(ステップ2312でイエス(Yes))、マーキング配列の値のうち大きいほうの値が、格納番地、つまり、対応するノード識別子と等しいか否かが判断される(ステップ2313)。ステップ2313でイエス(Yes)と判断された場合には、システム10は、当該一致する値を、論理積演算の結果を示す頂点ノード配列の値として、当該頂点ノード配列に格納する(ステップ2314)。その後、ポインタが配列の末尾を指していなければ(ステップ2315でノー(No))、ポインタを移動して(ステップ2316)、ステップ2312に戻る。   If both values of the marking array are values other than the initial value “−1” (Yes in step 2312), the larger value of the marking array values is the storage address, that is, the corresponding value. It is determined whether it is equal to the node identifier to be executed (step 2313). If it is determined as Yes in step 2313, 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 product 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.

ステップ2312でノー(No)と判断された場合には、ポインタが配列の末尾を指していなければ(ステップ2315でノー(No))、ポインタを移動して(ステップ2316)、ステップ2312に戻る。   If NO in step 2312, 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.

以下、正規部分ツリー群[3,6]と、正規部分ツリー群[2,7]のAND演算の例について説明する。図24は、正規部分ツリー群[3,6]および正規部分ツリー群[2,7]のそれぞれのマーキング配列が生成された状態を示す。図24において、符号2401が、正規部分ツリー群[3,6]のマーキング配列(第1のマーキング配列)を示し、符号2402が、正規部分ツリー群[2,7]のマーキング配列(第2のマーキング配列)を示す。   Hereinafter, an example of an AND operation of the normal partial tree group [3, 6] and the normal partial tree group [2, 7] will be described. FIG. 24 shows a state where the marking arrays of the normal partial tree group [3, 6] and the normal partial tree group [2, 7] are generated. In FIG. 24, reference numeral 2401 indicates a marking array (first marking array) of the normal partial tree group [3, 6], and reference numeral 2402 indicates a marking array (second second) of the normal partial tree group [2, 7]. Marking arrangement).

図25に示すように、ポインタがノード識別子「6」を示すときに(符号2501参照)、第1のマーキング配列の値は「6」であり、かつ、第2のマーキング配列の値が「2」である。大きい方の値は「6」であり、ノード識別子に一致する。したがって、値「6」は、論理積演算の結果を格納するための頂点ノードリストに格納される。   As shown in FIG. 25, when the pointer indicates the node identifier “6” (see reference numeral 2501), the value of the first marking array is “6” and the value of the second marking array is “2”. Is. The larger value is “6”, which matches the node identifier. Therefore, the value “6” is stored in the vertex node list for storing the result of the logical product operation.

また、ポインタがノード識別子「7」を示すときに(符号2502参照)、第1のマーキング配列の値は「3」であり、かつ、第2のマーキング配列の値が「7」である。大きいほうの値は「7」であり、ノード識別子に一致する。したがって、値「7」は、論理積演算の結果を格納するための頂点ノードリストに格納される。このような処理の結果、[3,6]AND[2,7]=[6,7]を得ることができる。   When the pointer indicates the node identifier “7” (see reference numeral 2502), the value of the first marking array is “3” and the value of the second marking array is “7”. The larger value is “7”, which matches the node identifier. Therefore, the value “7” is stored in the vertex node list for storing the result of the logical product operation. As a result of such processing, [3, 6] AND [2, 7] = [6, 7] can be obtained.

[論理和演算]
論理和演算は、以下のように記述することができる。
[OR operation]
The logical OR operation can be described as follows.

[a1,a2,・・・,an]OR[b1,b2,・・・,bn]
=NORM[a1,a2,・・・,an,b1,b2,・・・,bn]
つまり、上述した正規化の手法を用いれば、論理和演算の結果を示す頂点ノードリストを得ることができる。
[A1, a2, ..., an] OR [b1, b2, ..., bn]
= NORM [a1, a2, ..., an, b1, b2, ..., bn]
That is, if the normalization method described above is used, a vertex node list indicating the result of the logical sum operation can be obtained.

たとえば、図24に示す例において、[3,6]OR[2,7]=NORM[3,6,2,7]=[2,3]となる。   For example, in the example shown in FIG. 24, [3, 6] OR [2, 7] = NORM [3, 6, 2, 7] = [2, 3].

[減算]
上述した論理和演算および論理積演算を利用して、正規部分ツリー群の減算は、以下のように定義することができる。なお、以下において、減算は「−(マイナス)」で表わす。
[Subtraction]
The subtraction of the normal partial tree group can be defined as follows using the above-described logical sum operation and logical product operation. In the following, subtraction is represented by “− (minus)”.

A,B,C,Dをそれぞれ正規部分ツリー群とする。   Let A, B, C, and D be normal partial tree groups.

(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)
つまり、ブール代数と同じ演算規則が成立する。
(AB) AND (CD) = (A AND C)-(BORD) (Formula 1)
(AB) OR (CD) = (A OR C) AND (B AND D) (Formula 2)
A-B-C = A- (BORC) (Formula 3)
In other words, the same calculation rules as for Boolean algebra hold.

正規化演算などで説明したように、正規部分ツリー群は、頂点ノードリストで表わすことができる。   As described in the normalization operation or the like, the normal partial tree group can be represented by a vertex node list.

本例においては、たとえば、(式1)は、2つの頂点ノードリスト(A、Cの論理積演算結果を示す頂点ノードリスト、および、B、Dの論理和演算結果を示す頂点ノードリスト)と、その間の「減算」という演算子とで表わすことができる。つまり、本来であれば、正規部分ツリー群A〜Cのそれぞれの4つの頂点ノードリストおよびそれらの間の演算子にて表わすべきところ、2つの頂点リストおよびその間の演算子で表わすことができる。つまり、被減数の頂点ノードリストと、減数の頂点ノードリスト(除外頂点ノードリスト)とで表わすことが可能となる。   In this example, for example, (Equation 1) includes two vertex node lists (a vertex node list indicating a logical product operation result of A and C, and a vertex node list indicating a logical sum operation result of B and D) and , And an operator called “subtraction” between them. That is, originally, it should be represented by each of the four vertex node lists of the normal partial tree groups A to C and an operator between them, but can be represented by two vertex lists and an operator between them. That is, it can be expressed by a reduced vertex node list and a reduced vertex node list (excluded vertex node list).

(式2)や(式3)についても同様である。   The same applies to (Expression 2) and (Expression 3).

[否定、排他的論理和等]
また、正規部分ツリー群の否定(NOT)も、除外頂点ノードリストとして表わすことができる。つまり、「NOT A」(Aは正規部分ツリー群)は、除外頂点ノードリストにリストされた頂点ノードおよびその子孫のノードを除いた全てのノードが、正規部分ツリー群Aの否定となる。
[Negation, exclusive OR, etc.]
Also, negation (NOT) of the normal partial tree group can be expressed as an excluded vertex node list. That is, in “NOT A” (A is a normal partial tree group), all the nodes except for the vertex node and its descendant nodes listed in the excluded vertex node list are negative of the normal partial tree group A.

同様に、排他的論理和も、頂点ノードリストおよび除外頂点ノードリストで表わすことが可能である。   Similarly, exclusive OR can also be represented by a vertex node list and an excluded vertex node list.

[ツリーデータ検索の概要]
ツリーデータ検索は、パスの検索とノード格納値の検索の二つの側面がある。パスの検索とは、図2A、Bにおいて、例えば、"/shop/shopName"というパス条件を満たすノードを抽出することである。また、ノード格納値の検索とは、図2A、Bにおいて、"shopName=フランス店"であるノードを抽出することである。
[Overview of tree data search]
Tree data search has two aspects: path search and node stored value search. The path search is to extract nodes satisfying the path condition of “/ shop / shopName” in FIGS. 2A and 2B, for example. Further, the retrieval of the node stored value is to extract a node having “shopName = France store” in FIGS. 2A and 2B.

そして、一般的なツリーデータ検索は、パスの検索とノード格納値の検索の組み合わせであり、上記の例では、"/shop/shopName=フランス店"を満たすノードを抽出することに相当する。すなわち、一般的なツリーデータ検索は、パスの条件とノード格納値の条件を同時に満たすAND条件による検索である。ある頂点ノードが、このAND条件を満たすかどうかは、パスの条件を調べ、パスの条件を満たすノードのノード格納値の条件を調べることにより判定することが可能である。また、このAND条件指定による検索は、パス条件による検索の結果集合とノード格納値条件による検索の結果集合のAND(論理積)演算を実行することにより実現できる。   A general tree data search is a combination of a path search and a node stored value search. In the above example, it corresponds to extracting a node satisfying “/ shop / shopName = France store”. That is, a general tree data search is a search based on an AND condition that satisfies the path condition and the node stored value condition at the same time. Whether a certain vertex node satisfies the AND condition can be determined 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 performing 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.

さらに、ツリーデータ検索は、上記のパス条件とノード格納値条件のAND条件指定による検索に限られない。例えば、パス条件とノード格納値条件の何れかを満たすノードを抽出するOR条件指定による検索がある。このOR条件指定による検索は、パス条件による検索の結果集合とノード格納値条件による検索の結果集合のOR(論理和)演算を実行することにより実現できる。   Further, 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. For example, there is a search by specifying an OR condition for extracting a node that satisfies either the path condition or the node stored value condition. The search by specifying the OR condition can be realized by performing 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.

[ノードの実体的な値の取り扱い方]
ツリーデータ検索では、検索条件として、パスを表すためのノードの項目名情報(例えば、ノードタイプ)と、ノード格納値を表すためのノードの項目値情報(例えば、ノード値)のような実体情報が利用される。これらの実体情報は、例えば、図26に示されるように、ノードタイプ及びノード値を記述する情報が格納されたノード情報格納領域へのポインタを、ノード識別子に随伴させることによって特定することができる。
[How to handle substantive values of nodes]
In tree data search, entity information such as node item name information (for example, node type) for representing a path and node item value information (for example, node value) for representing a node stored value is used as a search condition. Is used. For example, as shown in FIG. 26, these entity information can be specified by following a node identifier with a pointer to a node information storage area in which information describing the node type and the node value is stored. .

尚、すべてのノードのノードタイプが同じである場合には、ノード情報格納領域にはノード値だけを格納するように構成することが可能である。   If all nodes have the same node type, it is possible to store only the node value in the node information storage area.

[子孫のパス条件による検索]
次に、本発明の実施の形態にかかる子孫のパス条件による検索方法を説明する。子孫のパス条件による検索とは、指定されたノードタイプを有するノードを子孫ノードとして含む頂点ノードを抽出する処理である。図27A、Bは、本発明の一実施例にかかる子孫のパス条件による検索の対象となるツリー型データ構造と、ノードの親子関係の「子→親」表現の説明図である。本例では、各ノードの項目名情報であるノードタイプは、シンボル番号によって表され、図27Aでは、各ノードのノード識別子(例えば、ノード番号)が、そのノードのシンボル番号に対応した図形と共に表されている。例えば、ルート・ノードは、丸型シンボルである。また、頂点ノードは黒塗りの星印(★)で示されている。図27Bは、シンボル番号と表示図形とシンボル名の対応関係を表す図である。
[Search by descendant path condition]
Next, a search method based on a descendant path condition according to the embodiment of the present invention will be described. The search based on the descendant path condition is a process of extracting a vertex node including a node having a specified node type as a descendant node. FIGS. 27A and 27B are explanatory diagrams of a tree-type data structure to be searched according to a descendant path condition and a “child → parent” expression of a parent-child relationship of nodes according to an embodiment of the present invention. In this example, the node type, which is item name information of each node, is represented by a symbol number. In FIG. 27A, the node identifier (for example, 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 node is indicated by a black star (★). FIG. 27B is a diagram illustrating the correspondence between symbol numbers, display figures, and symbol names.

本例では、頂点ノードの子孫ノードの条件を検索条件としてノード抽出を行う。より具体的には、子孫ノードにボタン型のノードを含む頂点ノードを抽出する。   In this example, node extraction is performed using a condition of a descendant node of a vertex node as a search condition. More specifically, a vertex node including a button type node as a descendant node is extracted.

子孫のパス条件による検索においては、子ノードから親ノードの順番にチェックする方法1と、親ノードから子ノードの順番にチェックする方法2の2通りの方法がある。方法1は、「子→親」表現の先頭から順にチェックする方法であって、頂点ノードの個数が多い場合に効果的である。一方、方法2は、頂点ノードから始めて親から子へ順にチェックするので、頂点ノード数が少ない場合に効果的である。アプリケーションに応じて、方法1と方法2を選択的に実行してもよい。   In the search based on the path condition of the descendant, there are two methods, a method 1 for checking in the order from the child node to the parent node and a method 2 for checking in the order from the parent node to the child node. Method 1 is a method of checking in order from the head of the expression “child → parent”, and is effective when the number of vertex nodes is large. On the other hand, method 2 is effective when the number of vertex nodes is small because the check is performed in order from the parent to the child starting from the vertex node. Depending on the application, method 1 and method 2 may be selectively performed.

[子孫のパス条件検索の方法1:子→親でチェックする方法]
本発明の実施の形態にかかるパス条件検索方法1を実行するコンピュータシステム10のRAM14には、図27Aに示されるように、ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータが展開されている。より具体的には、ルート・ノードを含む全ノードに固有のノード識別子であるノード番号が付与され、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の親子関係、すなわち、深さ優先の「子→親」による親子関係が表現されている。しかし、パス条件検索の方法1は、幅優先の「子→親」による表現形式でも同様に適用できることに注意する必要がある。各ノードは、例えば、図26に示されるように、項目名情報であるノードタイプ(又は、シンボル番号)と、項目値情報であるノード値とが関連付けられている。
[Descendant path condition search method 1: Checking from child to parent]
The RAM 14 of the computer system 10 that executes the path condition search method 1 according to the embodiment of the present invention includes a root node and a non-root node that is a node other than the root node, as shown in FIG. 27A. Tree-type data structure data is expanded. 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. Thus, a parent-child relationship between nodes constituting the tree-type data structure, that is, a parent-child relationship by depth-first “child → parent” is expressed. However, it should be noted that the path condition search method 1 can be similarly applied to the expression format of “child → parent” with breadth priority. For example, as shown in FIG. 26, 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.

コンピュータシステム10は、検索条件として、ノードのシンボル番号=1(シンボル番号1はボタン型を表す)という条件を設定する。この条件は、例えば、ユーザがコンピュータシステム10の入力装置24を介して入力してもよく、又は、外部記憶媒体18から読み出してもよく、或いは、I/F22を介して外部から設定してもよい。   The computer system 10 sets a condition that the node symbol number = 1 (symbol number 1 represents a button type) as a search condition. This condition may be input by the user via the input device 24 of the computer system 10, read from the external storage medium 18, or set externally via the I / F 22, for example. Good.

コンピュータシステム10は、次に、各ノードについて、当該ノードに関連付けられたノードタイプがボタン型と一致するかどうかを判定し、一致した場合に当該ノードに検索ヒット情報を関連付け、「子→親」表現形式の親子関係を辿って当該ノードの祖先ノードに検索ヒット情報を関連付ける。検索ヒット情報は、例えば、各ノード識別子に対応したフラグ情報領域を準備し、検索がヒットした場合に、そのフラグ情報をセットすることによってノード識別子に関連付けることができる。   Next, the computer system 10 determines, for each node, whether or not the node type associated with the node matches the button type. If the node type matches, the search hit information is associated with the node, and “child → parent” The search hit information is associated with the ancestor node of the node by tracing the parent-child relationship of the expression format. 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.

図28は、本発明の一実施例にかかる子孫のパス条件によるツリー検索方法のフローチャートである。また、図29A〜図33Cは、本発明の一実施例にかかる子孫のパス条件によるツリー検索方法の動作状態を説明する図である。   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 33C are diagrams illustrating operation states of the tree search method based on the descendant path conditions according to an embodiment of the present invention.

システム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が繰り返される。本例では、アドレス0からアドレス6までは、シンボル番号が1に合致しない。図29Cに示されるように、シンボル番号読み出しアドレスが7まで進むと、シンボル番号は1に合致する(ステップ2803)。
First, as shown in FIG. 29A, the system 10 initializes a flag area Flag and initializes a symbol number read address (Step 2801). In this example, 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
No.) is stored in the form of an array, but is not limited to this example. Next, the system 10 reads the symbol number (Symbol) corresponding to this symbol number reading address.
No.) is read (step 2802), and it is checked whether or not this symbol number is 1 (step 2803). In the figure, 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). The symbol number read address is moved to the next address 1 (step 2805), and the process returns to step 2802. As shown in FIG. 29B, steps 2802, 2803, 2804, and 2805 are repeated until the read symbol number matches 1 or there is no next symbol number read address. In this example, the symbol numbers do not match 1 from address 0 to address 6. As shown in FIG. 29C, when the symbol number read address advances to 7, the symbol number matches 1 (step 2803).

システム10は、ステップ2803で1に合致するシンボル番号を見出すと(Yes)、図30Aに示されるように、見出したアドレス7のノードのフラグにマークを付け(ステップ2806)、親子関係表現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へ進む。   When the system 10 finds a symbol number that matches 1 in Step 2803 (Yes), as shown in FIG. 30A, it marks the flag of the node at the found address 7 (Step 2806), and the parent-child relationship expression C → P is used to find the address of the parent node of address 7, that is, address 6, and the target node is moved to the parent node (step 2807). In the following, for simplicity, the node at address 7 is referred to as node 7 and the node at address n is generally referred to as node n. Next, as shown in FIG. 30B, the system 10 checks whether or not the destination parent node 6 is marked (step 2808). Since the flag of the node 6 is not marked (No), Mark the flag of node 6 (step 2809) and return to step 2807 to check if there is a parent node. As shown in FIG. 30C, since the parent node of node 6 is node 0 and the flag of node 0 is not marked (step 2808, No), the flag of node 0 is marked (step 2809), If it is checked whether there is a parent node (step 2807), since the parent node does not exist (No), the system 10 proceeds to step 2804.

システム10は、図31Aに示されるように、シンボル番号読み出しアドレスを次のアドレス8へ移動し(ステップ2805)、図31Bに示されるように、読み出されたシンボル番号が1に合致するか、又は、次のシンボル番号読み出しアドレスがなくなるまで、ステップ2802、2803、2804、2805を繰り返す。図31Cに示されるように、シンボル番号読み出しアドレス11まで進むと、シンボル番号は1に合致する(ステップ2803)。   The system 10 moves the symbol number read address to the next address 8 as shown in FIG. 31A (step 2805), and if the read symbol number matches 1 as shown in FIG. 31B, Alternatively, steps 2802, 2803, 2804, and 2805 are repeated until there is no next symbol number read address. As shown in FIG. 31C, when the symbol number reading address 11 is reached, the symbol number matches 1 (step 2803).

システム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が既にマーキングされているかどうかを調べると(ステップ2808)、既にマーキングされているので(Yes)、ステップ2804へ進む。現在のシンボル番号読み出しアドレス11の次のアドレスがあるかどうかをチェックすると(ステップ2804)と、これ以上のアドレスは存在しないため(No)、マーキングが終了する。   Since the system 10 finds a 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 C → P. Is used to move to node 9 which is the parent node of node 11 (step 2807). Next, as shown in FIG. 32B, when the system 10 checks whether or not the parent node 9 to be moved is marked (step 2808), since the flag of the node 9 is not marked (No), the node 10 9 is marked (step 2809), and the process returns to step 2807 to check whether there is a parent node. As shown in FIG. 32C, since the parent node of the node 9 is the node 8 and the flag of the node 8 is not marked (No), the flag of the node 8 is marked (step 2809). The process returns to step 2807 to check whether there is any. The parent node of the node 8 is the node 0. As shown in FIG. 32D, when it is checked whether or not the node 0 is already marked (step 2808), since it is already marked (Yes), the process proceeds to step 2804. . When it is checked whether there is an address next to the current symbol number read address 11 (step 2804), 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.

さらに、システム10は、図33Aに示されるように、検索範囲として、検索前の頂点ノードリストが指定されている場合、マーキングの終了後に、頂点ノードリストの各頂点ノードのフラグがマークされているかどうかをチェックし、マークされている頂点ノードを検索結果として、検索後の頂点ノードリストに格納する。頂点ノード1は、図33Aに示されるように、対応するフラグが0であるため、ノード1を頂点とする部分ツリーはボタン型ノードを含まないが、頂点ノード6は、図33Bに示されるように、対応するフラグが1であるため(すなわち、マークされているため)、ノード6を頂点とする部分ツリーはボタン型ノードを含む。頂点ノード8も同様にして、ボタン型ノードを含む部分ツリーの頂点ノードであることがわかる。したがって、図33Cに示されるように、頂点ノード6及び8を含む頂点ノードリストが検索結果として生成される。   Furthermore, as shown in FIG. 33A, when the vertex node list before the search is designated as the search range, the system 10 determines whether the flag of each vertex node in the vertex node list is marked after the marking is completed. Check whether or not the marked vertex nodes are stored in the vertex node list after the search as a search result. As shown in FIG. 33A, vertex node 1 has a corresponding flag of 0, so the partial tree having node 1 as a vertex does not include a button-type node, but vertex node 6 is shown in FIG. 33B. In addition, since the corresponding flag is 1 (that is, marked), the partial tree having the node 6 as a vertex includes a button type node. Similarly, it is understood that the vertex node 8 is a vertex 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.

上記の例では、シンボル番号が1に合致するノードが検出されたとき、そのノードのすべての親ノードを辿って、親ノードをマーキングしているが、検索範囲として、子孫の段数が指定されている場合、例えば、直下の子ノードまで、孫ノードまでなどの条件が指定されている場合、「子→親」表現による親子関係を辿る段数が制約される。   In the above example, when a node whose symbol number matches 1 is detected, the parent node is marked by tracing all the parent nodes of the node, but the number of descendant stages is specified as the search range. For example, when a condition such as a child node immediately below or a grandchild node is specified, the number of stages of tracing the parent-child relationship by the expression “child → parent” is restricted.

さらに、ノード数が膨大になると、フラグ領域の初期化のために要する時間も増加するので、この初期化の時間を短縮するテクニックを提案する。システム立ち上げ直後のような初期化時には、整数要素からなるフラグ配列のすべてを0で初期化する。システム動作時には、フラグ配列の要素がオーバーフローして0に戻るまで初期化を行わない。例えば、フラグ配列を格納する領域が32ビット整数であるならば、232−1回までの検索回数の範囲内では再度初期化をする必要がない。このとき、ヒットしたノードは、未使用の最小整数でマーキングする。すなわち、初回は1であり、以降、2、3、4のように増加する。したがって、頂点ノードリストが検索条件に合致しているかどうかのチェックは、マーキングに使用した値に一致するかどうかをチェックすればよい。Furthermore, since the time required for initializing the flag area increases when the number of nodes becomes enormous, a technique for shortening the initialization time is proposed. At initialization such as immediately after system startup, all flag arrays consisting of integer elements are initialized to zero. During system operation, initialization is not performed until the element of the flag array overflows and returns to zero. For example, if the area for storing the flag array is a 32-bit integer, it is not necessary to initialize again within the range of the number of searches up to 2 32 −1. At this time, the hit node is marked with an unused minimum integer. That is, the first time is 1, and thereafter increases like 2, 3, and 4. Therefore, whether the vertex node list matches the search condition may be checked by checking whether it matches the value used for marking.

尚、上記の例では、初期値は0としたが、0以外の値でも構わない。また、マーキングに使用する整数は、未使用であれば、最小の整数に限定されない。   In the above example, the initial value is 0, but a value other than 0 may be used. Moreover, the integer used for marking is not limited to the smallest integer as long as it is unused.

[子孫のパス条件検索の方法2:親→子でチェックする方法]
次に、親→子の順にチェックを行う本発明の実施の形態にかかるパス条件検索方法2について説明する。パス条件検索方法2を実行するコンピュータシステム10のRAM14には、図27Aに示されるように、ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータが展開されている。ツリー型データ構造を構成するノード間の親子関係は、深さ優先の「子→親」による表現形式で構築される。パス条件検索方法2は、深さ優先で連続番号が付与されたノードの親子関係を「子→親」関係に基づいて配列表現すると、あるノードの子孫ノードが連続領域に出現するという上述の優れた性質を利用する。また、各ノードは、例えば、図26に示されるように、項目名情報であるノードタイプ(又は、シンボル番号)と、項目値情報であるノード値とが関連付けられている。
[Descendant path condition search method 2: Check from parent to child]
Next, a description will be given of the path condition search method 2 according to the embodiment of the present invention in which checks are performed in order of parent → child. In the RAM 14 of the computer system 10 that executes the path condition search method 2, as shown in FIG. 27A, 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 is expanded. Has been. The parent-child relationship between the nodes constituting the tree-type data structure is constructed in an expression format by depth-first “child → parent”. In the path condition search method 2, when the parent-child relationship of nodes assigned serial numbers with depth priority is arranged based on the “child → parent” relationship, descendant nodes of a certain node appear in a continuous region. Take advantage of For example, as shown in FIG. 26, 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.

コンピュータシステム10は、検索条件として、ノードのシンボル番号=1(シンボル番号1はボタン型を表す)という条件を設定する。さらに、システム10は、検索範囲を表す少なくとも一つの部分ツリーを設定する。本例では、頂点ノード1、6、8を含む頂点ノードリスト[1,6,8]が指定される。この検索条件と検索範囲は、例えば、ユーザがコンピュータシステム10の入力装置24を介して入力してもよく、又は、外部記憶媒体18から読み出してもよく、或いは、I/F22を介して外部から設定してもよい。頂点ノードはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含むノード群を代表するノードである。   The computer system 10 sets a condition that the node symbol number = 1 (symbol number 1 represents a button type) as a search condition. Furthermore, the system 10 sets at least one partial tree representing the search range. In this example, the vertex node list [1, 6, 8] including the vertex nodes 1, 6, and 8 is designated. The search condition and search range may be input by the user via the input device 24 of the computer system 10, read from the external storage medium 18, or externally via the I / F 22. It may be set. 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.

コンピュータシステム10は、次に、各頂点ノードについて、前記ノード間の親子関係を辿って当該頂点ノードの子孫ノードを特定し、当該頂点ノード及び/又は当該頂点ノードの子孫ノードに関連付けられたノードタイプがボタン型と一致するかどうかを判定し、一致したノードが存在する場合に、当該頂点ノードに付与されたノード識別子を検索結果として保存する。   Next, for each vertex node, the computer system 10 identifies the descendant node of the vertex node by tracing the parent-child relationship between the nodes, and the node type associated with the vertex node and / or the descendant node of the vertex node Is matched with the button type, and when there is a matching node, the node identifier assigned to the vertex node is stored as a search result.

図34は、本発明の一実施例にかかる子孫のパス条件によるツリー検索方法のフローチャートである。また、図35A〜図37Cは、本発明の一実施例にかかる子孫のパス条件によるツリー検索方法の動作状態を説明する図である。   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 37C are diagrams for explaining the operation state of the tree search method based on the path conditions of descendants according to an embodiment of the present invention.

システム10は、最初に、図35Aに示されるように、頂点ノードリストから頂点ノードを読み出すためのアドレスを示すポインタを頂点ノードリストの先頭アドレスで初期化し(ステップ3401)、頂点ノードリストから先頭の頂点ノード1を取り出す(ステップ3402)。次に、システム10は、深さ優先の「子→親」による親子関係の表現を参照して、頂点ノード1の子孫ノードを特定する(ステップ3403)。一般に、深さ優先の「子→親」による親子関係の表現は上記の優れた性質を備えているので、特定ノードの子孫ノードは、この特定ノードに付与されたノード識別子が格納されている位置の次の位置から、この特定ノードに付与されたノード識別子の値以上の値が格納されている連続領域を抽出することにより特定することができる。本例では、C→Pにおいて、ノード1に付与されたノード識別子0が格納されている次の位置から、このノード1のノード識別子1以上の値が格納されている位置までの連続領域、すなわち、ノード識別子1、2、2、1が格納されている領域がノード1の子孫ノードの範囲である。この領域は、ノード2、ノード3、ノード4及びノード5に付与されたノード識別子を格納する領域であるため、ノード1の子孫ノードは、ノード2、ノード3、ノード4及びノード5であることがわかる。   First, as shown in FIG. 35A, 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). The vertex node 1 is extracted (step 3402). Next, the system 10 specifies the descendant node of the vertex node 1 with reference to the expression of the parent-child relationship by “child → parent” with depth priority (step 3403). In general, since the expression of the parent-child relationship by depth-first “child → parent” has the above-mentioned excellent properties, the descendant node of the specific node is the position where the node identifier assigned to this specific node is stored Can be specified by extracting a continuous area in which a value equal to or greater than the value of the node identifier assigned to the specific node is extracted from the next position. In this example, in 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, The area in which the node identifiers 1, 2, 2, 1 are stored is the range of the descendant nodes of the node 1. Since this area is an area for storing the node identifiers assigned to the node 2, the node 3, the node 4 and the node 5, the descendant nodes of the node 1 are the node 2, the node 3, the node 4 and the node 5. I understand.

次に、システム10は、特定された子孫ノードの中に、検索条件に合致するノード、すなわち、ノードタイプがボタン型であるノードが存在するかどうかをチェックする(ステップ3404)。本例の場合、図35Bに示されるように、頂点ノード1の子孫ノードの範囲にボタン型のノードは存在しないので、図35Cに示されるように、検索結果の頂点ノードリストには何も登録せずに、システム10はステップ3405へ進む。本例の場合、頂点ノードリストに次の頂点ノード6が存在するので(ステップ3405でYes)、システム10はポインタを頂点ノード6へ移動して(ステップ3406)、ステップ3402へ戻る。   Next, the system 10 checks whether there is a node that matches the search condition among the identified descendant nodes, that is, a node whose node type is a button type (step 3404). In the case of this example, as shown in FIG. 35B, there is no button type node in the range of the descendant node of the vertex node 1, so as shown in FIG. 35C, nothing is registered in the vertex node list of the search result. Instead, the system 10 proceeds to step 3405. In this example, since the next vertex node 6 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.

次に、システム10は、図36Aに示されるように、頂点ノードリストから頂点ノード6を取り出し(ステップ3402)、既に説明した子孫ノードの特定手法を用いて頂点ノード6の子孫ノードとしてノード7を特定する(ステップ3403)。続いて、システム10は、図36Bに示されるように、子孫ノード7のノードタイプがボタン型であるかどうかをチェックし(ステップ3404)、子孫ノード7が検索条件に合致することを判定する(Yes)。したがって、システム10は、図36Cに示されるように、頂点ノード6を検索結果である検索後の頂点ノードリストに登録し(ステップ3407)、ステップ3405へ進む。   Next, as shown in FIG. 36A, the system 10 extracts the vertex node 6 from the vertex node list (step 3402), and sets the node 7 as the descendant node of the vertex node 6 by using the method for identifying the descendant node already described. Specify (step 3403). Subsequently, as shown in FIG. 36B, the system 10 checks whether or not the node type of the descendant node 7 is a button type (step 3404), and determines that the descendant node 7 satisfies the search condition (step 3404). 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.

本例の場合、頂点ノードリストに次の頂点ノード8が存在するので(ステップ3405でYes)、システム10はポインタを頂点ノード6へ移動して(ステップ3406)、ステップ3402へ戻る。   In this example, 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.

次に、システム10は、図37Aに示されるように、頂点ノードリストから頂点ノード8を取り出し(ステップ3402)、既に説明した子孫ノードの特定手法を用いて頂点ノード8の子孫ノードとしてノード9、ノード10及びノード11を特定する(ステップ3403)。続いて、システム10は、図37Bに示されるように、子孫ノードの中にノードタイプがボタン型であるかどうかをチェックし(ステップ3404)、子孫ノード11が検索条件に合致することを判定する(Yes)。したがって、システム10は、図37Cに示されるように、頂点ノード8を検索結果である検索後の頂点ノードリストに登録し(ステップ3407)、ステップ3405へ進む。本例では、頂点ノードリストに次の頂点ノードが存在しないので、システム10は検索処理を終了する。   Next, as shown in FIG. 37A, the system 10 extracts the vertex node 8 from the vertex node list (step 3402), and uses the above-described method for identifying a descendant node as a descendant node of the vertex node 8, Node 10 and node 11 are specified (step 3403). Subsequently, as shown in FIG. 37B, the system 10 checks whether or not the node type is a button type among the descendant nodes (step 3404), and determines that the descendant node 11 matches the search condition. (Yes). Therefore, as shown in FIG. 37C, 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.

以上の検索処理によって、検索後の頂点ノードリスト[6,8]が得られる。   Through the above search processing, the post-search vertex node list [6, 8] is obtained.

上記の説明では、頂点ノードの子孫ノードを特定する際に、すべての子孫ノードを特定しているが、例えば、例えば、子ノードまで、孫ノードまでのように、子孫の世代数を限定することによって検索範囲を限定することも可能である。   In the above description, when specifying the descendant nodes of the vertex node, all the descendant nodes are specified. For example, the number of generations of the descendants is limited to, for example, the child nodes and the grandchild nodes. It is also possible to limit the search range.

また、上記の例では、検索結果として頂点ノードリストを生成しているが、例えば、図29A〜Cを参照して説明したようなフラグ領域を準備し、検索条件にヒットしたすべての子孫ノードのノード識別子を検索結果として生成することも可能である。   In the above example, the vertex node list is generated as a search result. For example, a flag area as described with reference to FIGS. 29A to 29C is prepared, and all descendant nodes that hit the search condition are prepared. It is also possible to generate a node identifier as a search result.

[祖先のパス条件による検索]
次に、本発明の実施の形態にかかる祖先のパス条件による検索方法を説明する。祖先のパス条件による検索とは、指定されたノードタイプを有するノードを祖先ノードとしてもつ頂点ノードを抽出する処理である。図38A〜Cは、パス条件による検索の対象となるツリー型データ構造と、ノードの親子関係の「子→親」表現の説明図である。本例では、頂点ノードは、ノード2、ノード7及びノード9であり、頂点ノードは黒塗りの星印(★)で示されている。シンボル番号と表示図形とシンボル名の対応関係は、図27Bに関して説明した通りである。本例では、頂点ノードの祖先ノードの条件を検索条件としてノード抽出を行う。より具体的には、祖先ノードにハート型のノードを含む頂点ノードを抽出する。
[Search by ancestor path condition]
Next, a search method based on an ancestor path condition according to an embodiment of the present invention will be described. 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 based on a path condition and a “child → parent” expression of a parent-child relationship of nodes. In this example, 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, the display figure, and the symbol name is as described with reference to FIG. 27B. In this example, node extraction is performed using the condition of the ancestor node of the vertex node as a search condition. More specifically, a vertex node including a heart-type node as an ancestor node is extracted.

本例では、親子関係は、深さ優先の「子→親」による表現形式で表されているが、幅優先の「子→親」による表現形式でも構わない。また、各ノードは、例えば、図26に示されるように、項目名情報であるノードタイプ(又は、シンボル番号)と、項目値情報であるノード値とが関連付けられている。   In this example, the parent-child relationship is expressed in the expression format of “child → parent” with depth priority, but may be expressed with the expression of “child → parent” with priority in width. For example, as shown in FIG. 26, 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.

コンピュータシステム10は、検索条件として、ノードのシンボル番号=3(シンボル番号3はハート形を表す)という条件を設定する。さらに、システム10は、検索範囲を表す少なくとも一つの部分ツリーを設定する。本例では、頂点ノード2、7、9を含む頂点ノードリスト[2,7,9]が指定される。この検索条件と検索範囲は、例えば、ユーザがコンピュータシステム10の入力装置24を介して入力してもよく、又は、外部記憶媒体18から読み出してもよく、或いは、I/F22を介して外部から設定してもよい。頂点ノードはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含むノード群を代表するノードである。   The computer system 10 sets a condition of node symbol number = 3 (symbol number 3 represents a heart shape) as a search condition. Furthermore, the system 10 sets at least one partial tree representing the search range. In this example, the vertex node list [2, 7, 9] including the vertex nodes 2, 7, 9 is designated. The search condition and search range may be input by the user via the input device 24 of the computer system 10, read from the external storage medium 18, or externally via the I / F 22. It may be set. 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.

コンピュータシステム10は、各頂点ノードについて、前記ノード間の親子関係を辿って当該頂点ノードの祖先ノードを特定し、当該頂点ノード又は当該頂点ノードの祖先ノードに関連付けられた少なくとも一つの実体情報が前記検索条件と一致するかどうかを判定し、一致したノードが存在する場合に、当該頂点ノードに付与されたノード識別子を検索結果として保存する。   For each vertex node, the computer system 10 traces the parent-child relationship between the nodes to identify an ancestor node of the vertex node, and at least one entity information associated with the vertex node or the ancestor node of the vertex node is the It is determined whether or not the search condition is matched, and when there is a matched node, the node identifier assigned to the vertex node is stored as a search result.

図39は、本発明の一実施例にかかる祖先のパス条件によるツリー検索方法のフローチャートである。また、図40A〜図42Cは、本発明の一実施例にかかる祖先のパス条件によるツリー検索方法の動作状態を説明する図である。   FIG. 39 is a flowchart of a tree search method based on ancestor path conditions according to an embodiment of the present invention. FIGS. 40A to 42C are diagrams for explaining the operation state of the tree search method based on the ancestor path condition according to the embodiment of the present invention.

システム10は、最初に、図40Aに示されるように、頂点ノードリストから頂点ノードを読み出すためのアドレスを示すポインタを頂点ノードリストの先頭アドレスで初期化し(ステップ3901)、頂点ノードリストから先頭の頂点ノード2を取り出す(ステップ3902)。次に、システム10は、この頂点ノード2に対応したシンボル番号(Symbol No.)を読み出し(ステップ3903)、このシンボル番号が3であるかどうかをチェックする(ステップ3904)。頂点ノード2のシンボル番号は3ではないため(No)、システム10はステップ3905へ進み、深さ優先の「子→親」による親子関係の表現を参照して、頂点ノード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へ進む。   First, as shown in FIG. 40A, 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). The vertex node 2 is extracted (step 3902). Next, the system 10 reads the symbol number (Symbol No.) corresponding to this vertex node 2 (step 3903) and checks whether or not this symbol number is 3 (step 3904). Since the symbol number of the vertex node 2 is not 3 (No), the system 10 proceeds to Step 3905, and the parent node of the vertex node 2 exists with reference to the expression of the parent-child relationship by depth-first “child → parent”. 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). Since the symbol number associated with node 1 is 5 and does not match the search condition (step 3907, No), the system 10 returns to step 3905 and checks whether the parent node of node 1 exists. In this case, as shown in FIG. 40C, the parent node 0 of the node 1 exists (Yes), and the system 10 reads the symbol number corresponding to the node 0 (step 3906). Since the symbol number associated with node 0 is 2 and does not match the search condition (step 3907, No), the 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.

頂点ノードリストには次の頂点ノード7が存在するので、システム10は、図41Aに示されるように、頂点ノードリストから頂点ノードを読み出すためのアドレスを示すポインタを頂点ノードリストの次のアドレスへ移動し(ステップ3910)、頂点ノードリストから2番目の頂点ノード7を取り出す(ステップ3902)。次に、システム10は、この頂点ノード7に対応したシンボル番号を読み出し(ステップ3903)、このシンボル番号が3であるかどうかをチェックする(ステップ3904)。頂点ノード7のシンボル番号は3ではないため(No)、システム10はステップ3905へ進み、深さ優先の「子→親」による親子関係の表現を参照して、頂点ノード7の親ノードがあるかどうかを判定し、この場合、図41Bに示されるように、親ノード6が存在するので(Yes)、システム10は、親ノード6に対応したシンボル番号を読み出す(ステップ3906)。ノード6に関連付けられたシンボル番号は3であり、検索条件に合致するので(ステップ3907,Yes)、システム10は、ステップ3908へ進み、図41Cに示されるように、現在のポインタが指し示す頂点ノード7を検索結果として検索後の頂点ノードリストに登録する。頂点ノード7が登録されたため、これ以上親ノードを辿る必要がないので、システム10はステップ3909へ進む。   Since the next vertex node 7 exists in the vertex node list, the system 10 sets a pointer indicating an address for reading the vertex node from the vertex node list to the next address in the vertex node list as shown in FIG. 41A. Move (step 3910) and take out the second vertex node 7 from the vertex node list (step 3902). Next, the system 10 reads the symbol number corresponding to this vertex node 7 (step 3903), and checks whether this symbol number is 3 (step 3904). Since the symbol number of the vertex node 7 is not 3 (No), the system 10 proceeds to Step 3905, and the parent node of the vertex node 7 exists with reference to the expression of the parent-child relationship by depth-first “child → parent”. In this case, as shown in FIG. 41B, since the parent node 6 exists (Yes), the system 10 reads the symbol number corresponding to the parent node 6 (step 3906). Since the symbol number associated with node 6 is 3 and matches the search condition (step 3907, Yes), the system 10 proceeds to step 3908 and, as shown in FIG. 41C, the vertex node pointed to by the current pointer 7 is registered in the vertex node list after the search as a search result. Since the vertex node 7 has been registered, there is no need to follow the parent node any more, so the system 10 proceeds to step 3909.

頂点ノードリストには次の頂点ノード9が存在するので、システム10は、図42Aに示されるように、頂点ノードリストから頂点ノードを読み出すためのアドレスを示すポインタを頂点ノードリストの次のアドレスへ移動し(ステップ3910)、頂点ノードリストから3番目の頂点ノード9を取り出す(ステップ3902)。次に、システム10は、この頂点ノード9に対応したシンボル番号を読み出し(ステップ3903)、このシンボル番号が3であるかどうかをチェックする(ステップ3904)。頂点ノード9のシンボル番号は3ではないため(No)、システム10はステップ3905へ進み、深さ優先の「子→親」による親子関係の表現を参照して、頂点ノード9の親ノードがあるかどうかを判定し、この場合、図42Bに示されるように、親ノード8が存在するので(Yes)、システム10は、親ノード8に対応したシンボル番号を読み出す(ステップ3906)。ノード8に関連付けられたシンボル番号は3であり、検索条件に合致するので(ステップ3907,Yes)、システム10は、ステップ3908へ進み、図42Cに示されるように、現在のポインタが指し示す頂点ノード9を検索結果として検索後の頂点ノードリストに登録する。頂点ノード9が登録されたため、これ以上親ノードを辿る必要がないので、システム10はステップ3909へ進む。頂点ノードリストには次の頂点ノードが存在しないため(ステップ3909,No)、システム10は検索処理を終了する。   Since the next vertex node 9 exists in the vertex node list, the system 10 sets a pointer indicating an address for reading the vertex node from the vertex node list to the next address in the vertex node list, as shown in FIG. 42A. Move (step 3910) and take out 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 the vertex node 9 is not 3 (No), the system 10 proceeds to step 3905, and the parent node of the vertex node 9 exists with reference to the expression of the parent-child relationship by depth-first “child → parent”. In this case, as shown in FIG. 42B, 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 condition (step 3907, Yes), the system 10 proceeds to step 3908 and, as shown in FIG. 42C, the vertex node pointed to by the current pointer 9 is registered in the vertex node list after the search as a search result. Since the vertex node 9 has been registered, there is no need to follow the parent node any more, so the 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.

以上の検索処理によって、検索後の頂点ノードリスト[7,9]が得られる。   By the above search processing, the vertex node list [7, 9] after the search is obtained.

上記の説明では、頂点ノードの祖先ノードを辿る際に、すべての祖先ノードを探索しているが、祖先の世代数を限定することによって検索範囲を限定することも可能である。   In the above description, all ancestor nodes are searched when tracing the ancestor nodes of the vertex nodes. However, the search range can be limited by limiting the number of ancestor generations.

また、上記の例では、検索結果として頂点ノードリストを生成しているが、例えば、図29A〜Cを参照して説明したようなフラグ領域を準備し、検索条件にヒットしたすべての子孫ノードのノード識別子を検索結果として生成することも可能である。   In the above example, the vertex node list is generated as a search result. For example, a flag area as described with reference to FIGS. 29A to 29C is prepared, and all descendant nodes that hit the search condition are prepared. It is also possible to generate a node identifier as a search result.

[値条件による検索]
ここまでは、パス条件による検索について説明したが、本発明は値条件による検索を実施することが可能である。値条件による検索とは、指定された項目値情報(例えば、ノード値)が関連付けられたノードを抽出する処理である。例えば、図26に示されるように、項目名情報(例えば、ノードタイプ)と項目値情報(例えば、ノード値)は、ノードに対して同じように関連付けられているので、パス条件による検索、すなわち、ノードタイプを条件とする検索のアルゴリズムは、値条件による検索、すなわち、ノード値を条件とする検索に適用できることが明らかである。
[Search by value condition]
So far, the search based on the path condition has been described, but the present invention can perform the search based on the value condition. The search based on the 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, the item name information (for example, node type) and the item value information (for example, node value) are similarly associated with the node. It is apparent that the search algorithm using the node type as a condition can be applied to a search using a value condition, that is, a search using a node value as a condition.

さらに、アプリケーションによっては、すべてのノードが同じノードタイプに関連付けられる場合がある。このようなケースでは、各ノードにノードタイプを関連付ける必要がなくなるので、ノードにはノード値だけが関連付けられ、値条件による検索だけが行われる。例えば、本発明のツリー型データ構造が、プログラミング言語の構文解析に適用される場合、ノードの実体的な値は、分離されたトークン文字列だけであるため、ノードには、この文字列だけが関連付けられ、ノードタイプは使用されない。   Further, depending on the application, all nodes may be associated with the same node type. In such a case, since it is not necessary to associate a node type with each node, only a node value is associated with the node, and only a search based on a value condition is performed. For example, when the tree-type data structure of the present invention is applied to parsing of a programming language, since the actual value of a node is only a separated token string, the node has only this string. Associated, node type is not used.

[組み合わせ検索]
既に説明したように、検索でヒットしたノードを頂点ノードで代表させることが可能であり、検索の結果をこの頂点ノードのリスト、すなわち、頂点ノードリストで表現することができる。例えば、あるツリー型データ構造のデータを独立した第1の検索条件と第2の検索条件の二つの検索条件で検索した結果をそれぞれ第1の頂点ノードリストと第2の頂点ノードリストで表す場合を考える。このとき、第1の頂点ノードリストと第2の頂点ノードリストとの間で上記論理積(AND)集合演算を実行すると、第1の検索条件と第2の検索条件の両方を満たす検索結果を表す頂点ノードリストが得られる。
[Combination search]
As already described, the nodes hit by the search can be represented by the vertex nodes, and the result of the search can be expressed by this vertex node list, that is, the vertex node list. For example, when the results of searching for data of a certain tree-type data structure under two independent search conditions, 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. At this time, when the logical product (AND) set operation is executed between the first vertex node list and the second vertex node list, a search result that satisfies both the first search condition and the second search condition is obtained. A vertex node list representing is obtained.

より具体的に、図27Aのツリー型データ構造のデータに対して、頂点ノードリスト[1,6,8]を検索範囲として、検索条件1=「子孫にボタン型(シンボル番号=1)のノードが存在する頂点ノード」及び検索条件2=「子孫に変形四角型(シンボル番号=4)のノードが存在する頂点ノード」を検索条件として、検索を実行する例を考える。   More specifically, for the data of the tree-type data structure of FIG. 27A, the search condition 1 = “nodes with descendant button type (symbol number = 1)”, with the vertex node list [1, 6, 8] as the search range Let us consider an example in which a search is executed using a search condition of “vertex node in which a node exists” and search condition 2 = “vertex node in which a deformed quadrangle (symbol number = 4) node exists” as a search condition.

検索条件1による検索の結果は、図28乃至33を参照して説明したように、頂点ノードリスト1=[6,8]である。また、検索条件2についても検索条件1と同様の検索を実行すると、検索の結果は、頂点ノードリスト2=[1,8]であることがわかる。さらに、検索条件3=(検索条件1)AND(検索条件2)を検索条件として、すなわち、検索条件3=「子孫にボタン型のノードと変形四角型のノードが存在する頂点ノード」を検索条件として、同様に検索を実行すると、検索の結果は、頂点ノードリスト3=[8]である。   As a result of the search based on the search condition 1, the vertex node list 1 = [6, 8] as described with reference to FIGS. Further, when the same search as the search condition 1 is executed for the search condition 2, it can be seen that the result of the search is the vertex node list 2 = [1, 8]. Further, the search condition 3 = (search condition 1) AND (search condition 2) is used as the search condition, that is, the search condition 3 = “vertex node in which a button type node and a deformed square type node exist in descendants”. When the search is executed in the same manner, the result of the search is the vertex node list 3 = [8].

一方、頂点ノードリスト1=[6,8]と頂点ノードリスト2=[1,8]の論理積演算を実行すると、頂点ノードリスト1と頂点ノードリスト2は共に正規部分ツリー群であるので、(頂点ノードリスト1)AND(頂点ノードリスト2)=[8]=頂点ノードリスト3であることがわかる。   On the other hand, when the AND operation of the vertex node list 1 = [6, 8] and the vertex node list 2 = [1, 8] is executed, both the vertex node list 1 and the vertex node list 2 are normal subtree groups. (Vertex node list 1) AND (vertex node list 2) = [8] = vertex node list 3

このように、本発明によれば、複数の検索条件の論理積を検索条件とする検索の結果は、各検索条件による検索の結果の頂点ノードリストの論理積演算によって得られる。さらに、論理積の代わりに論理和を用いても同様に、複数の検索条件の論理和を検索条件とする検索の結果は、各検索条件による検索の結果の頂点ノードリストの論理和演算によって得られる。   As described above, according to the present invention, 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. Further, even when logical sum is used instead of logical product, the search result using the logical sum of a plurality of search conditions as the search condition is obtained by the logical sum operation of the vertex node list of the search result by each search condition. It is done.

[ツリーデータ集計の概要]
ツリーデータの集計は、一般に、ツリーのある範囲のノードに関連付けられた項目値情報を項目名情報ごとに分類して集計する。集計には、集計の測度である項目値情報の個数のカウント、或いは、合計値、平均値、最大値、最小値などの計算のように様々な処理が含まれる。集計の対象である測度は、例えば、ノードに関連付けられた特定のノードタイプに対応したノード値である。集計の範囲は、例えば、部分ツリー群であり、部分ツリーの頂点ノードのリスト、すなわち、頂点ノードリストによって指定できる。集計の分類対象である次元は、例えば、ノードに関連付けられた特定のノードタイプに対応したノード値である。
[Overview of tree data aggregation]
In general, 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, which is a measure of aggregation, or calculating a total value, average value, maximum value, minimum value, and the like. The measure that is a target of aggregation 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, for example, a node value corresponding to a specific node type associated with the node.

図43A、Bは、本発明の一実施例にかかる集計を説明するための図であり、図43Aは集計の対象となるツリー型データ構造とノードの親子関係の「子→親」表現の説明図であり、図43Bはシンボル番号と表示図形とシンボル名の対応関係を表す図である。図43A、Bに示された例を参照して、2種類のツリーデータ集計を説明する。   43A and 43B are diagrams for explaining aggregation according to an embodiment of the present invention, and FIG. 43A is a description of a “child → parent” expression of a parent-child relationship between a tree-type data structure and nodes to be aggregated. 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 examples shown in FIGS. 43A and 43B.

第1のツリーデータ集計とは、例えば、メーカ名(次元)ごとに、重量(測度)の件数と合計を算出することである。そして、集計の範囲を指定するために、この例では、頂点ノードリスト=[1,6,8]が使用される。勿論、集計の範囲は、ツリー全体でも構わない。   The first tree data aggregation is, for example, calculating the number of weights (measures) and the total for each manufacturer name (dimension). In this example, the vertex node list = [1, 6, 8] is used to specify the range of aggregation. Of course, the total range may be the whole tree.

上記の例では、次元を指定しているが、ツリーデータ集計では次元を指定しない集計、すなわち、第2のツリーデータ集計も考えられる。例えば、頂点ノードリストを指定し、頂点ノードごとに測度を集計することができる。第2のツリーデータ集計は、この頂点ノード、すなわち、部分ツリーを明示的に指定するタイプの集計である。第2のツリーデータ集計は、図43A、Bの例では、頂点ノードリスト=[1,6,8]を指定し、頂点ノード1、頂点ノード6及び頂点ノード8のそれぞれについて、頂点ノードで表された部分ツリーに含まれるノードに関連付けられた重量(測度)の件数と合計を算出する。   In the above example, the dimension is specified, but in the tree data aggregation, the aggregation without specifying the dimension, that is, the second tree data aggregation is also conceivable. For example, 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, that is, a partial tree. In the example of FIGS. 43A and 43B, the second tree data totalization is designated by the vertex node list = [1, 6, 8], and each of the vertex node 1, the vertex node 6, and the vertex node 8 is represented by the vertex node. The number of weights (measures) associated with the nodes included in the specified partial tree and the total are calculated.

[第1のツリーデータ集計]
次に、第1のツリーデータ集計を詳細に説明する。この集計は、集計の対象=測度、集計の範囲=カテゴリ、集計の分類対象=次元を指定して集計を行う。
[First tree data aggregation]
Next, the first tree data aggregation will be described in detail. This aggregation is performed by specifying the aggregation target = measure, the aggregation range = category, and the aggregation classification target = dimension.

ツリー型データ構造のデータは、図43Aに示されるように、ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含み、集計を行うコンピュータシステム10の記憶装置、例えば、RAM14に展開されている。ノード間の親子関係は、ルート・ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノード識別子を付与し、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子を関連付けることにより定義される。各ノードはデータを表す少なくとも一つの実体情報が関連付けられている。また、頂点ノードはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含むノード群を代表するノードである。   As shown in FIG. 43A, the tree-type data structure data includes a root node and a non-root node that is a node other than the root node, and is expanded in a storage device of the computer system 10 that performs aggregation, for example, the RAM 14 Has been. In the parent-child relationship between nodes, 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 non-root node identifier is assigned to each non-root node. Defined by associating a node identifier assigned to each parent node of the 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.

コンピュータシステム10は、集計の分類対象を表す項目名情報を指定し、集計の対象を表す項目名情報を指定し、集計の範囲を表す少なくとも一つの部分ツリーを指定する。集計の分類対象、集計の対象、及び、集計の範囲は、例えば、ユーザがコンピュータシステム10の入力装置24を介して入力してもよく、又は、外部記憶媒体18から読み出してもよく、或いは、I/F22を介して外部から設定してもよい。   The computer system 10 specifies item name information representing a classification target for aggregation, specifies item name information representing an aggregation target, and specifies at least one partial tree representing a range of aggregation. The total classification target, the total target, and the total range may be input by the user via the input device 24 of the computer system 10, or may be read from the external storage medium 18, or You may set from the outside via I / F22.

次に、コンピュータシステム10は、各頂点ノードについて、前記ノード間の親子関係を辿って当該頂点ノードの子孫ノードを特定し、当該頂点ノード又は当該頂点ノードの子孫ノードに関連付けられた項目名情報が集計の対象を表す項目名情報と一致するかどうかを判定し、一致したノードに関連付けられた項目値情報を、当該頂点ノードによって代表されたノード群に関係した集計の分類対象を表す項目名情報に関連付けられた項目値情報毎に集計する。   Next, the computer system 10 identifies the descendant node of the vertex node by tracing the parent-child relationship between the nodes for each vertex node, and the item name information associated with the vertex node or the descendant node of the vertex node is Item name information that represents whether or not the item name information that represents the aggregation target matches, and the item value information associated with the matched node represents the classification target related to the node group represented by the vertex node Aggregate for each item value information associated with.

第1のツリーデータ集計の一実施例では、頂点ノードリストと次元と測度を指定して、頂点ノードリストで指定される範囲のノードに存在している次元値、測度を集計する。この場合、ある頂点ノードで指定される範囲(すなわち、部分ツリー)に同じ次元の次元値が関連付けられたノードが複数個存在する場合、測度がどの次元値に属するかを別途指定する必要がある。そこで、以下の例では、簡単のため、「部分ツリー内に同じ次元の次元値が関連付けられた複数のノードが存在する場合には集計を行わない」という規則を適用することにする。   In one embodiment of the first tree data aggregation, a vertex node list, a dimension, and a measure are designated, and dimension values and measures existing in nodes in a range designated by the vertex node list are aggregated. In this case, when there are a plurality of nodes associated with dimension values of the same dimension in a range (that is, a partial tree) specified by a certain vertex node, it is necessary to separately specify which dimension value the measure belongs to. . Therefore, in the following example, for the sake of simplicity, a rule that “a total is not performed when there are a plurality of nodes associated with dimension values of the same dimension in the partial tree” is applied.

図43Aに示された例を参照して、次元と集計実施可能性との関係を詳述する。図44A〜Dは、図43Aの各頂点ノードによって代表される部分ツリーの説明図である。ここで、メーカ名(次元)ごとに、重量(測度)の件数と合計を算出する集計を行うことを考える。   With reference to the example shown in FIG. 43A, the relationship between the dimension and the feasibility of aggregation will be described in detail. 44A to 44D are explanatory diagrams of partial trees represented by the vertex nodes in FIG. 43A. Here, it is considered to perform aggregation for calculating the number of weights (measures) and the total for each manufacturer name (dimension).

図44Aは、頂点ノード1によって代表される部分ツリー1を表し、ノード2とノード5の二つのノードに次元であるメーカ名が関連付けられているので、ノード1とノード3に関連付けられた重量がどのメーカ名に属しているかを特定できない。したがって、部分ツリー1に対する集計は実施しない。   FIG. 44A shows a partial tree 1 represented by the vertex node 1, and since the manufacturer name which is a dimension is associated with the two nodes, the node 2 and the node 5, the weight associated with the node 1 and the node 3 is The manufacturer name cannot be specified. Therefore, aggregation for the partial tree 1 is not performed.

図44Bは、頂点ノード6によって代表される部分ツリー2を表している。この部分ツリー2には、次元であるメーカ名が関連付けられたノードは存在しないが、測度である重量が関連付けられたノード7が存在する。このように、次元が存在しない場合には、次元値がNULL値であるとして、集計を実施することにする。   FIG. 44B represents the partial tree 2 represented by the vertex node 6. In this partial tree 2, there is no node associated with the manufacturer name as a dimension, but there is a node 7 associated with a weight as a measure. As described above, when there is no dimension, aggregation is performed assuming that the dimension value is a NULL value.

図44Cは、頂点ノード8によって代表される部分ツリー3を表している。この部分ツリー3には、次元であるメーカ名が関連付けられたノード10が存在し、測度である重量が関連付けられたノード9及びノード11が存在する。このように、次元が1個だけ存在し、1個以上の測度が存在する部分ツリーの場合、各測度がどの次元値に属するかを特定できるので、唯一の次元値について、1個以上の測度を集計する。   FIG. 44C represents the partial tree 3 represented by the vertex node 8. The partial tree 3 includes 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. Thus, in the case of a partial tree with only one dimension and one or more measures, it is possible to specify which dimension value each measure belongs to, so for one dimension value one or more measures Are counted.

以上の規則に従って、メーカ名(次元)ごとに、重量(測度)の件数と合計を集計すると、図44Dに示されるような集計結果が得られる。すなわち、メーカ名=「NULL」に対応した重量は、ノード7に関連付けられた重量1件であり、その重量の合計=「ノード7に関連付けられたノード値」である。また、メーカ名=「ノード10に関連付けられたノード値」に対応した重量は、ノード9とノード11に関連付けられた重量2件であり、その重量の合計=「ノード9に関連付けられたノード値+ノード11に関連付けられたノード値」である。   If the number of weights (measures) and the total are totaled for each manufacturer name (dimension) according to the above rules, a totaling result as shown in FIG. 44D is obtained. That is, the weight corresponding to the manufacturer name = “NULL” is one weight associated with the node 7, and the total of the weights = “the node value associated with the node 7”. The weight corresponding to the manufacturer name = “the node value associated with the node 10” is two weights associated with the node 9 and the node 11, and the total of the weights = “the node value associated with the node 9”. + Node value associated with node 11 ”.

図45は、本発明の一実施例にかかる第1のツリーデータ集計方法のフローチャートである。また、図46乃至48は、本発明の一実施例にかかる第1のツリーデータ集計方法の動作状態を説明する図である。   FIG. 45 is a flowchart of the first tree data totaling method according to an embodiment of the present invention. FIGS. 46 to 48 are diagrams for explaining the operation state of the first tree data totaling method according to the embodiment of the present invention.

システム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)。   First, as shown in FIG. 46, 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 4501). The vertex node 1 is extracted (step 4502). Next, 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). In general, the expression of the parent-child relationship by depth-first “child → parent” has the above-mentioned excellent properties. Therefore, the partial tree is the position next to the position where the node identifier assigned to the vertex node is stored. From this, it is possible to specify by extracting a continuous area in which a value equal to or greater than the value of the node identifier assigned to this vertex node is stored. In this example, in C → P, a continuous region 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, the node A region in which identifiers 0, 1, 2, 2, 1 are stored is a partial tree represented by vertex node 1. Since this area is an area for storing the node identifiers assigned to the node 1, the node 2, the node 3, the node 4, and the node 5, the partial tree includes the node 1, the node 2, the node 3, the node 4, and the node 5 (* 1 in FIG. 46).

次に、システム10は、特定された部分ツリーの中で、測度(=重量)と次元(=メーカ名)に関連付けられているノードを特定する(ステップ4504)。本例では、ノード1のノードタイプは重量であり、ノード2のノードタイプはメーカ名であり、ノード3のノードタイプは重量であり、ノード4のノードタイプは価格であり、ノード5のノードタイプはメーカ名である(図46の※2)。したがって、本例では、測度が2個存在し、次元も2個存在する。システム10は、測度の個数が0個であるかどうかを判定すると(ステップ4505)、測度の個数は0個ではないことがわかり(No)、次に、次元の個数が2個以上であるかどうかを判定する(ステップ4506)。次元の個数は2個以上であり(Yes)、この部分ツリーは集計の対象外であるため、システム10は、次の頂点ノードが存在するかどうかを判定する(ステップ4511)。本例の場合、頂点ノードリストに次の頂点ノード6が存在するので(Yes)、システム10はポインタを頂点ノード6へ移動して(ステップ4512)、ステップ4502へ戻る。   Next, the system 10 identifies a node associated with a measure (= weight) and a dimension (= manufacturer name) in the identified partial tree (step 4504). In this example, the node type of node 1 is weight, the node type of node 2 is a manufacturer name, the node type of node 3 is weight, the node type of node 4 is price, and the node type of node 5 Is the manufacturer name (* 2 in FIG. 46). Therefore, in this example, there are two measures and two dimensions. When the system 10 determines whether the number of measures is zero (step 4505), it is found that the number of measures is not zero (No), and then whether the number of dimensions is two or more. It is determined whether or not (step 4506). Since the number of dimensions is two or more (Yes) and this partial tree is not subject to aggregation, the system 10 determines whether or not 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 4512) and returns to step 4502.

次に、システム10は、図47に示されるように、頂点ノードリストから頂点ノード6を取り出し(ステップ4502)、既に説明した方法と同様に頂点ノード6で代表される部分ツリーを特定すると(ステップ4503)、この部分ツリーにノード6及びノード7が属していることわかる(図47の※1)。   Next, as shown in FIG. 47, the system 10 extracts the vertex node 6 from the vertex node list (step 4502), and specifies the partial tree represented by the vertex node 6 in the same manner as already described (step 450). 4503), it can be seen that node 6 and node 7 belong to this partial tree (* 1 in FIG. 47).

次に、システム10は、特定された部分ツリーの中で、測度(=重量)と次元(=メーカ名)に関連付けられているノードを特定する(ステップ4504)。本例では、ノード6のノードタイプは価格であり、ノード7のノードタイプは重量である(図47の※2)。したがって、本例では、測度が1個存在し、次元は0個である。システム10は、測度の個数が0個であるかどうかを判定すると(ステップ4505)、測度の個数は0個ではないことがわかり(No)、次に、次元の個数が2個以上であるかどうかを判定する(ステップ4506)。次元の個数は2個以上ではなく(No)、次元の個数が1個であるかどうかを判定すると(ステップ4507)、次元の個数が1個ではないため(No)、次元値をNULL値とみなし(ステップ4508)、測度を集計する(ステップ4510)。本例では、頂点ノード6で代表される部分ツリーの重量の件数は1件であり、重量の合計は、ノード7に関連付けられたノード値の値である(図示されない)。さらに、システム10は、次の頂点ノードが存在するかどうかを判定する(ステップ4511)。本例の場合、頂点ノードリストに次の頂点ノード8が存在するので(Yes)、システム10はポインタを頂点ノード8へ移動して(ステップ4512)、ステップ4502へ戻る。   Next, the system 10 identifies a node associated with a measure (= weight) and a dimension (= manufacturer name) in the identified partial tree (step 4504). In this example, the node type of the node 6 is a price, and the node type of the node 7 is a weight (* 2 in FIG. 47). Therefore, in this example, there is one measure and the dimension is zero. When the system 10 determines whether the number of measures is zero (step 4505), it is found that the number of measures is not zero (No), and then whether the number of dimensions is two or more. It is determined whether or not (step 4506). If the number of dimensions is not two or more (No) and it is determined whether or not the number of dimensions is one (step 4507), the number of dimensions is not one (No), so the dimension value is set to a NULL value. Deemed (step 4508), the measures are tabulated (step 4510). In this example, the number of weights of the partial tree represented by the vertex node 6 is one, and the total weight is the value of the node value associated with the node 7 (not shown). Furthermore, the 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.

次に、システム10は、図48に示されるように、頂点ノードリストから頂点ノード8を取り出し(ステップ4502)、既に説明した方法と同様に頂点ノード8で代表される部分ツリーを特定すると(ステップ4503)、この部分ツリーにノード8、ノード9、ノード10及びノード11が属していることわかる(図48の※1)。   Next, as shown in FIG. 48, the system 10 extracts the vertex node 8 from the vertex node list (step 4502), and identifies the partial tree represented by the vertex node 8 in the same manner as described above (step 450). 4503), it can be seen that node 8, node 9, node 10, and node 11 belong to this partial tree (* 1 in FIG. 48).

次に、システム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に割り当てられたノード値の値との合計である(図示されない)。   Next, the system 10 identifies a node associated with a measure (= weight) and a dimension (= manufacturer name) in the identified partial tree (step 4504). In this example, the node type of the node 8 is a price, the node type of the node 9 is a weight, the node type of the node 10 is a manufacturer name, and the node type of the node 11 is a weight (* 2 in FIG. 48). ). Therefore, in this example, there are two measures and one dimension. When the system 10 determines whether the number of measures is zero (step 4505), it is found that the number of measures is not zero (No), and then whether the number of dimensions is two or more. It is determined whether or not (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), since the number of dimensions is 1 (Yes), it is associated with the node 10 The node values are used as dimension values (step 4509), and the measures are totaled (step 4510). In this example, the number of weights of the partial tree represented by the vertex node 8 is two, and the total weight is the value of the node value associated with the node 9 and the value of the node value assigned to the node 11. (Not shown).

さらに、システム10は、次の頂点ノードが存在するかどうかを判定する(ステップ4511)。本例の場合、頂点ノードリストにこれ以上頂点ノードが存在しないため(No)、システム10は、部分ツリー毎に得られた集計結果を統合する(ステップ4513)。本例では、集計の次元値は、NULL値と、ノード10に割り当てられたメーカ名(ノード10に関連付けられたノード値)であり、NULL値に対応する重量の件数は1件であり、重量の合計は、ノード7に割り当てられた重量(ノード7に関連付けられたノード値)であり、ノード10に割り当てられたメーカ名に対応する重量の件数は2件であり、重量の合計は、ノード9に関連付けられたノード値の値と、ノード11に割り当てられたノード値の値との合計である。以上の処理により、本発明の一実施例による第1のツリーデータ集計方法が終了する。   Furthermore, the system 10 determines whether there is a next vertex node (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). In this example, the total dimension value is the NULL value and the manufacturer name assigned to the node 10 (the node value associated with the node 10), the number of weights corresponding to the NULL value is one, and the weight Is the weight assigned to the node 7 (the node value associated with the node 7), the number of weights corresponding to the manufacturer name assigned to the node 10 is two, and the total weight is the node 9 is the sum of the value of the node value associated with 9 and the value of the node value assigned to node 11. With the above processing, the first tree data totaling method according to the embodiment of the present invention is completed.

上記の説明では、頂点ノードによって代表される部分ツリーを特定する際に、すべての子孫ノードを特定しているが、例えば、例えば、子ノードまで、孫ノードまでのように、子孫の世代数を限定することによって集計範囲を限定することも可能である。   In the above description, when the partial tree represented by the vertex node is specified, all the descendant nodes are specified. For example, the generation number of the descendants is set up to, for example, the child node and the grandchild node. It is also possible to limit the total range by limiting.

また、上記の例では、ノード間の親子関係が深さ優先モードで表現されているが、幅優先モードで表現し、そこから部分ツリーを特定しても構わない。   In the above example, the parent-child relationship between the nodes is expressed in the depth priority mode. However, the partial tree may be specified from the depth priority mode.

[第2のツリーデータ集計]
次に、次元を指定しない第2のツリーデータ集計方法をより詳しく説明する。
[Second tree data aggregation]
Next, the second tree data totaling method without specifying a dimension will be described in more detail.

ツリー型データ構造のデータは、図43Aに示されるように、ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含み、集計を行うコンピュータシステム10の記憶装置、例えば、RAM14に展開されている。ノード間の親子関係は、ルート・ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノード識別子を付与し、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子を関連付けることにより定義される。各ノードはデータを表す少なくとも一つの実体情報が関連付けられている。また、頂点ノードはツリー型データ構造の特定のノード及び当該特定のノードの子孫ノードを含むノード群を代表するノードである。   As shown in FIG. 43A, the tree-type data structure data includes a root node and a non-root node that is a node other than the root node, and is expanded in a storage device of the computer system 10 that performs aggregation, for example, the RAM 14 Has been. In the parent-child relationship between nodes, 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 non-root node identifier is assigned to each non-root node. Defined by associating a node identifier assigned to each parent node of the 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.

コンピュータシステム10は、集計の分類対象を表す項目名情報を指定し、集計の範囲を表す少なくとも一つの部分ツリーを指定する。集計の分類対象、及び、集計の範囲は、例えば、ユーザがコンピュータシステム10の入力装置24を介して入力してもよく、又は、外部記憶媒体18から読み出してもよく、或いは、I/F22を介して外部から設定してもよい。   The computer system 10 designates item name information that represents a classification target for aggregation, and specifies at least one partial tree that represents the range of aggregation. The total classification target and the total range may be input by the user via the input device 24 of the computer system 10, or may be read from the external storage medium 18, or the I / F 22 may be stored. You may set from the outside via.

次に、コンピュータシステム10は、各頂点ノードについて、前記ノード間の親子関係を辿って当該頂点ノードの子孫ノードを特定し、当該頂点ノード及び/又は当該頂点ノードの子孫ノードに関連付けられた項目名情報が集計の対象と一致するかどうかを判定し、一致したノードに関連付けられた項目値情報を集計する。   Next, the computer system 10 identifies the descendant node of the vertex node by tracing the parent-child relationship between the nodes for each vertex node, and the item name associated with the vertex node and / or the descendant node of the vertex node It is determined whether the information matches the target of aggregation, and the item value information associated with the matched node is aggregated.

図43A、Bの例では、第2のツリーデータ集計方法は、頂点ノードリスト=[1,6,8]を指定し、頂点ノード1、頂点ノード6及び頂点ノード8のそれぞれについて、頂点ノードで表された部分ツリーに含まれるノードに関連付けられた重量(測度)の件数と合計を算出する。図49は本発明の一実施例にかかる第2のツリーデータ集計方法のフローチャートであり、図50A〜Dはこの第2のツリーデータ集計方法の動作状態の説明図である。   In the examples of FIGS. 43A and 43B, the second tree data tabulation method specifies the vertex node list = [1, 6, 8], and for each of the vertex node 1, the vertex node 6, and the vertex node 8, Calculate the number and total of weights (measures) associated with the nodes contained in the represented partial tree. FIG. 49 is a flowchart of a second tree data totaling method according to an embodiment of the present invention, and FIGS. 50A to 50D are explanatory diagrams of operation states of the second tree data totaling method.

図49に示されるように、第2のツリーデータ集計方法は、図45に示された第1のツリーデータ集計方法と類似した動作を実行するが、次元を定義しないため、次元についての処理は省略され、また、部分ツリー毎の集計結果を統合する処理も省かれている。   As shown in FIG. 49, the second tree data tabulation method performs an operation similar to that of the first tree data tabulation method shown in FIG. 45, but does not define a dimension. Omitted, and the process of integrating the total results for each partial tree is also omitted.

システム10は、頂点ノードリストから頂点ノードを取り出し、その部分ツリーを特定することにより(図49のステップ4902、ステップ4903)、図50A、B及びCに示されるような部分ツリー1、部分ツリー2及び部分ツリー3を特定し、それぞれの部分ツリーについて、重量の件数と重量の合計を算出する(ステップ4906)。図50Dには、頂点ノード毎の集計結果が示されている。   The system 10 extracts the vertex node from the vertex node list and specifies the partial tree (step 4902 and step 4903 in FIG. 49), thereby the partial tree 1 and the partial tree 2 as shown in FIGS. 50A, B, and C. The partial tree 3 is specified, and the number of weights and the total weight are calculated for each partial tree (step 4906). FIG. 50D shows the total result for each vertex node.

上記の説明では、頂点ノードによって代表される部分ツリーを特定する際に、すべての子孫ノードを特定しているが、例えば、例えば、子ノードまで、孫ノードまでのように、子孫の世代数を限定することによって集計範囲を限定することも可能である。   In the above description, when the partial tree represented by the vertex node is specified, all the descendant nodes are specified. For example, the generation number of the descendants is set up to, for example, the child node and the grandchild node. It is also possible to limit the total range by limiting.

また、上記の例では、ノード間の親子関係が深さ優先モードで表現されているが、幅優先モードで表現し、そこから部分ツリーを特定しても構わない。   In the above example, the parent-child relationship between the nodes is expressed in the depth priority mode. However, the partial tree may be specified from the depth priority mode.

[ツリーデータソートの概要]
本発明にかかるツリーデータのソート処理は、記憶装置に展開されたルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータの少なくとも二つのノード群(ノードの集まり、例えば、部分ツリー)に順序を付ける処理である。以下では、簡単のため、ノード群が部分ツリーである場合について説明する。
[Overview of tree data sorting]
The tree data sorting process according to the present invention includes a root node developed in a storage device and at least two node groups of tree-type data structure data including a non-root node that is a node other than the root node (nodes of nodes). This is a process of ordering a collection (for example, a partial tree). Hereinafter, for the sake of simplicity, the case where the node group is a partial tree will be described.

本発明のツリーデータのソート処理は、個々の部分ツリーに関連付けられたある指標(比較基準値)を収集し、次に、この指標に順序関係を付けることにより、部分ツリー自体に順序を付けることにより実現される。   The sorting process of the tree data of the present invention collects a certain index (comparison reference value) associated with each partial tree, and then orders the partial tree itself by assigning an order relation to this index. It is realized by.

ソート処理は、指標の収集の仕方によって二通りに大別できる。第1のツリーデータソート方法は、集計の結果を利用する方法である。例えば、上記の第2のツリーデータ集計方法では、部分ツリー毎に集計結果が収集されている。したがって、例えば、図50A〜Dの例において、部分ツリー1〜3を「重量の件数」の多い順に並べることが要求された場合、図50Dに示された「重量の件数」を指標として用いると、この指標の大小関係に応じて、部分ツリー1〜3に順序関係を定義することができ、すなわち、部分ツリー1〜3をソートすることができる。   Sort processing can be roughly divided into two types according to the way of collecting indicators. The first tree data sorting method is a method of using the result of aggregation. For example, in the second tree data tabulation method, the tabulation results are collected for each partial tree. Therefore, for example, in the example of FIGS. 50A to 50D, when it is requested to arrange the partial trees 1 to 3 in the descending order of the “number of weights”, the “number of weights” shown in FIG. 50D is used as an index. Depending on the magnitude relation of the 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.

これに対して、第2のツリーデータソート方法は、集計結果を利用するのではなく、部分ツリーのノードに関連付けられた情報をそのまま指標として利用して、部分ツリーに順序関係を定義する。第2のツリーデータソート方法は、例えば、図50A〜Dの例では、部分ツリーの中で、ノードタイプが「価格」であるノードのノード値、すなわち、「価格の値」の順に部分ツリーをソートする。   On the other hand, in the second tree data sorting method, the order relation is defined in the partial tree by using the information associated with the nodes of the partial tree as it is as an index instead of using the aggregation result. In the second tree data sorting method, for example, in the example of FIGS. 50A to 50D, node values of nodes whose node type is “price” in the partial tree, that is, the partial tree in the order of “price value”. Sort.

[第1のツリーデータソート]
本発明の一実施例にかかる第1のツリーデータソート方法は、例えば、図43Aに示されるようなツリー型データ構造のデータの頂点ノード1、頂点ノード6及び頂点ノード8でそれぞれ表される部分ツリー1(図50A)、部分ツリー2(図50B)及び部分ツリー3(図50C)を重量の件数を指標としてソートする。
[First tree data sort]
The first tree data sorting method according to an embodiment of the present invention is, for example, portions represented by vertex node 1, vertex node 6 and vertex node 8 of data having a tree-type data structure as shown in FIG. 43A. Tree 1 (FIG. 50A), partial tree 2 (FIG. 50B) and partial tree 3 (FIG. 50C) are sorted using the number of weights as an index.

コンピュータシステム10の記憶装置、例えば、RAM14には、ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータが展開されている。ノード間の親子関係は、図43Aに示されるように、ルート・ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノード識別子を付与し、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子を関連付けることにより表現されている。各ノードはデータの項目を表す項目名情報(例えば、ノードタイプ)とデータの項目値を表す項目値情報(例えば、ノード値)とが関連付けられ、各ノード群(例えば、部分ツリー1、部分ツリー2及び部分ツリー3)は当該ノード群を代表する頂点ノード(例えば、頂点ノード1、頂点ノード6及び頂点ノード8)及び当該頂点ノードの子孫ノードを含む。   In a storage device of the computer system 10, for example, the RAM 14, 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 is expanded. As shown in FIG. 43A, a parent-child relationship between nodes gives a unique node identifier to all nodes including a root node in preference to a child node over a node of the same generation. This is expressed by associating the node identifier assigned to each parent node of the non-root node with the assigned node identifier. 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, partial tree) 2 and the partial tree 3) include a vertex node 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.

コンピュータシステム10は、集計の対象を表す項目名情報(例えば、ノードタイプ=「重量」)を指定し、集計の範囲を表す少なくとも二つの頂点ノード(例えば、頂点ノード1、頂点ノード6及び頂点ノード8を含む頂点ノードリストを指定する。集計の対象、及び、集計の範囲は、例えば、ユーザがコンピュータシステム10の入力装置24を介して入力してもよく、又は、外部記憶媒体18から読み出してもよく、或いは、I/F22を介して外部から設定してもよい。   The computer system 10 designates item name information (for example, node type = “weight”) that represents an aggregation target, and at least two vertex nodes (for example, vertex node 1, vertex node 6, and vertex node) that represent the aggregation range A vertex node list including 8 is specified, for example, 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 or read from the external storage medium 18. Alternatively, it may be set from the outside via the I / F 22.

次に、コンピュータシステム10は、各頂点ノードについて、前記ノード間の親子関係を辿って当該頂点ノードの子孫ノードを特定し、当該頂点ノード又は当該頂点ノードの子孫ノードに関連付けられた項目名情報が集計の対象と一致するかどうかを判定し、一致したノードに関連付けられた項目値情報を集計する。この集計は、例えば、図49および図50A〜Dを参照して説明した上記の第2のツリーデータ集計方法を実行する。図51A〜Cは、本発明の一実施例にかかる第1のツリーデータソート方法の説明図であり、図51Aには、第2のツリーデータ集計方法を実行することにより得られた比較基準値の収集結果が示されている。本例では、頂点ノード毎の重量の件数が比較基準値の収集結果である。   Next, the computer system 10 identifies the descendant node of the vertex node by tracing the parent-child relationship between the nodes for each vertex node, and the item name information associated with the vertex node or the descendant node of the vertex node is It is determined whether or not it matches the target of tabulation, and item value information associated with the matching node is tabulated. This aggregation is performed by, for example, the second tree data aggregation method described above with reference to FIGS. 49 and 50A to 50D. 51A to 51C are explanatory diagrams of a first tree data sorting method according to an embodiment of the present invention. FIG. 51A shows a comparison reference value obtained by executing the second tree data totaling method. The collection results are shown. In this example, the number of weights per vertex node is the result of collecting comparison reference values.

次に、コンピュータシステム10は、頂点ノード毎に集計された項目値情報の順序関係に従って当該少なくとも二つの頂点ノードに順序を付けることにより、当該頂点ノードによって代表されるノード群に順序を付ける。本例では、頂点ノード1に対応する重量の件数である2と、頂点ノード6に対応する重量の件数である1と、頂点ノード8に対応する重量の件数である2を、昇順に並べ換えることにより、頂点ノードに順序が付けられる。この順序付けにより、頂点ノードは、頂点ノード6、頂点ノード1、頂点ノード8の順に並べられる。例えば、比較基準値が一致する場合には、元の頂点ノードの順番を保存して頂点ノードの順序付けを行う。図51Bは、このようにして得られた比較基準値のソート結果である。頂点ノードに順序を付けることにより、図51Cに示されるように、これらの頂点ノードによって代表される部分ツリーに順序を付けることができる。   Next, the computer system 10 orders the node groups represented by the vertex nodes by ordering the at least two vertex nodes according to the order relation of the item value information collected for each vertex node. In this example, 2 which is the number of weights corresponding to the vertex node 1, 1 which is the number of weights corresponding to the vertex node 6, and 2 which is the number of weights corresponding to the vertex node 8 are rearranged in ascending order. As a result, the vertex nodes are ordered. By this ordering, the vertex nodes are arranged in the order of vertex node 6, vertex node 1, and vertex node 8. For example, when the comparison reference values match, the order of the vertex nodes is performed by storing the order of the original vertex nodes. FIG. 51B shows the sorting result of the comparison reference values obtained in this way. By ordering the vertex nodes, the partial tree represented by these vertex nodes can be ordered as shown in FIG. 51C.

上記の説明では、頂点ノードによって代表される部分ツリーを特定する際に、すべての子孫ノードを特定しているが、例えば、例えば、子ノードまで、孫ノードまでのように、子孫の世代数を限定することによって集計範囲を限定することも可能である。   In the above description, when the partial tree represented by the vertex node is specified, all the descendant nodes are specified. For example, the generation number of the descendants is set up to, for example, the child node and the grandchild node. It is also possible to limit the total range by limiting.

また、上記の例では、ノード間の親子関係が深さ優先モードで表現されているが、幅優先モードで表現し、そこから部分ツリーを特定しても構わない。   In the above example, the parent-child relationship between the nodes is expressed in the depth priority mode. However, the partial tree may be specified from the depth priority mode.

[第2のツリーデータソート]
次に、本発明の一実施例にかかる第2のツリーデータソート方法について説明する。図52A〜Cは、本発明の一実施例にかかる第2のツリーデータソート方法の処理の対象となるツリー型データ構造及びノードの親子関係の「子→親」表現(図52A)と、ノードタイプ毎のノード値のリスト(図52B)と、ノードに関連付けられたノードタイプ及びノード値(図52C)と、を説明する図である。頂点ノードは黒塗りの星印(★)で示されている。本例では、各ノードの項目名情報であるノードタイプは、シンボル番号(=Symbol No.)によって表される。図形とシンボル番号との対応関係は、図43Bに示されている。
[Second tree data sort]
Next, a second tree data sorting method according to an embodiment of the present invention will be described. FIGS. 52A to 52C show a “child-to-parent” representation (FIG. 52A) of a tree-type data structure and a parent-child relationship of nodes to be processed by the second tree data sorting method according to an embodiment of the present invention, and nodes FIG. 52 is a diagram for describing a list of node values for each type (FIG. 52B), and node types and node values (FIG. 52C) associated with the nodes. The vertex node is indicated by a black star (★). In this example, the node type which is item name information of each node is represented by a symbol number (= Symbol No.). The correspondence between the figure and the symbol number is shown in FIG. 43B.

本例では、各ノードの項目値情報であるノード値は、シンボル番号と値番号(=VNo)を組み合わせて表される。シンボル番号毎に、すなわち、ノードタイプ毎に、そのノードタイプが表す項目の値が昇順(又は降順)に配置された値リスト(=VL)が設けられる。値番号は、値リストへのポインタであり、例えば、ノードxにシンボル番号iと値番号jが関連付けられている場合、ノードxのノード値は、シンボル番号iに固有の値リストのj番目の要素を参照することによって取得できる(例えば、先頭の要素が0番目の要素であるとする)。このような値番号と値リストの組み合わせによって実際の値を指定する方式は、本願発明者によって提案されている(例えば、国際公開第WO00/10103号パンフレットを参照のこと)。   In this example, the node value that is item value information of each node is represented by a combination of a symbol number and a value number (= VNo). For each symbol number, that is, for each node type, a value list (= VL) is provided in which values of items represented by the node type are arranged in ascending order (or descending order). The value number is a pointer to the value list. For example, when the symbol number i and the value number j are associated with the node x, the node value of the node x is the j-th value in the value list unique to the symbol number i. It can be obtained by referring to the element (for example, the first element is the 0th element). A method for designating an actual value by such a combination of a value number and a value list has been proposed by the present inventor (see, for example, International Publication No. WO00 / 10103 pamphlet).

例えば、図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に対応した要素は「200」である。このようにして、ノード4に関連付けられたノード値が取得される。   For example, in the tree data shown in FIGS. 52A to 52C, the partial trees represented by the vertex node 1, the vertex node 6, and the vertex node 8 are the partial tree 1, the partial tree 2, and the partial tree 3, respectively. In order to refer to the value of the price belonging to each partial tree, first, among the nodes belonging to each partial tree, the node associated with the node type = “price” is identified, and then the identified node It is necessary to refer to the node value associated with. Node 1, node 2, node 3, node 4, and node 5 belong to the partial tree 1. Among these nodes, the symbol number = “2” is associated with the node whose node type is “price”. In the example shown in the figure, the node 4 is associated with symbol number = “2”. Therefore, node 4 has node type = “price”. Next, in order to refer to the value of the price of the node 4, first, referring to the value number associated with the node 4, the value number = “3”. Therefore, the node value associated with the node 4 is a value list corresponding to the symbol number = “2”, that is, an element corresponding to the value number 3 of the (price) VL (that is, the fourth element from the top). . In this example, the element corresponding to the value number 3 of (price) VL is “200”. In this way, the node value associated with the node 4 is acquired.

コンピュータシステム10の記憶装置、例えば、RAM14には、図52A〜Cに示されるように、ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータが展開されている。ノード間の親子関係は、ルート・ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノード識別子を付与し、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子を関連付けることにより定義される。各ノードはデータを表す少なくとも一つの実体情報が関連付けられ、各ノード群は当該ノード群を代表する頂点ノードである特定のノード及び当該特定のノードの子孫ノードを含む。   As shown in FIGS. 52A to 52C, a storage device of the computer system 10, for example, the RAM 14 is expanded with 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. ing. In the parent-child relationship between nodes, 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 non-root node identifier is assigned to each non-root node. Defined by associating a node identifier assigned to each parent node of the node. Each node is associated with at least one entity information representing data, and each node group includes a specific node that is a vertex node representing the node group and descendant nodes of the specific node.

次に、コンピュータシステム10は、順序付けの対象となる少なくとも二つのノード群を表す頂点ノードを指定し、順序付けの指標となる項目名情報を指定する順序付けの対象(例えば、頂点ノードリスト)、及び、順序付けの指標(例えば、ノードタイプ)は、例えば、ユーザがコンピュータシステム10の入力装置24を介して入力してもよく、又は、外部記憶媒体18から読み出してもよく、或いは、I/F22を介して外部から設定してもよい。   Next, the computer system 10 designates vertex nodes representing at least two node groups to be ordered, and designates ordering targets (for example, a vertex node list) for specifying item name information serving as an index for ordering, and The ordering index (eg, node type) 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 via the I / F 22, for example. May be set externally.

次に、コンピュータシステム10は、各頂点ノードについて、前記ノード間の親子関係を辿って当該頂点ノードの子孫ノードを特定し、当該頂点ノード又は当該頂点ノードの子孫ノードの中で、順序付けの指標となる項目名情報が関連付けられたノードに関連付けられた項目値情報を取得する。図52A〜Cの例では、上記の方法でノード値を取得すればよい。   Next, for each vertex node, the computer system 10 traces the parent-child relationship between the nodes to identify the descendant node of the vertex node, and within 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 is acquired. In the example of FIGS. 52A to 52C, the node value may be acquired by the above method.

さらに、コンピュータシステム10は、頂点ノード毎に取得された項目値情報の順序関係(例えば、取得されたノード値の大小関係)に従って当該少なくとも二つの頂点ノードに順序を付けることにより、当該頂点ノードによって代表されるノード群(例えば、部分ツリー)に順序を付ける。   Furthermore, the computer system 10 assigns an order to the at least two vertex nodes according to the order relationship of the item value information acquired for each vertex node (for example, the magnitude relationship of the acquired node values), thereby An order is given to a representative node group (for example, a partial tree).

次に、ノード値の取得と部分ツリーの順序付けについてより詳細に説明する。図53は、本発明の一実施例にかかる第2のツリーデータソート方法のフローチャートである。コンピュータシステム10は、頂点ノードリスト及び指標を指定し(ステップ5301)、作業用領域を初期化する(ステップ5302)。続いて、コンピュータシステム10は、頂点ノードリスト(=[1,6,8])の各頂点ノードについて、順序付けの指標値(=価格の値)に対応した値番号を取得する(ステップ5303)。続いて、コンピュータシステム10は、各頂点ノードについて取得された値番号の出現回数をカウントし(ステップ5304)、さらに、値番号毎にカウントされた出現回数を累計数化する(ステップ5305)。最後に、コンピュータシステム10は、頂点ノードリスト中の各頂点ノードを、累計数に基づいて、各頂点ノードに対応した値番号の順番にソートする(ステップ5306)。尚、値番号の順序(昇順又は降順)はソートの順番に対応している。   Next, node value acquisition and partial tree ordering will be described in more detail. FIG. 53 is a flowchart of the second tree data sorting method according to an embodiment of the present invention. The computer system 10 designates the vertex node list and the index (step 5301), and initializes the work area (step 5302). Subsequently, the computer system 10 acquires a value number corresponding to the index value (= price value) for ordering for each vertex node in the vertex node list (= [1, 6, 8]) (step 5303). Subsequently, the computer system 10 counts the number of appearances of the value number acquired for each vertex node (step 5304), and further accumulates the number of appearances counted for each value number (step 5305). Finally, 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 value numbers (ascending order or descending order) corresponds to the order of sorting.

図54乃至62は、図52A〜Cに示されたツリー型データ構造のデータに本発明の一実施例にかかる第2のツリーデータソート方法を適用したときの動作状態を説明する図である。   54 to 62 are diagrams for explaining an operation state when the second tree data sorting method according to the embodiment of the present invention is applied to the data having the tree-type data structure shown in FIGS.

コンピュータシステム10は、図54に示されるように、ソート前頂点ノードリスト=[1,6,8]を指定し(ステップ5301)、このソート前頂点ノードリストと同じサイズの一時的値番号格納領域Tmp−VNo、及び、ソート後頂点ノードリスト格納領域を用意し、また、価格の値リストVLと同じサイズのカウント領域Countを用意する(ステップ5302)。   As shown in FIG. 54, the computer system 10 designates the pre-sort vertex node list = [1, 6, 8] (step 5301), and the temporary value number storage area having the same size as this pre-sort vertex node list. A 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).

次に、コンピュータシステム10は、図55に示されるように、頂点ノードリストから1番目の頂点ノード1を取り出し、頂点ノード1に対応した部分ツリーを特定する(図55の※1)。次に、コンピュータシステム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)。これにより、コンピュータシステム10は頂点ノードに関連した値番号を取得できる(ステップ5303)。   Next, as shown in FIG. 55, 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 (* 1 in FIG. 55). Next, the computer system 10 identifies the node having the symbol number = 2 in the partial tree (that is, the node whose node type is “price”), and the value number VNo associated with the identified node. Is stored in the first area of Tmp-VNo (* 2 in FIG. 55). Next, as shown in FIG. 56, the computer system 10 takes out the second vertex node 6 from the vertex node list and specifies the partial tree corresponding to the vertex node 6 (* 1 in FIG. 56). Next, the computer system 10 identifies the node having the symbol number = 2 in the partial tree (that is, the node whose node type is “price”), and the value number VNo associated with the identified node. Is stored in the second area of Tmp-VNo (* 2 in FIG. 56). Next, as shown in FIG. 57, the computer system 10 extracts the third vertex node 8 from the vertex node list, and specifies a partial tree corresponding to the vertex node 8 (* 1 in FIG. 57). Next, the computer system 10 identifies the node having the symbol number = 2 in the partial tree (that is, the node whose node type is “price”), and the value number VNo associated with the identified node. Is stored in the third area of Tmp-VNo (* 2 in FIG. 57). Thereby, the computer system 10 can acquire the value number associated with the vertex node (step 5303).

コンピュータシステム10は、次に、頂点ノードリストに対応したTmp−VNoに格納された値番号の出現回数(存在数)をカウントする(ステップ5304)。図58に示されるように、頂点ノードリストの先頭の要素=頂点ノード1に対応したTmp−VNoの要素Tmp−VNo[0]が「3」であるため、値番号=3に対応したカウント領域の要素Count[3]をインクリメントし、同様に、Tmp−VNo[1]=2であるため、Count[2]をインクリメントし、Tmp−VNo[2]=1であるため、Count[1]をインクリメントする。これにより、図58の完成したCountが得られる。   Next, 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). As shown in FIG. 58, since the element Tmp-VNo [0] of Tmp-VNo corresponding to the top element = vertex node 1 of the vertex node list is “3”, the count area corresponding to value number = 3 Similarly, since Tmp-VNo [1] = 2, Tcount- [2] is incremented because Tmp-VNo [1] = 2, and since Tmp-VNo [2] = 1, Count [1] is changed. Increment. Thereby, the completed Count of FIG. 58 is obtained.

コンピュータシステム10は、次に、Countの要素を累計して、カウント配列Countを累計数配列Aggrに変換する(ステップ5305)。図59に示されるように、カウント配列Countが、
Count[0]=0
Count[1]=1
Count[2]=1
Count[3]=1
であるので、累計数配列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[1])であり、値番号2の先頭の位置はアドレス1(=Aggr[2])であり、値番号3の先頭の位置はアドレス2(=Aggr[3])である。このようにして、図59に示されるように、累計数配列Aggrが得られる。この累計数配列Aggrは、ソート後頂点ノードリストの格納位置を示すポインタの配列であるとみなすことができる。
Next, the computer system 10 accumulates the count elements and converts the count array Count into the accumulated number array Aggr (step 5305). As shown in FIG. 59, the count array Count is
Count [0] = 0
Count [1] = 1
Count [2] = 1
Count [3] = 1
Therefore, the elements of the cumulative number array Aggr are
Aggr [0] = 0
Aggr [1] = Count [0] = 0
Aggr [2] = Count [0] + Count [1] = 1
Aggr [3] = Count [0] + Count [1] + Count [2] = 2
It becomes. For convenience of explanation, the count array Count and the cumulative number array Aggr are distinguished from each other. However, physically, the count array count and the cumulative number array Aggr may be the same region. The cumulative number array Aggr obtained in this way is arranged when the value numbers acquired in step 5303 are arranged in ascending order (when there are two or more same value numbers, the number is duplicated) , Indicates the start position of each value number. In this example, value number = 3, value number = 2, and value number = 1 appear once, so if these value numbers are arranged in ascending order,
Value number = 1
Value number = 2
Value number = 3
It becomes the order. At this time, since value number = 0 does not exist, the leading position of value number = 0 in the ascending order array of value numbers is address 0 (= Aggr [0]), and the leading position of value number = 1 is address 0. (= Aggr [1]), the leading position of value number 2 is address 1 (= Aggr [2]), and the leading position of value number 3 is address 2 (= Aggr [3]). In this way, as shown in FIG. 59, a cumulative number array Aggr is obtained. This cumulative number array Aggr can be regarded as an array of pointers indicating the storage position of the sorted vertex node list.

最後に、コンピュータシステム10は、累計数配列Aggrを利用して、頂点ノードリスト中の頂点ノードを、その頂点ノードに関連付けられた値番号の順に並べ換える(ステップ5306)。   Finally, the computer system 10 uses the cumulative number array Aggr to rearrange the vertex nodes in the vertex node list in the order of the value numbers associated with the vertex nodes (step 5306).

コンピュータシステム10は、図60に示されるように、頂点ノードリストから1番目の要素であるソート前頂点ノードリスト[0]=頂点ノード1を取り出し、頂点ノード1に対応したTmp−VNo[0]=3が指し示す累計数配列Aggrの要素であるAggr[3]=2によって示されるソート後頂点ノードリストの要素、すなわち、ソート後頂点ノードリスト[2]に、ソート前頂点ノードリスト[0]=1をセットする。そして、Aggr[3]をインクリメントする。このインクリメントによって、ソート後頂点ノードリストの格納位置を示すポインタが次の位置へ移動するので、値番号が重複している場合でも、正しく頂点ノードリストをソートすることができる。   As illustrated in FIG. 60, the computer system 10 extracts the pre-sort vertex node list [0] = vertex node 1 which is the first element from the vertex node list, and Tmp-VNo [0] corresponding to the vertex node 1. = 3 indicates an element of the sorted vertex node list indicated by Aggr [3] = 2, which is an element of the cumulative number array Aggr, that is, the sorted vertex node list [2] includes the pre-sorted vertex node list [0] = Set 1 Then, Aggr [3] is incremented. By this increment, the pointer indicating the storage position of the sorted vertex node list is moved to the next position, so that even when the value numbers are duplicated, the vertex node list can be correctly sorted.

コンピュータシステム10は、図61に示されるように、ソート前頂点ノードリストの要素であるソート前頂点ノードリスト[1]=6に対しても同様に、頂点ノード6に対応したTmp−VNo[1]=2が指し示す累計数配列Aggrの要素であるAggr[2]=1によって示されるソート後頂点ノードリストの要素、すなわち、ソート後頂点ノードリスト[1]に、ソート前頂点ノードリスト[1]=6をセットする。そして、Aggr[2]をインクリメントする。   As shown in FIG. 61, the computer system 10 similarly applies Tmp-VNo [1 corresponding to the vertex node 6 to the vertex node list before sorting [1] = 6 which is an element of the vertex node list before sorting. ] = 2 indicates an element of the sorted vertex node list indicated by Aggr [2] = 1, which is an element of the cumulative number array Aggr indicated by [2], that is, the sorted vertex node list [1] includes the pre-sorted vertex node list [1]. = 6 is set. Then, Aggr [2] is incremented.

さらに、コンピュータシステム10は、図62Aに示されるように、ソート前頂点ノードリストの要素であるソート前頂点ノードリスト[3]=8に対しても同様に、頂点ノード8に対応したTmp−VNo[2]=1が指し示す累計数配列Aggrの要素であるAggr[1]=0によって示されるソート後頂点ノードリストの要素、すなわち、ソート後頂点ノードリスト[0]に、ソート前頂点ノードリスト[2]=8をセットする。そして、Aggr[1]をインクリメントする。   Further, as shown in FIG. 62A, the computer system 10 similarly applies Tmp-VNo corresponding to the vertex node 8 to the pre-sort vertex node list [3] = 8 which is an element of the pre-sort vertex node list. [2] = 1 The element of the sorted vertex node list indicated by Aggr [1] = 0, which is an element of the cumulative number array Aggr indicated by 1, that is, the sorted vertex node list [0] is added to the sorted vertex node list [0]. 2] = 8 is set. Then, Aggr [1] is incremented.

以上の処理により、コンピュータシステム10は、図62Bに示されるように、ソート前頂点ノードリストを、価格で昇順にソートすることにより、ソート後頂点ノードリストに変換することができる。   Through the above processing, the computer system 10 can convert the pre-sort vertex node list into the post-sort vertex node list by sorting the pre-sort vertex node list in ascending order by price as shown in FIG. 62B.

尚、以上の説明では、ある項目名情報(例えば、あるノードタイプ)の値がソートの指標として指定されたときに、一つの部分ツリーには、その項目名情報が関連付けられているノードが一つである例に関して第2のツリーデータソートを記述しているが、一つの部分ツリー内に、指標としてヒットするノードが2個以上存在する場合がある。その場合には、ソートの目的や仕様等のアプリケーションに応じて一つのノードを選択する。また、一つの部分ツリー内に、指標としてヒットするノードが存在しない場合、その部分ツリーは、アプリケーションに応じて、ソートの対象から外す、又は、最下位の順番を付与する、などの取扱をすることができる。   In the above description, when the value of a certain item name information (for example, a certain node type) is designated as a sorting index, one partial tree has one node associated with the item name information. Although the second tree data sort is described with respect to an example that is one, there may be two or more nodes that hit as an index in one partial tree. In this case, one node is selected according to the sort purpose and application. In addition, 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 giving the lowest order according to the application. be able to.

さらに、上記の説明では、頂点ノードによって代表される部分ツリーを特定する際に、すべての子孫ノードを特定しているが、例えば、例えば、子ノードまで、孫ノードまでのように、子孫の世代数を限定することによって集計範囲を限定することも可能である。   Furthermore, in the above description, when the partial tree represented by the vertex node is specified, all the descendant nodes are specified. For example, the generation of the descendant, such as the child node and the grandchild node, is specified. It is also possible to limit the counting range by limiting the number.

また、上記の例では、ノード間の親子関係が深さ優先モードで表現されているが、幅優先モードで表現し、そこから部分ツリーを特定しても構わない。   In the above example, the parent-child relationship between the nodes is expressed in the depth priority mode. However, the partial tree may be specified from the depth priority mode.

[ツリー群への拡張]
ここまでの説明では、ツリー型データ構造のデータの検索、集計及びソートは、ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含む一つのツリーデータを処理の対象としている。しかし、実際的なアプリケーションでは、ツリー型データ構造のデータは、複数のツリーデータにより構成される場合がある。このような場合には、各ツリーデータは、ツリー識別子が付与され、このツリー識別子によって区別される。そして、本発明は、各ツリーデータに対して、上記のツリー型データ構造のデータの検索、集計及びソートの方法を実施することにより、複数のツリーデータを含むツリー型データ構造のデータにも適用可能である。
[Extension to tree group]
In the description so far, retrieval, aggregation, and sorting of data having a tree-type data structure are targeted for processing one tree data including a root node and a non-root node that is a node other than the root node. However, in a practical application, data having a tree-type data structure may be composed of a plurality of tree data. In such a case, each tree data is given a tree identifier and is distinguished by this tree identifier. The present invention is also applied to data of a tree type data structure including a plurality of tree data by performing the above-described tree type data structure data search, aggregation and sorting method for each tree data. Is possible.

図63A〜Eは、複数のツリーデータにより構成されたツリー型データ構造のデータ、すなわち、ツリー群の一例を示す図である。同図の例では、ある製品の生産するために必要な部品の仕入れに関する情報(仕入先、メーカ、品番、重量、価格など)がツリー型データ構造のデータとして表されている。さらに、その部品には、複数の代替品と複数の仕入先があるため、入手ルート毎に別個のツリーデータが準備されている。各ノードは、そのノードに関連付けられた項目名情報(すなわち、ノードタイプ)と項目値情報(すなわち、ノード値)を用いて、(ノードタイプ、ノード値)の形で表されている。   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. In the example shown in the drawing, information (partner, manufacturer, product number, weight, price, etc.) related to purchasing parts necessary for producing a certain product is represented as data of a tree-type data structure. Furthermore, since there are a plurality of substitutes and a plurality of suppliers for the parts, separate tree data is prepared for each acquisition route. 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 the node.

図63Aのデータは、ツリー識別子がツリーデータ1であり、ルート・ノードが(品番、1)であり、ルート・ノードの子ノードとして、ノード(メーカ、A)、ノード(重量、10)、ノード(価格、5000)、ノード(仕入先、α)が存在する。図63AからEに示されるように、各ツリーデータは構造が異なっていても構わない。また、図63Eに示されたツリーデータ5は、ノードタイプ=メーカに対応したノードを含まない。   In the data of FIG. 63A, the tree identifier is tree data 1, the root node is (part number, 1), and the child nodes of the root node are node (manufacturer, A), node (weight, 10), node (Price, 5000) and node (supplier, α) exist. As shown in FIGS. 63A to 63E, the tree data may have different structures. Also, the tree data 5 shown in FIG. 63E does not include a node corresponding to node type = maker.

このようなツリー型データ構造のデータに対しても、検索、集計、ソートを行うことが可能である。検索、集計、ソートは、ツリーデータ毎に個別に行われ、その後、検索、集計、ソートの結果が統合される。統合された結果は、ツリーデータ識別子を介して、各ツリーデータと関連付けられる。本例では、各ツリーデータのルート・ノードは頂点ノードである。   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. In this example, the root node of each tree data is a vertex node.

例えば、項目名情報=「メーカ」であるパス条件による検索を実行すると、ツリーデータ1の頂点ノード、ツリーデータ2の頂点ノード、ツリーデータ3の頂点ノード、及び、ツリーデータ4の頂点ノードが検索にヒットする。しかし、ツリーデータ5の頂点ノードは検索にヒットしない。なぜならば、ツリーデータ5には、項目名情報=「メーカ」に関連付けられたノードが存在しないからである。この検索の結果は、ツリーデータのツリーデータ識別子と頂点ノードのノード識別子の組の集合により表現される。検索にヒットしたノードそのものを検索結果とする場合も同様に、ツリーデータ識別子とノード識別子の組の集合により検索結果が表現される。   For example, when a search is performed based on a path condition in which item name information = “maker”, a vertex node of tree data 1, a vertex node of tree data 2, a vertex node of tree data 3, and a vertex node of tree data 4 are searched. To hit. However, the vertex node of the tree data 5 does not hit the search. This is because the tree data 5 has no node associated with item name information = “maker”. 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. Similarly, when a search result is a node that has been hit, the search result is expressed by a set of a set of a tree data identifier and a node identifier.

また、項目名情報=「価格」、項目値情報≦4200であるノードを検索する項目値検索を行うことが可能である。頂点ノードを検索結果として返却する場合、この検索条件を満たす頂点ノードは、ツリーデータ3の頂点ノード、ツリーデータ4の頂点ノード、ツリーデータ5の頂点ノードである。同様に、項目名情報=「重量」であり、項目値情報≦12であるノードを検索する項目値検索を実行すると、この検索にヒットする頂点ノードは、ツリーデータ1の頂点ノード、ツリーデータ2の頂点ノード、ツリーデータ3の頂点ノードである。   Further, it is possible to perform an item value search for searching for a node having item name information = “price” and item value information ≦ 4200. When a vertex node is returned as a search result, the vertex nodes that satisfy this search condition are the vertex node of the tree data 3, the vertex node of the tree data 4, and the vertex node of the tree data 5. Similarly, when an item value search for searching for a node having item name information = “weight” and item value information ≦ 12 is executed, the vertex nodes that hit this search are the vertex node of tree data 1 and tree data 2. Of the tree data 3.

次に、検索条件1=「項目名情報=「価格」、項目値情報≦4200」と検索条件2=「項目名情報=「重量」、項目値情報≦12」を満たす頂点ノードを検索すると、価格の値が4200以下のノードと、重量の値が12以下のノードの両方のノードを子孫ノードとして含む頂点ノードは、ツリーデータ3の頂点ノードであることがわかる。一方、このAND検索の結果は、検索条件1の検索結果=「ツリーデータ3の頂点ノード、ツリーデータ4の頂点ノード、ツリーデータ5の頂点ノード」と、検索条件2の検索結果=「ツリーデータ1の頂点ノード、ツリーデータ2の頂点ノード、ツリーデータ3の頂点ノード」との間の論理積演算の結果と一致している。   Next, when searching for a vertex node satisfying search condition 1 = “item name information =“ price ”, item value information ≦ 4200” and search condition 2 = “item name information =“ weight ”, item value information ≦ 12”, It can be seen that a vertex node including both nodes having a price value of 4200 or less and a weight value of 12 or less as descendant nodes is a vertex node of the tree data 3. On the other hand, the AND search results are as follows: search result of search condition 1 = “vertex node of tree data 3, vertex node of tree data 4, vertex node of tree data 5” and search result of search condition 2 = “tree data 1 coincides with the result of the logical AND operation between the vertex node 1, the vertex node of the tree data 2, and the vertex node of the tree data 3.

さらに、「仕入先毎の件数」や「重量毎の価格平均」などの集計を行うことが可能である。このような集計は、上記の本発明の第1のノードデータ集計方法において、集計の範囲を表す頂点ノードリストの要素がツリーデータ識別子とノード識別子の組によって特定されるように拡張することによって実現できる。   Furthermore, it is possible to perform tabulation such as “number of cases per supplier” and “price average per weight”. Such tabulation is realized by expanding the elements of the vertex node list representing the tabulation range to be specified by the combination of the tree data identifier and the node identifier in the first node data tabulation method of the present invention described above. it can.

最後に、「低価格順」のようなソートも、上記の本発明の第1のツリーデータソート方法或いは第2のツリーデータソート方法において、頂点ノードリストの要素がツリーデータ識別子とノード識別子の組によって特定されるように拡張することによって実現できる。   Finally, the sort such as “low price order” is also performed in the first tree data sorting method or the second tree data sorting method of the present invention described above, where the vertex node list element is a set of a tree data identifier and a node identifier. It can be realized by extending as specified by.

以上のように、本発明は、ノードをツリーデータ識別子とノード識別子の組によって識別し、各ツリーデータに対して、ツリー型データ構造のデータの検索、集計及びソートの方法を実施することにより、複数のツリーデータを含むツリー型データ構造のデータにも拡張できる。   As described above, the present invention identifies a node by a set of a tree data identifier and a node identifier, and performs a method of searching, totaling, and sorting data of a tree-type data structure for each tree data. The data can be extended to a tree-type data structure including a plurality of tree data.

[情報処理装置]
図64は、本発明の一実施例によるツリー型データ構造のデータを処理する情報処理装置6400のブロック図である。情報処理装置6400は、ツリー型データ構造を表現するデータを記憶する記憶部6401と、ツリー型データ構造のデータを記憶部6401上に展開するデータ展開部6402と、ツリーデータ処理のための条件を設定する条件指定部6403と、条件指定部6403によって設定された条件に従って記憶部6401上に展開されたデータを処理するツリーデータ処理部6404と、を含む。
[Information processing device]
FIG. 64 is a block diagram of an information processing apparatus 6400 that processes data having a tree-type data structure according to an embodiment of the present invention. The information processing apparatus 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 6401, and conditions for tree data processing. A condition specifying unit 6403 to be set, and a tree data processing unit 6404 for processing the data expanded on the storage unit 6401 in accordance with the conditions set by the condition specifying unit 6403 are included.

ツリーデータ処理部6404は、ツリーデータ検索を実行する検索部6405と、ツリーデータ集計を実行する集計部6406と、ツリーデータソートのための指標を取得する指標取得部6408と、集計部6406からの集計結果又は指標取得部6408からの指標を受け取って、ツリーデータソートを実行する順序付け部6407と、を含む。   The tree data processing unit 6404 includes a search unit 6405 that executes tree data search, a total unit 6406 that executes tree data totaling, an index acquisition unit 6408 that acquires an index for sorting tree data, and a totaling unit 6406. An ordering unit 6407 that receives the aggregation result or the index from the index acquisition unit 6408 and executes tree data sorting.

記憶部6401は、ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを記憶する。データ展開部6402は、ルート・ノードを含む全ノードに固有のノード識別子を付与し、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係を表現し、各ノードにデータを表す少なくとも一つの実体情報を関連付け、ツリー型データ構造を記憶装置上に構築する。データ展開部6402は、ルート・ノードを含む全ノードに同じ世代のノードよりも子ノードを優先して固有のノード識別子を付与してもよい。   The storage unit 6401 stores 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. The data expansion unit 6402 assigns a unique node identifier to all nodes including the root node, and 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. Thus, a parent-child relationship between nodes constituting the tree-type data structure is expressed, and at least one entity information representing 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 nodes including the root node in preference to the child nodes over the same generation nodes.

条件指定部6403は、検索、集計、ソートの目的に応じて各種の条件を設定する。これらの条件は、ユーザによって図示されないユーザ・インタフェース装置を介して指定され、或いは、外部装置から取り込まれる。各種の条件には、少なくとも一つの実体情報に関する検索条件、検索範囲を表す少なくとも一つの部分ツリー、集計の対象を表す項目名情報、集計の範囲を表す少なくとも一つの部分ツリー、順序付けの対象となる少なくとも二つのノード群を表す頂点ノード、或いは、順序付けの指標となる項目名情報などが含まれる。   The condition designation unit 6403 sets various conditions according to the purpose of search, aggregation, and sorting. These conditions are designated by a user via a user interface device (not shown) or are acquired from an external device. The various conditions include a search condition for at least one entity information, at least one partial tree that represents a search range, item name information that represents an aggregation target, at least one partial tree that represents an aggregation range, and an ordering target. Vertex nodes representing at least two node groups, or item name information serving as an index for ordering are included.

検索部6405は、各ノードについて、当該ノードに関連付けられた少なくとも一つの実体情報が前記検索条件と一致するかどうかを判定し、一致した場合に当該ノードに検索ヒット情報を関連付け、前記ノード間の親子関係を辿って当該ノードの祖先ノードに検索ヒット情報を関連付ける。また、検索部6405は、少なくとも一つの頂点ノードのうち検索ヒット情報が関連付けられた頂点ノードに付与されたノード識別子を検索結果として保存してもよい。或いは、検索部6405は、各頂点ノードについて、前記ノード間の親子関係を辿って当該頂点ノードの祖先ノードを特定し、当該頂点ノード及び/又は当該頂点ノードの祖先ノードに関連付けられた少なくとも一つの実体情報が前記検索条件と一致するかどうかを判定し、一致したノードに検索ヒット情報を関連付ける。   The search unit 6405 determines, for each node, whether or not at least one entity information associated with the node matches the search condition, 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 node by tracing the parent-child relationship. In addition, the search unit 6405 may store a node identifier assigned to a vertex node associated with search hit information among at least one vertex node as a search result. Alternatively, the search unit 6405 identifies the ancestor node of the vertex node by tracing the parent-child relationship between the nodes for each vertex node, and at least one associated with the vertex node and / 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.

他の一実施例では、検索部6405は、少なくとも一つの実体情報を指定する第1の検索条件に従って、前記ノード間の親子関係を辿って当該第1の検索条件に一致するノードが属するノード群を代表する頂点ノードに付与されたノード識別子を第1の検索結果として保存し、少なくとも一つの実体情報を指定する第2の検索条件に従って、前記ノード間の親子関係を辿って当該第1の検索条件に一致するノードが属するノード群を代表する頂点ノードに付与されたノード識別子を第2の検索結果として保存し、第1の検索条件と第2の検索条件の論理的な関係に対応した論理演算を第1の検索結果と第2の検索結果に実行することにより、第1の検索条件と第2の検索条件を論理的に組み合わせた検索結果を生成する。   In another embodiment, the search unit 6405 follows a parent-child relationship between the nodes according to a first search condition that specifies at least one entity information, and a group of nodes to which nodes that match the first search condition belong. Is stored as a first search result, and the first search is performed by tracing the parent-child relationship between the nodes according to a second search condition designating at least one entity information. The node identifier assigned to the vertex node representing the node group to which the node matching the condition belongs is stored as the second search result, and the logic corresponding to the logical relationship between the first search condition and the second search condition By executing an operation on the first search result and the second search result, a search result that logically combines the first search condition and the second search condition is generated.

集計部6406は、各頂点ノードについて、前記ノード間の親子関係を辿って当該頂点ノードの子孫ノードを特定し、当該頂点ノード及び/又は当該頂点ノードの子孫ノードに関連付けられた項目名情報が集計の対象と一致するかどうかを判定し、一致したノードに関連付けられた項目値情報を集計する。他の一実施例では、集計部6406は、各頂点ノードについて、前記ノード間の親子関係を辿って当該頂点ノードの子孫ノードを特定し、当該頂点ノード又は当該頂点ノードの子孫ノードに関連付けられた項目名情報が集計の対象を表す項目名情報と一致するかどうかを判定し、一致したノードに関連付けられた項目値情報を、当該頂点ノードによって代表されたノード群に関係した集計の分類対象を表す項目名情報に関連付けられた項目値情報毎に集計する。   The totaling unit 6406 traces the parent-child relationship between the nodes for each vertex node, identifies the descendant node of the vertex node, and totals the item name information associated with the vertex node and / or the descendant node of the vertex node. It is determined whether or not the object matches, and the item value information associated with the matched node is aggregated. In another embodiment, the aggregation unit 6406 identifies, for each vertex node, a descendant node of the vertex node by tracing a parent-child relationship between the nodes, and is associated with the vertex node or a descendant node of the vertex node. Determine whether the item name information matches the item name information that represents the aggregation target, and determine the item value information associated with the matched node as the aggregation target related to the node group represented by the vertex node. Aggregate for each item value information associated with the item name information to be represented.

順序付け部6407は、頂点ノード毎に集計された項目値情報の順序関係に従って当該少なくとも二つの頂点ノードに順序を付けることにより、当該頂点ノードによって代表されるノード群に順序を付ける。   The ordering unit 6407 orders the node groups represented by the vertex nodes by ordering the at least two vertex nodes according to the order relation of the item value information aggregated for each vertex node.

他の一実施例では、指標取得部6408は、各ツリーデータに属する各頂点ノードについて、前記ノード間の親子関係を辿って当該頂点ノードの子孫ノードを特定し、当該頂点ノード又は当該頂点ノードの子孫ノードの中で、順序付けの指標となる項目名情報が関連付けられたノードに関連付けられた項目値情報を取得する。順序付け部6407は、頂点ノード毎に取得された項目値情報の順序関係に従って当該少なくとも二つの頂点ノードに順序を付けることにより、当該頂点ノードによって代表されるノード群に順序を付ける。   In another embodiment, the index acquisition unit 6408 traces the parent-child relationship between the nodes for each vertex node belonging to each tree data, identifies the descendant node of the vertex node, and determines the vertex node or the vertex node Among the descendant nodes, item value information associated with a node associated with item name information serving as an index for ordering is acquired. 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.

本発明は、以上の実施の形態に限定されることなく、特許請求の範囲に記載された発明の範囲内で、種々の変更が可能であり、それらも本発明の範囲内に包含されるものであることは言うまでもない。   The present invention is not limited to the above embodiments, and various modifications can be made within the scope of the invention described in the claims, and these are also included in the scope of the present invention. Needless to say.

図1は、本発明の実施の形態にかかるツリー型データ構造を取り扱うコンピュータシステムのブロックダイヤグラムである。FIG. 1 is a block diagram of a computer system that handles a tree-type data structure according to an embodiment of the present invention. 図2A、Bは、ツリー形式データの一例であるPOSデータの説明図であり、図2Aは、このツリー形式データのデータ構造(即ち、トポロジー)及びデータ値を視覚的に表現した例であり、図2Bは、同じツリー形式データをXML形式で表現した例である。2A and 2B are explanatory diagrams of POS data, which is an example of tree format data. FIG. 2A is an example in which the data structure (ie, topology) and data values of the tree format data are visually expressed. FIG. 2B is an example in which the same tree format data is expressed in XML format. 図3A〜Cは、アークリストを用いたツリー型データ構造の表現形式の一例の説明図である。3A to 3C are explanatory diagrams of examples of the expression format of the tree-type data structure using the arc list. 図4A〜Cは、「子→親」関係に基づくツリー型データ構造の表現方法の説明図である。4A to 4C are explanatory diagrams of a method for expressing a tree-type data structure based on the “child → parent” relationship. 図5は、ツリー型データ構造を記憶装置上に構築する方法のフローチャートである。FIG. 5 is a flowchart of a method for constructing a tree-type data structure on a storage device. 図6A〜Cは、ID形式のツリー構造型データを整数連番形式のツリー構造型データへ変換する処理の説明図である。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. 図7A〜Cは、ID形式のツリー構造型データを整数連番形式のツリー構造型データへ変換する処理の説明図である。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. 図8は、深さ優先に基づくノード定義処理のフローチャートである。FIG. 8 is a flowchart of node definition processing based on depth priority. 図9は、「子→親」表現に基づく親子関係の配列の説明図である。FIG. 9 is an explanatory diagram of an array of parent-child relationships based on the expression “child → parent”. 図10は、図6Cに示された深さ優先のツリー型データ構造から作成された「親→子」表現に基づく親子関係の配列の説明図である。FIG. 10 is an explanatory diagram of an array of parent-child relationships based on the “parent → child” expression created from the depth-first tree-type data structure shown in FIG. 6C. 図11は、幅優先に基づくノード定義処理のフローチャートである。FIG. 11 is a flowchart of node definition processing based on width priority. 図12は、「子→親」表現に基づく親子関係の配列の説明図である。FIG. 12 is an explanatory diagram of an array of parent-child relationships based on the expression “child → parent”. 図13は、図7Cに示された深さ優先のツリー型データ構造から作成された「親→子」表現に基づく親子関係の配列の説明図である。FIG. 13 is an explanatory diagram of an array of parent-child relationships based on a “parent → child” expression created from the depth-first tree-type data structure shown in FIG. 7C. 図14Aは、幅優先モードに基づくツリー型データ構造、図14Bは、当該ツリー型データ構造を、「子→親」表現に基づく親子関係の配列を示す図である。FIG. 14A is a diagram illustrating a tree-type data structure based on the breadth-first mode, and FIG. 14B is a diagram illustrating an array of a parent-child relationship based on the tree-type data structure based on a “child → parent” expression. 図15Aは、頂点ノードリストの例、図15Bは、頂点ノードリストで特定される部分ツリー群の例を示す図である。FIG. 15A is an example of a vertex node list, and FIG. 15B is a diagram illustrating an example of a partial tree group specified by the vertex node list. 図16Aは、検索処理により得られた頂点ノードリストの例、図16Bは、頂点ノードリストで特定される部分ツリー群の例を示す図である。FIG. 16A is an example of a vertex node list obtained by the search process, and FIG. 16B is a diagram illustrating an example of a partial tree group specified by the vertex node list. 図17Aは、集計処理により得られた頂点ノードリストおよび集計結果を示す配列の例、図17Bは、頂点ノードリストで特定される部分ツリー群の例を示す図である。FIG. 17A is an example of an array showing the vertex node list and the aggregation result obtained by the aggregation process, and FIG. 17B is a diagram showing an example of a partial tree group specified by the vertex node list. 図18Aは、ノード数でソートされた頂点ノードリスト、および、対応するノード数を示す配列の例、図18Bは、頂点ノードリストで特定される部分ツリーの例を示す図である。FIG. 18A is a diagram illustrating an example of a vertex node list sorted by the number of nodes and an array indicating the number of corresponding nodes, and FIG. 18B is a diagram illustrating an example of a partial tree specified by the vertex node list. 図19A、Cは、それぞれ、論理積演算の対象となる頂点ノードリストの例、図19B、Dは、それぞれ頂点ノードリストで特定される部分ツリー群の例を示す図である。FIGS. 19A and 19C are examples of vertex node lists to be subjected to AND operations, and FIGS. 19B and 19D are examples of partial tree groups specified by the vertex node list. 図20Aは、論理積演算の結果を示す頂点ノードリストの例、図20Bは、頂点ノードリストで特定される部分ツリー群を示す図である。FIG. 20A is an example of a vertex node list showing the result of the logical product operation, and FIG. 20B is a diagram showing a partial tree group specified by the vertex node list. 図21Aは、幅優先モードに基づくツリー型データ構造、図21Bは、当該ツリー型データ構造を、「子→親」表現に基づく親子関係の配列を示す図である。FIG. 21A is a diagram illustrating a tree-type data structure based on the breadth-first mode, and FIG. 21B is a diagram illustrating an array of a parent-child relationship based on the tree-type data structure based on a “child → parent” expression. 図22A、Bは、論理積演算を説明する図である。22A and 22B are diagrams illustrating the logical product operation. 図23は、論理積演算の処理を示すフローチャートである。FIG. 23 is a flowchart showing a logical product operation process. 図24は、論理積演算の処理例を示す図である。FIG. 24 is a diagram illustrating a processing example of a logical product operation. 図25は、論理積演算の処理例を示す図である。FIG. 25 is a diagram illustrating a processing example of a logical product operation. 図26は、実体的な値の取り扱い方の一例を示す図である。FIG. 26 is a diagram illustrating an example of how to handle substantial values. 図27Aは、本発明の一実施例にかかる子孫のパス条件による検索の対象となるツリー型データ構造とノードの親子関係の「子→親」表現の説明図であり、図27Bはシンボル番号と表示図形とシンボル名の対応関係を表す図である。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 to be searched according to a descendant path condition according to an embodiment of the present invention, and FIG. It is a figure showing the correspondence of a display figure and a symbol name. 図28は、本発明の一実施例にかかる子孫のパス条件によるツリー検索方法のフローチャートである。FIG. 28 is a flowchart of a tree search method based on descendant path conditions according to an embodiment of the present invention. 図29A〜Cは、本発明の一実施例にかかる子孫のパス条件によるツリー検索方法の動作状態を説明する図である。FIGS. 29A to 29C are diagrams for explaining the operation states of the tree search method based on the descendant path conditions according to an embodiment of the present invention. 図30A〜Cは、本発明の一実施例にかかる子孫のパス条件によるツリー検索方法の動作状態を説明する図である。FIGS. 30A to 30C are diagrams illustrating operation states of the tree search method based on the descendant path condition according to an embodiment of the present invention. 図31A〜Cは、本発明の一実施例にかかる子孫のパス条件によるツリー検索方法の動作状態を説明する図である。FIGS. 31A to 31C are diagrams for explaining operation states of the tree search method based on the descendant path conditions according to an embodiment of the present invention. 図32A〜Dは、本発明の一実施例にかかる子孫のパス条件によるツリー検索方法の動作状態を説明する図である。FIGS. 32A to 32D are diagrams for explaining the operation states of the tree search method based on the descendant path conditions according to an embodiment of the present invention. 図33A〜Cは、本発明の一実施例にかかる子孫のパス条件によるツリー検索方法の動作状態を説明する図である。FIGS. 33A to 33C are diagrams for explaining the operation states of the tree search method based on the descendant path conditions according to an embodiment of the present invention. 図34は、本発明の一実施例にかかる子孫のパス条件によるツリー検索方法のフローチャートである。FIG. 34 is a flowchart of a tree search method based on descendant path conditions according to an embodiment of the present invention. 図35A〜Cは、本発明の一実施例にかかる子孫のパス条件によるツリー検索方法の動作状態を説明する図である。FIGS. 35A to 35C are diagrams illustrating operation states of the tree search method based on the descendant path conditions according to an embodiment of the present invention. 図36A〜Cは、本発明の一実施例にかかる子孫のパス条件によるツリー検索方法の動作状態を説明する図である。36A to 36C are diagrams for explaining the operation states of the tree search method based on the path conditions of descendants according to an embodiment of the present invention. 図37A〜Cは、本発明の一実施例にかかる子孫のパス条件によるツリー検索方法の動作状態を説明する図である。FIGS. 37A to 37C are diagrams for explaining operation states of the tree search method based on the descendant path conditions according to the embodiment of the present invention. 図38A〜Cは、本発明の一実施例にかかる祖先のパス条件による検索の対象となるツリー型データ構造とノードの親子関係の「子→親」表現の説明図である。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. 図39は、本発明の一実施例にかかる祖先のパス条件によるツリー検索方法のフローチャートである。FIG. 39 is a flowchart of a tree search method based on ancestor path conditions according to an embodiment of the present invention. 図40A〜Cは、本発明の一実施例にかかる祖先のパス条件によるツリー検索方法の動作状態を説明する図である。40A to 40C are diagrams for explaining the operation states of the tree search method based on the ancestor path conditions according to an embodiment of the present invention. 図41A〜Cは、本発明の一実施例にかかる祖先のパス条件によるツリー検索方法の動作状態を説明する図である。41A to 41C are diagrams for explaining the operation states of the tree search method based on the ancestor path conditions according to the embodiment of the present invention. 図42A〜Cは、本発明の一実施例にかかる祖先のパス条件によるツリー検索方法の動作状態を説明する図である。42A to 42C are diagrams for explaining the operation states of the tree search method based on the ancestor path conditions according to the embodiment of the present invention. 図43Aは、本発明の一実施例にかかる集計の対象となるツリー型データ構造とノードの親子関係の「子→親」表現の説明図であり、図43Bはシンボル番号と表示図形とシンボル名の対応関係を表す図である。43A is an explanatory diagram of a “child-to-parent” representation of a parent-child relationship between a tree-type data structure and nodes that are subject to aggregation according to an embodiment of the present invention, and FIG. 43B illustrates a symbol number, a display figure, and a symbol name. It is a figure showing the correspondence of these. 図44A〜Dは、図43Aの各頂点ノードによって代表される部分ツリーの説明図である。44A to 44D are explanatory diagrams of partial trees represented by the vertex nodes in FIG. 43A. 図45は、本発明の一実施例にかかる第1のツリーデータ集計方法のフローチャートである。FIG. 45 is a flowchart of the first tree data totaling method according to an embodiment of the present invention. 図46は、本発明の一実施例にかかる第1のツリーデータ集計方法の動作状態を説明する図である。FIG. 46 is a diagram for explaining the operation state of the first tree data totaling method according to the embodiment of the present invention. 図47は、本発明の一実施例にかかる第1のツリーデータ集計方法の動作状態を説明する図である。FIG. 47 is a diagram for explaining the operation state of the first tree data totaling method according to the embodiment of the present invention. 図48は、本発明の一実施例にかかる第1のツリーデータ集計方法の動作状態を説明する図である。FIG. 48 is a diagram for explaining the operation state of the first tree data totaling method according to the embodiment of the present invention. 図49は、本発明の一実施例にかかる第2のツリーデータ集計方法のフローチャートである。FIG. 49 is a flowchart of a second tree data totaling method according to an embodiment of the present invention. 図50A〜Dは、本発明の一実施例にかかる第2のツリーデータ集計方法の動作状態を説明する図である。50A to 50D are diagrams for explaining the operation state of the second tree data totaling method according to the embodiment of the present invention. 図51A〜Cは、本発明の一実施例にかかる第1のツリーデータソート方法の説明図である。51A to 51C are explanatory diagrams of a first tree data sorting method according to an embodiment of the present invention. 図52Aは本発明の一実施例にかかる第2のツリーデータソート方法の処理の対象となるツリー型データ構造及びノードの親子関係の「子→親」表現を示し、図52Bはノードタイプ毎のノード値のリストを示し、図52Cはノードに関連付けられたノードタイプ及びノード値を示す図である。FIG. 52A shows a tree-type data structure to be processed by the second tree data sorting method according to an embodiment of the present invention and a “child → parent” expression of the parent-child relationship of the nodes, and FIG. FIG. 52C is a diagram showing a node type and a node value associated with the node. 図53は、本発明の一実施例にかかる第2のツリーデータ集計方法のフローチャートである。FIG. 53 is a flowchart of a second tree data totaling method according to an embodiment of the present invention. 図54は、図52A〜Cに示されたツリー型データ構造のデータに本発明の一実施例にかかる第2のツリーデータソート方法を適用したときの動作状態の説明図である。FIG. 54 is an explanatory diagram of an operation state when the second tree data sorting method according to an embodiment of the present invention is applied to the data having the tree-type data structure shown in FIGS. 図55は、図52A〜Cに示されたツリー型データ構造のデータに本発明の一実施例にかかる第2のツリーデータソート方法を適用したときの動作状態の説明図である。FIG. 55 is an explanatory diagram of an operation state when the second tree data sorting method according to an embodiment of the present invention is applied to the data having the tree-type data structure shown in FIGS. 図56は、図52A〜Cに示されたツリー型データ構造のデータに本発明の一実施例にかかる第2のツリーデータソート方法を適用したときの動作状態の説明図である。FIG. 56 is an explanatory diagram of an operation state when the second tree data sorting method according to one embodiment of the present invention is applied to the data having the tree-type data structure shown in FIGS. 図57は、図52A〜Cに示されたツリー型データ構造のデータに本発明の一実施例にかかる第2のツリーデータソート方法を適用したときの動作状態の説明図である。FIG. 57 is an explanatory diagram of an operation state when the second tree data sorting method according to an embodiment of the present invention is applied to data having the tree-type data structure shown in FIGS. 図58は、図52A〜Cに示されたツリー型データ構造のデータに本発明の一実施例にかかる第2のツリーデータソート方法を適用したときの動作状態の説明図である。FIG. 58 is an explanatory diagram of an operation state when the second tree data sorting method according to one embodiment of the present invention is applied to the data having the tree-type data structure shown in FIGS. 図59は、図52A〜Cに示されたツリー型データ構造のデータに本発明の一実施例にかかる第2のツリーデータソート方法を適用したときの動作状態の説明図である。FIG. 59 is an explanatory diagram of an operation state when the second tree data sorting method according to one embodiment of the present invention is applied to data having the tree-type data structure shown in FIGS. 図60は、図52A〜Cに示されたツリー型データ構造のデータに本発明の一実施例にかかる第2のツリーデータソート方法を適用したときの動作状態の説明図である。FIG. 60 is an explanatory diagram of an operation state when the second tree data sorting method according to one embodiment of the present invention is applied to the data having the tree-type data structure shown in FIGS. 図61は、図52A〜Cに示されたツリー型データ構造のデータに本発明の一実施例にかかる第2のツリーデータソート方法を適用したときの動作状態の説明図である。FIG. 61 is an explanatory diagram of an operation state when the second tree data sorting method according to one embodiment of the present invention is applied to the data having the tree-type data structure shown in FIGS. 図62A、Bは、図52A〜Cに示されたツリー型データ構造のデータに本発明の一実施例にかかる第2のツリーデータソート方法を適用したときの動作状態の説明図である。62A and 62B are explanatory diagrams of operation states when the second tree data sorting method according to one embodiment of the present invention is applied to the data having the tree-type data structure shown in FIGS. 図63A〜Eは、複数のツリーデータにより構成されたツリー型データ構造のデータの一例を示す図である。63A to 63E are diagrams illustrating an example of data having a tree-type data structure including a plurality of tree data. 図64は、本発明の一実施例による情報処置装置のブロック図である。FIG. 64 is a block diagram of an information processing apparatus according to an embodiment of the present invention.

符号の説明Explanation of symbols

10 コンピュータシステム
12 CPU
14 RAM
16 ROM
18 固定記憶装置
20 CD−ROMドライバ
22 I/F
24 入力装置
26 表示装置
6400 情報処理装置
6401 記憶部
6402 データ展開部
6403 条件指定部
6404 ツリーデータ処理部
6405 検索部
6406 集計部
6407 順序付け部
6408 指標取得部
10 Computer system 12 CPU
14 RAM
16 ROM
18 Fixed storage device 20 CD-ROM driver 22 I / F
24 input device 26 display device 6400 information processing device 6401 storage unit 6402 data development unit 6403 condition designation unit 6404 tree data processing unit 6405 search unit 6406 aggregation unit 6407 ordering unit 6408 index acquisition unit

Claims (28)

記憶装置に展開されたルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを検索する方法であって、
ルート・ノードを含む全ノードに、0又は1から始まる整数連番である固有のノード識別子が付与され、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、
各ノードは当該ノードのパス及びノード格納値を表す実体情報が関連付けられ、
ツリー型データ構造の特定のノードである頂点ノードと当該頂点ノードの子孫ノードとを含むノード群である部分ツリーが、当該頂点ノードに付与されたノード識別子によって代表され、
パス及び/又はノード格納値に関する検索条件を指定し、部分ツリーを代表する頂点ノードのノード識別子からなる配列である頂点ノードリストを用いて検索範囲を指定する条件指定ステップと、
検索範囲に含まれるノード毎に、当該ノードに関連付けられた実体情報が前記検索条件と一致するかどうかを判定し、一致した場合に当該ノードに検索ヒット情報を関連付け、前記ノード間の親子関係を辿って当該ノードの祖先ノードに検索ヒット情報を関連付ける検索ステップと、
検索ヒット情報が関連付けられたノードを含む部分ツリーを代表する頂点ノードリストを検索結果として保存するステップと、
を有する方法。
A method for retrieving 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,
All nodes including the root node are given a unique node identifier that is an integer sequence number starting from 0 or 1. The node identifier assigned to each non-root node is assigned to each parent node of the non-root node. The given node identifier is associated, thereby expressing the parent-child relationship between the nodes that make up the tree-type data structure,
Each node is associated with entity information representing the path of the node and the stored value of the node,
A partial tree that is a node group including a vertex node that is a specific node of a tree-type data structure and descendant nodes of the vertex node is represented by a node identifier assigned to the vertex node,
A condition designating step for designating a search condition regarding a path and / or a node storage value, and designating a search range using a vertex node list which is an array of node identifiers of vertex nodes representing the partial tree;
For each node included in the search range, 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 A search step for tracing and associating search hit information with an ancestor node of the node;
Storing a vertex node list representing the partial tree including the node associated with the search hit information as a search result;
Having a method.
前記検索ステップにおいて、前記ノード間の親子関係が頂点ノードの個数に応じて、親ノードから子ノード又は子ノードから親ノードの順番に辿られる、
請求項1に記載の方法。
In the search step, the parent-child relationship between the nodes is traced in order from the parent node to the child node or from the child node to the parent node according to the number of vertex nodes.
The method of claim 1.
記憶装置に展開されたルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを検索する方法であって、
ルート・ノードを含む全ノードに、0又は1から始まる整数連番である固有のノード識別子が付与され、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、
各ノードは当該ノードのパス及びノード格納値を表す実体情報が関連付けられ、
ツリー型データ構造の特定のノードである頂点ノードと当該頂点ノードの子孫ノードとを含むノード群である部分ツリーが、当該頂点ノードに付与されたノード識別子によって代表され、
パス及び/又はノード格納値に関する検索条件を指定し、部分ツリーを代表する頂点ノードのノード識別子からなる配列である頂点ノードリストを用いて検索範囲を指定するステップと、
検索範囲に含まれる各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーと特定の関係にあるノードに関連付けられた実体情報が前記検索条件と一致するかどうかを判定し、一致したノードが存在する場合に、当該部分ツリーを代表する頂点ノードを含む頂点ノードリストを検索結果として保存するステップと、
を有する方法。
A method for retrieving 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,
All nodes including the root node are given a unique node identifier that is an integer sequence number starting from 0 or 1. The node identifier assigned to each non-root node is assigned to each parent node of the non-root node. The given node identifier is associated, thereby expressing the parent-child relationship between the nodes that make up the tree-type data structure,
Each node is associated with entity information representing the path of the node and the stored value of the node,
A partial tree that is a node group including a vertex node that is a specific node of a tree-type data structure and descendant nodes of the vertex node is represented by a node identifier assigned to the vertex node,
Designating search conditions for paths and / or node storage values, and specifying a search range using a vertex node list that is an array of node identifiers of vertex nodes representing a partial tree;
For each partial tree included in the search range, the parent-child relationship between the nodes is traced to determine whether the entity information associated with the node having a specific relationship with the partial tree matches the search condition. When a node exists, storing a vertex node list including vertex nodes representing the partial tree as a search result;
Having a method.
前記保存するステップにおいて、当該部分ツリーと特定の関係にあるノードが当該部分ツリーに属するノードである、請求項3に記載の方法。  The method according to claim 3, wherein, in the storing step, a node having a specific relationship with the partial tree is a node belonging to the partial tree. 前記保存するステップにおいて、当該部分ツリーと特定の関係にあるノードが当該部分ツリーの祖先ノード及び/又は当該部分ツリーの頂点ノードである、請求項3に記載の方法。  The method according to claim 3, wherein in the storing step, nodes having a specific relationship with the partial tree are ancestor nodes of the partial tree and / or vertex nodes of the partial tree. 記憶装置に展開されたルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを第1の検索条件と第2の検索条件を論理的に組み合わせて検索する方法であって、
ルート・ノードを含む全ノードに、0又は1から始まる整数連番である固有のノード識別子が付与され、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、
各ノードは当該ノードのパス及びノード格納値を表す実体情報が関連付けられ、
ツリー型データ構造の特定のノードである頂点ノードと当該頂点ノードの子孫ノードとを含むノード群である部分ツリーが、当該頂点ノードに付与されたノード識別子によって代表され、
部分ツリーを代表する頂点ノードのノード識別子からなる配列である頂点ノードリストを用いて検索範囲を指定するステップと、
パス及び/又はノード格納値に関する前記第1の検索条件を指定するステップと、
検索範囲内で前記ノード間の親子関係を辿って当該第1の検索条件に一致するノードが属する部分ツリーを代表する頂点ノードを含む第1の頂点ノードリストを第1の検索結果として保存するステップと、
実体情報に関する前記第2の検索条件を指定するステップと、
検索範囲内で前記ノード間の親子関係を辿って当該第2の検索条件に一致するノードが属する部分ツリーを代表する頂点ノードを含む第2の頂点ノードを第2の検索結果として保存するステップと、
前記第1の検索条件と前記第2の検索条件の論理的な組み合わせに対応した論理演算を前記第1の頂点ノードリストと前記第2の頂点ノードリストに実行することにより、第1の検索条件と第2の検索条件を論理的に組み合わせた検索結果を表す頂点ノードリストを生成するステップと、
を有する方法。
Search for data having 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 by logically combining the first search condition and the second search condition. A method,
All nodes including the root node are given a unique node identifier that is an integer sequence number starting from 0 or 1. The node identifier assigned to each non-root node is assigned to each parent node of the non-root node. The given node identifier is associated, thereby expressing the parent-child relationship between the nodes that make up the tree-type data structure,
Each node is associated with entity information representing the path of the node and the stored value of the node,
A partial tree that is a node group including a vertex node that is a specific node of a tree-type data structure and descendant nodes of the vertex node is represented by a node identifier assigned to the vertex node,
Designating a search range using a vertex node list which is an array of node identifiers of vertex nodes representing the partial tree;
Designating the first search condition for a path and / or node stored value ;
A step of tracing a parent-child relationship between the nodes within a search range and storing a first vertex node list including a vertex node representing a partial tree to which a node matching the first search condition belongs as a first search result. When,
Designating the second search condition for entity information;
Tracing a parent-child relationship between the nodes within a search range, and storing a second vertex node including a vertex node representing a partial tree to which a node matching the second search condition belongs as a second search result; ,
By executing a logical operation corresponding to a logical combination of the first search condition and the second search condition on the first vertex node list and the second vertex node list, the first search condition Generating a vertex node list representing a search result that logically combines the second search condition and
Having a method.
記憶装置に展開されたルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを集計する方法であって、
ルート・ノードを含む全ノードに、0又は1から始まる整数連番である固有のノード識別子が付与され、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、
各ノードは当該ノードのノードタイプ及びノード格納値を表す実体情報が関連付けられ、
ツリー型データ構造の特定のノードである頂点ノードと当該頂点ノードの子孫ノードとを含むノード群である部分ツリーが、当該頂点ノードに付与されたノード識別子によって代表され、
集計の分類対象を表す第1のノードタイプを指定し、集計の対象を表す第2のノードタイプを指定し、部分ツリーを代表する頂点ノードのノード識別子からなる配列である頂点ノードリストを用いて集計の範囲を指定するステップと、
集計の範囲に含まれる各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーに属するノード群を特定し、当該ノード群の中に集計の対象を表す第2のノードタイプが関連付けられたノードが存在するかどうかを判定し、存在する場合に、当該ノードに関連付けられたノード格納値を、当該部分ツリーに属するノード群に関係した集計の分類対象を表す第1のノードタイプ毎に集計するステップと、
を有する方法。
A method of aggregating data of a tree-type data structure including a root node expanded in a storage device and a non-root node which is a node other than the root node,
All nodes including the root node are given a unique node identifier that is an integer sequence number starting from 0 or 1. The node identifier assigned to each non-root node is assigned to each parent node of the non-root node. The given node identifier is associated, thereby expressing the parent-child relationship between the nodes that make up the tree-type data structure,
Each node is associated with entity information representing the node type and node stored value of the node,
A partial tree that is a node group including a vertex node that is a specific node of a tree-type data structure and descendant nodes of the vertex node is represented by a node identifier assigned to the vertex node,
Using a vertex node list that is an array of node identifiers of vertex nodes that represent a partial tree, specifying a first node type that represents a classification target for aggregation, a second node type that represents a target for aggregation A step for specifying the range of aggregation;
For each partial tree included in the aggregation range, the node group belonging to the partial tree is identified by tracing the parent-child relationship between the nodes, and the second node type representing the aggregation target is associated with the node group. The node storage value associated with the node is determined for each first node type representing the classification target of aggregation related to the node group belonging to the partial tree. A step of counting,
Having a method.
記憶装置に展開されたルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータの少なくとも二つのノード群に順序を付ける方法であって、
ルート・ノードを含む全ノードに、0又は1から始まる整数連番である固有のノード識別子が付与され、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、
各ノードは当該ノードのノードタイプ及びノード格納値を表す実体情報が関連付けられ、
ツリー型データ構造の特定のノードである頂点ノードと当該頂点ノードの子孫ノードとを含むノード群である部分ツリーが、当該頂点ノードに付与されたノード識別子によって代表され、
集計の対象を表すノードタイプを指定し、少なくとも二つの部分ツリーを代表する頂点ノードのノード識別子からなる配列である頂点ノードリストを用いて集計の範囲を指定するステップと、
集計の範囲に含まれる各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーに属するノード群を特定し、当該ノード群の中に集計の対象を表すノードタイプが関連付けられたノードが存在するかどうかを判定し、存在する場合に、当該ノードに関連付けられたノード格納値を集計するステップと、
部分ツリー毎に集計されたノード格納値の順序関係に従って当該少なくとも二つの部分ツリーに順序を付けるステップと、
を有する方法。
A method of ordering at least two nodes 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,
All nodes including the root node are given a unique node identifier that is an integer sequence number starting from 0 or 1. The node identifier assigned to each non-root node is assigned to each parent node of the non-root node. The given node identifier is associated, thereby expressing the parent-child relationship between the nodes that make up the tree-type data structure,
Each node is associated with entity information representing the node type and node stored value of the node,
A partial tree that is a node group including a vertex node that is a specific node of a tree-type data structure and descendant nodes of the vertex node is represented by a node identifier assigned to the vertex node,
Specifying a node type representing a target of aggregation, and specifying a range of aggregation using a vertex node list that is an array of node identifiers of vertex nodes representing at least two partial trees;
For each partial tree included in the range of aggregation, a node group belonging to the partial tree is identified by tracing the parent-child relationship between the nodes, and a node associated with a node type representing an aggregation target is included in the node group. Determining whether it exists, and, if present, aggregating node stored values associated with the node;
Ordering the at least two partial trees according to the order relation of the node stored values aggregated for each partial tree;
Having a method.
記憶装置に展開されたルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータの少なくとも二つのノード群に順序を付ける方法であって、
ルート・ノードを含む全ノードに、0又は1から始まる整数連番である固有のノード識別子が付与され、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、
各ノードは当該ノードのノードタイプ及びノード格納値を表す実体情報が関連付けられ、
ツリー型データ構造の特定のノードである頂点ノードと当該頂点ノードの子孫ノードとを含むノード群である部分ツリーが、当該頂点ノードに付与されたノード識別子によって代表され、
少なくとも二つの部分ツリーを代表する頂点ノードのノード識別子からなる配列である頂点ノードリストを用いて順序付けの対象を指定し、順序付けの指標となるノードタイプを指定するステップと、
順序付けの対象に含まれる各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーに属するノード群を特定し、当該ノード群の中で、順序付けの指標となるノードタイプが関連付けられたノードに関連付けられたノード格納値を取得するステップと、
部分ツリー毎に取得されたノード格納値の順序関係に従って当該少なくとも二つの部分ツリーに順序を付けるステップと、
を有する方法。
A method of ordering at least two nodes 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,
All nodes including the root node are given a unique node identifier that is an integer sequence number starting from 0 or 1. The node identifier assigned to each non-root node is assigned to each parent node of the non-root node. The given node identifier is associated, thereby expressing the parent-child relationship between the nodes that make up the tree-type data structure,
Each node is associated with entity information representing the node type and node stored value of the node,
A partial tree that is a node group including a vertex node that is a specific node of a tree-type data structure and descendant nodes of the vertex node is represented by a node identifier assigned to the vertex node,
Specifying an ordering target using a vertex node list that is an array of node identifiers of vertex nodes representing at least two partial trees, and specifying a node type as an index of ordering;
For each partial tree included in the ordering target, a node group belonging to the partial tree is identified by tracing the parent-child relationship between the nodes, and a node type associated with the node type serving as an index for ordering is associated with the node group Obtaining a node stored value associated with, and
Ordering the at least two partial trees according to the order relation of the node stored values obtained for each partial tree;
Having a method.
ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータを検索する情報処理装置であって、
ルート・ノードを含む全ノードに、0又は1から始まる整数連番である固有のノード識別子を付与し、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係を表現し、各ノードに当該ノードのパス及びノード格納値を表す実体情報を関連付け、ツリー型データ構造を記憶装置上に構築するデータ展開手段と、
パス及び/又はノード格納値に関する検索条件を指定し、ツリー型データ構造の特定のノードである頂点ノードと当該頂点ノードの子孫ノードとを含むノード群である部分ツリーを当該頂点ノードに付与された識別子によって代表させることにより、部分ツリーを代表する頂点ノードのノード識別子からなる配列である頂点ノードリストを用いて検索範囲を指定する条件指定手段と、
検索範囲に含まれるノード毎に、当該ノードに関連付けられた実体情報が前記検索条件と一致するかどうかを判定し、一致した場合に当該ノードに検索ヒット情報を関連付け、前記ノード間の親子関係を辿って当該ノードの祖先ノードに検索ヒット情報を関連付ける検索手段と、
検索ヒット情報が関連付けられたノードを含む部分ツリーを代表する頂点ノードリストを検索結果として保存する手段と、
を有する情報処理装置。
An information processing apparatus having 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 that searches for data stored in the storage device,
All nodes including the root node are assigned a unique node identifier that is an integer sequence number starting from 0 or 1, and the node identifier assigned to each non-root node is assigned to each parent node of the non-root node. Associating the given node identifier, thereby expressing the parent-child relationship between the nodes constituting the tree-type data structure, associating each node with entity information indicating the path and node storage value of the node, Data expansion means constructed on a storage device;
A search condition related to a path and / or node storage value is specified, and a partial tree that is a node group including a vertex node that is a specific node of a tree-type data structure and descendant nodes of the vertex node is assigned to the vertex node A condition specifying means for specifying a search range using a vertex node list that is an array of node identifiers of vertex nodes representing a partial tree by being represented by an identifier;
For each node included in the search range, 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. A search means for tracing and associating search hit information with an ancestor node of the node;
Means for storing, as a search result, a vertex node list representing a partial tree including nodes associated with search hit information;
An information processing apparatus.
前記検索手段が、頂点ノードの個数に応じて、親ノードから子ノード又は子ノードから親ノードの順番に前記ノード間の親子関係を辿る、
請求項10に記載の情報処理装置。
The search means traces a parent-child relationship between the nodes in order from a parent node to a child node or from a child node to a parent node according to the number of vertex nodes.
The information processing apparatus according to claim 10.
ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータを検索する情報処理装置であって、
ルート・ノードを含む全ノードに、0又は1から始まる整数連番である固有のノード識別子を付与し、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、各ノードに当該ノードのパス及びノード格納値を表す実体情報を関連付け、ツリー型データ構造を記憶装置上に構築するデータ展開手段と、
パス及び/又はノード格納値に関する検索条件を指定し、ツリー型データ構造の特定のノードである頂点ノードと当該頂点ノードの子孫ノードとを含むノード群である部分ツリーを当該頂点ノードに付与された識別子によって代表させることにより、部分ツリーを代表する頂点ノードのノード識別子からなる配列である頂点ノードリストを用いて検索範囲を指定する条件指定手段と、
検索範囲に含まれる各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーと特定の関係にあるノードに関連付けられた実体情報が前記検索条件と一致するかどうかを判定し、一致したノードが存在する場合に、当該部分ツリーを代表する頂点ノードを含む頂点ノードリストを検索結果として保存する検索手段と、
を有する情報処理装置。
An information processing apparatus having 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 that searches for data stored in the storage device,
All nodes including the root node are assigned a unique node identifier that is an integer sequence number starting from 0 or 1, and the node identifier assigned to each non-root node is assigned to each parent node of the non-root node. By associating the given node identifiers, the parent-child relationship between the nodes constituting the tree-type data structure is expressed, and the entity information representing the path and the stored value of the node is associated with each node, and the tree-type data structure is Data expansion means constructed on a storage device;
A search condition related to a path and / or node storage value is specified, and a partial tree that is a node group including a vertex node that is a specific node of a tree-type data structure and descendant nodes of the vertex node is assigned to the vertex node A condition specifying means for specifying a search range using a vertex node list that is an array of node identifiers of vertex nodes representing a partial tree by being represented by an identifier;
For each partial tree included in the search range, the parent-child relationship between the nodes is traced to determine whether the entity information associated with the node having a specific relationship with the partial tree matches the search condition. Search means for storing, as a search result, a vertex node list including vertex nodes representing the partial tree when a node exists;
An information processing apparatus.
前記検索手段において、当該部分ツリーと特定の関係にあるノードが当該部分ツリーに属するノードである、請求項12に記載の情報処理装置。  The information processing apparatus according to claim 12, wherein, in the search means, a node having a specific relationship with the partial tree is a node belonging to the partial tree. 前記検索手段において、当該部分ツリーと特定の関係にあるノードが当該部分ツリーの祖先ノード及び/又は当該部分ツリーの頂点ノードである、請求項12に記載の情報処理装置。  13. The information processing apparatus according to claim 12, wherein, in the search means, a node having a specific relationship with the partial tree is an ancestor node of the partial tree and / or a vertex node of the partial tree. ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを記憶する記憶装置を有し、第1の検索条件と第2の検索条件を論理的に組み合わせて検索する情報処理装置であって、
ルート・ノードを含む全ノードに、0又は1から始まる整数連番である固有のノード識別子を付与し、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、各ノードに当該ノードのパス及びノード格納値を表す実体情報を関連付け、ツリー型データ構造を記憶装置上に構築するデータ展開手段と、
パス及び/又はノード格納値に関する前記第1の検索条件及び前記第2の検索条件を指定し、ツリー型データ構造の特定のノードである頂点ノードと当該頂点ノードの子孫ノードとを含むノード群である部分ツリーを当該頂点ノードに付与された識別子によって代表させることにより、部分ツリーを代表する頂点ノードのノード識別子からなる配列である頂点ノードリストを用いて検索範囲を指定する条件指定手段と、
前記第1の検索条件に従って、前記検索範囲内で前記ノード間の親子関係を辿って当該第1の検索条件に一致するノードが属する部分ツリーを代表する頂点ノードを含む第1の頂点ノードリストを第1の検索結果として保存し、前記第2の検索条件に従って、前記検索範囲内で前記ノード間の親子関係を辿って当該第2の検索条件に一致するノードが属する部分ツリーを代表する頂点ノードを含む第2の頂点のノードリストを第2の検索結果として保存する検索手段と、
前記第1の検索条件と前記第2の検索条件の論理的な組み合わせに対応した論理演算を前記第1の頂点ノードリストと前記第2の頂点ノードリストに実行することにより、第1の検索条件と第2の検索条件を論理的に組み合わせた検索結果を生成する組み合わせ手段と、
を有する情報処理装置。
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 logically combines the first search condition and the second search condition An information processing apparatus for searching,
All nodes including the root node are assigned a unique node identifier that is an integer sequence number starting from 0 or 1, and the node identifier assigned to each non-root node is assigned to each parent node of the non-root node. By associating the given node identifiers, the parent-child relationship between the nodes constituting the tree-type data structure is expressed, and the entity information representing the path and the stored value of the node is associated with each node, and the tree-type data structure is Data expansion means constructed on a storage device;
A node group that specifies the first search condition and the second search condition related to a path and / or a node storage value and includes a vertex node that is a specific node of a tree-type data structure and descendant nodes of the vertex node Condition designation means for designating a search range using a vertex node list that is an array of node identifiers of vertex nodes representing the partial tree by representing a partial tree by an identifier assigned to the vertex node;
In accordance with the first search condition, a first vertex node list including a vertex node representing a partial tree to which a node matching the first search condition belongs by tracing a parent-child relationship between the nodes within the search range. A vertex node representing a partial tree to which a node that is stored as a first search result and traces the parent-child relationship between the nodes within the search range and matches the second search condition according to the second search condition Search means for storing a node list of the second vertex including the second search result,
By executing a logical operation corresponding to a logical combination of the first search condition and the second search condition on the first vertex node list and the second vertex node list, the first search condition And a combination means for generating a search result that logically combines the second search condition and
An information processing apparatus.
ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータを集計する情報処理装置であって、
ルート・ノードを含む全ノードに、0又は1から始まる整数連番である固有のノード識別子を付与し、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、各ノードに当該ノードのノードタイプ及びノード格納値を表す実体情報を関連付け、ツリー型データ構造を記憶装置上に展開するデータ展開手段と、
集計の分類対象を表す第1のノードタイプを指定し、集計の対象を表す第2のノードタイプを指定し、ツリー型データ構造の特定のノードである頂点ノードと当該頂点ノードの子孫ノードとを含むノード群である部分ツリーを当該頂点ノードに付与された識別子によって代表させることにより、部分ツリーを代表する頂点ノードのノード識別子からなる配列である頂点ノードリストを用いて集計の範囲を指定する条件指定手段と、
集計の範囲に含まれる各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーに属するノード群を特定し、当該ノード群の中に集計の対象を表す第2のノードタイプが関連付けられたノードが存在するかどうかを判定し、存在する場合に、当該ノードに関連付けられたノード格納値を、当該部分ツリーに属するノード群に関係した集計の分類対象を表す第1のノードタイプ毎に集計する集計手段と、
を有する情報処理装置。
An information processing apparatus that 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, and that aggregates data stored in the storage device,
All nodes including the root node are assigned a unique node identifier that is an integer sequence number starting from 0 or 1, and the node identifier assigned to each non-root node is assigned to each parent node of the non-root node. By associating the given node identifiers, the parent-child relationship between the nodes constituting the tree-type data structure is expressed, and each node is associated with the entity information indicating the node type and the stored value of the node, and the tree-type data structure Data expansion means for expanding the data on the storage device;
Specify the first node type that represents the classification target of aggregation, specify the second node type that represents the aggregation target, and specify the vertex node that is a specific node of the tree-type data structure and the descendant nodes of the vertex node A condition that specifies the range of aggregation using a vertex node list that is an array of node identifiers of the vertex nodes that represent the partial tree, by representing the partial tree that is the node group that is included by the identifier assigned to the vertex node. Designation means;
For each partial tree included in the aggregation range, the node group belonging to the partial tree is identified by tracing the parent-child relationship between the nodes, and the second node type representing the aggregation target is associated with the node group. The node storage value associated with the node is determined for each first node type representing the classification target of aggregation related to the node group belonging to the partial tree. A counting means for counting,
An information processing apparatus.
ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータの少なくとも二つのノード群に順序を付ける情報処理装置であって、
ルート・ノードを含む全ノードに、0又は1から始まる整数連番である固有のノード識別子を付与し、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、各ノードに当該ノードのノードタイプ及びノード格納値を表す実体情報を関連付け、ツリー型データ構造を記憶装置上に展開するデータ展開手段と、
集計の対象を表すノードタイプを指定し、ツリー型データ構造の特定のノードである頂点ノードと当該頂点ノードの子孫ノードとを含むノード群である部分ツリーを当該頂点ノードに付与された識別子によって代表させることにより、少なくとも二つの部分ツリーを代表する頂点ノードのノード識別子からなる配列である頂点ノードリストを用いて集計の範囲を指定する条件指定手段と、
集計の範囲に含まれる各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーに属するノード群を特定し、当該ノード群の中に集計の対象を表すノードタイプが関連付けられたノードが存在するかどうかを判定し、存在する場合に、当該ノードに関連付けられたノード格納値を集計する集計手段と、
部分ツリー毎に集計されたノード格納値の順序関係に従って当該少なくとも二つの部分ツリーに順序を付ける順序付け手段と、
を有する情報処理装置。
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 orders at least two nodes of the data stored in the storage device An information processing apparatus,
All nodes including the root node are assigned a unique node identifier that is an integer sequence number starting from 0 or 1, and the node identifier assigned to each non-root node is assigned to each parent node of the non-root node. By associating the given node identifiers, the parent-child relationship between the nodes constituting the tree-type data structure is expressed, and each node is associated with the entity information indicating the node type and the stored value of the node, and the tree-type data structure Data expansion means for expanding the data on the storage device;
Specify a node type that represents the target of aggregation, and represent a partial tree that is a node group that includes a vertex node that is a specific node of the tree-type data structure and descendant nodes of the vertex node by an identifier assigned to the vertex node. By specifying a range of aggregation using a vertex node list that is an array of node identifiers of vertex nodes representing at least two partial trees,
For each partial tree included in the range of aggregation, a node group belonging to the partial tree is identified by tracing the parent-child relationship between the nodes, and a node associated with a node type representing an aggregation target is included in the node group. An aggregation means for determining whether or not the node exists and, if present, a node storage value associated with the node;
Ordering means for ordering the at least two partial trees according to the order relation of the node stored values aggregated for each partial tree;
An information processing apparatus.
ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを記憶する記憶装置を有し、記憶装置に記憶されたデータの少なくとも二つのノード群に順序を付ける情報処理装置であって、
ルート・ノードを含む全ノードに、0又は1から始まる整数連番である固有のノード識別子を付与し、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子を関連付け、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、各ノードに当該ノードのノードタイプ及びノード格納値を表す実体情報を関連付け、ツリー型データ構造のデータを記憶装置上に展開するデータ展開手段と、
ツリー型データ構造の特定のノードである頂点ノードと当該頂点ノードの子孫ノードとを含むノード群である部分ツリーを当該頂点ノードに付与された識別子によって代表させることにより、少なくとも二つの部分ツリーを代表する頂点ノードのノード識別子からなる配列である頂点ノードリストを用いて順序付けの対象を指定し、順序付けの指標となるノードタイプを指定する条件指定手段と、
順序付けの対象に含まれる各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーに属するノード群を特定し、当該ノード群の中で、順序付けの指標となるノードタイプが関連付けられたノードに関連付けられたノード格納値を取得する指標取得手段と、
部分ツリー毎に取得されたノード格納値の順序関係に従って当該少なくとも二つの部分ツリーに順序を付ける順序付け手段と、
を有する情報処理装置。
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 orders at least two nodes of the data stored in the storage device An information processing apparatus,
All nodes including the root node are assigned a unique node identifier that is an integer sequence number starting from 0 or 1, and the node identifier assigned to each non-root node is assigned to each parent node of the non-root node. By associating the given node identifiers, the parent-child relationship between the nodes constituting the tree-type data structure is expressed, and each node is associated with the entity information indicating the node type and the stored value of the node, and the tree-type data structure Data expansion means for expanding the data on the storage device;
Represent at least two partial trees by representing a partial tree that is a node group including a vertex node that is a specific node of the tree-type data structure and descendant nodes of the vertex node by an identifier assigned to the vertex node. A condition designating unit for designating an ordering target by using a vertex node list that is an array of node identifiers of the vertex nodes to be designated, and for designating a node type as an index for ordering;
For each partial tree included in the ordering target, a node group belonging to the partial tree is identified by tracing the parent-child relationship between the nodes, and a node type associated with the node type serving as an index for ordering is associated with the node group Index acquisition means for acquiring a node stored value associated with
Ordering means for ordering the at least two partial trees according to the order relation of the node stored values acquired for each partial tree;
An information processing apparatus.
ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを記憶する記憶装置を有するコンピュータに、記憶装置に記憶されたデータを検索する検索機能を実現させるためのプログラムであって、
ルート・ノードを含む全ノードに、0又は1から始まる整数連番である固有のノード識別子が付与され、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、
各ノードに当該ノードのパス及びノード格納値を表す実体情報が関連付けられ、
ツリー型データ構造の特定のノードである頂点ノードと当該頂点ノードの子孫ノードとを含むノード群である部分ツリーが、当該頂点ノードに付与されたノード識別子によって代表され、
前記検索機能は、
パス及び/又はノード格納値に関する検索条件を指定し、部分ツリーを代表する頂点ノードのノード識別子からなる配列である頂点ノードリストを用いて検索範囲を指定する機能と、
検索範囲に含まれるノード毎に、当該ノードに関連付けられた実体情報が前記検索条件と一致するかどうかを判定し、一致した場合に当該ノードに検索ヒット情報を関連付け、前記ノード間の親子関係を辿って当該ノードの祖先ノードに検索ヒット情報を関連付ける機能と、
検索ヒット情報が関連付けられたノードを含む部分ツリーを代表する頂点ノードリストを検索結果として保存する機能と、を含む、プログラム。
To realize a search function for retrieving data stored in a storage device in a computer having 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 The program of
All nodes including the root node are given a unique node identifier that is an integer sequence number starting from 0 or 1. The node identifier assigned to each non-root node is assigned to each parent node of the non-root node. The given node identifier is associated, thereby expressing the parent-child relationship between the nodes that make up the tree-type data structure,
Each node is associated with entity information representing the path of the node and the stored value of the node,
A partial tree that is a node group including a vertex node that is a specific node of a tree-type data structure and descendant nodes of the vertex node is represented by a node identifier assigned to the vertex node,
The search function
A function for designating a search condition regarding a path and / or a node storage value and designating a search range using a vertex node list which is an array of node identifiers of vertex nodes representing a partial tree;
For each node included in the search range, 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. A function of tracing and associating search hit information with an ancestor node of the node,
And a function of storing a vertex node list representing a partial tree including a node associated with search hit information as a search result.
前記検索ヒット情報を関連付ける機能において、前記ノード間の親子関係が頂点ノードの個数に応じて、親ノードから子ノード又は子ノードから親ノードの順番に辿られる、請求項19に記載のプログラム。  The program according to claim 19, wherein in the function of associating the search hit information, the parent-child relationship between the nodes is traced from a parent node to a child node or from a child node to a parent node in accordance with the number of vertex nodes. ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを記憶する記憶装置を有するコンピュータに、記憶装置に記憶されたデータを検索する検索機能を実現させるためのプログラムであって、
ルート・ノードを含む全ノードに、0又は1から始まる整数連番である固有のノード識別子が付与され、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、
各ノードに当該ノードのパス及びノード格納値を表す実体情報が関連付けられ、
前記検索機能は、
パス及び/又はノード格納値に関する検索条件を指定し、ツリー型データ構造の特定のノードである頂点ノードと当該頂点ノードの子孫ノードとを含むノード群である部分ツリーを当該頂点ノードに付与された識別子によって代表させることにより、部分ツリーを代表する頂点ノードのノード識別子からなる配列である頂点ノードリストを用いて検索範囲を指定する機能と、
検索範囲に含まれる各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーと特定の関係にあるノードに関連付けられた実体情報が前記検索条件と一致するかどうかを判定し、一致したノードが存在する場合に、当該部分ツリーを代表する頂点ノードを含む頂点ノードリストを検索結果として保存する機能と、
を含む、プログラム。
To realize a search function for retrieving data stored in a storage device in a computer having 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 The program of
All nodes including the root node are given a unique node identifier that is an integer sequence number starting from 0 or 1. The node identifier assigned to each non-root node is assigned to each parent node of the non-root node. The given node identifier is associated, thereby expressing the parent-child relationship between the nodes that make up the tree-type data structure,
Each node is associated with entity information representing the path of the node and the stored value of the node,
The search function
A search condition related to a path and / or node storage value is specified, and a partial tree that is a node group including a vertex node that is a specific node of a tree-type data structure and descendant nodes of the vertex node is assigned to the vertex node By representing by an identifier, a function for designating a search range using a vertex node list that is an array of node identifiers of vertex nodes representing a partial tree;
For each partial tree included in the search range, the parent-child relationship between the nodes is traced to determine whether the entity information associated with the node having a specific relationship with the partial tree matches the search condition. A function of saving a vertex node list including a vertex node representing the partial tree as a search result when a node exists;
Including the program.
前記検索結果として保存する機能において、当該部分ツリーと特定の関係にあるノードが当該部分ツリーに属するノードである、請求項21に記載のプログラム。  The program according to claim 21, wherein, in the function of saving as the search result, a node having a specific relationship with the partial tree is a node belonging to the partial tree. 前記検索結果として保存する機能において、当該部分ツリーと特定の関係にあるノードが当該部分ツリーの祖先ノード及び/又は当該部分ツリーの頂点ノードである、請求項21に記載のプログラム。  The program according to claim 21, wherein in the function of saving as the search result, a node having a specific relationship with the partial tree is an ancestor node of the partial tree and / or a vertex node of the partial tree. ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを記憶する記憶装置を有するコンピュータに、第1の検索条件と第2の検索条件を論理的に組み合わせて検索する検索機能を実現させるためのプログラムであって、
ルート・ノードを含む全ノードに、0又は1から始まる整数連番である固有のノード識別子が付与され、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、
各ノードに当該ノードのパス及びノード格納値を表す実体情報が関連付けられ、
前記検索機能は、
パス及び/又はノード格納値に関する前記第1の検索条件及び前記第2の検索条件を指定し、ツリー型データ構造の特定のノードである頂点ノードと当該頂点ノードの子孫ノードとを含むノード群である部分ツリーを当該頂点ノードに付与された識別子によって代表させることにより、部分ツリーを代表する頂点ノードのノード識別子からなる配列である頂点ノードリストを用いて検索範囲を指定する機能と、
前記第1の検索条件に従って、前記検索範囲内で前記ノード間の親子関係を辿って当該第1の検索条件に一致するノードが属する部分ツリーを代表する頂点ノードを含む第1の頂点ノードリストを第1の検索結果として保存し、前記第2の検索条件に従って、前記検索範囲内で前記ノード間の親子関係を辿って当該第1の検索条件に一致するノードが属する部分ツリーを代表する頂点ノードを含む第2の頂点ノードリストを第2の検索結果として保存する機能と、
前記第1の検索条件と前記第2の検索条件の論理的な組み合わせに対応した論理演算を前記第1の頂点ノードリストと前記第2の頂点ノードリストに実行することにより、第1の検索条件と第2の検索条件を論理的に組み合わせた検索結果を生成する機能と、
を含む、プログラム。
A logical combination of a first search condition and a second search condition in a computer having 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 program for realizing a search function to search for
All nodes including the root node are given a unique node identifier that is an integer sequence number starting from 0 or 1. The node identifier assigned to each non-root node is assigned to each parent node of the non-root node. The given node identifier is associated, thereby expressing the parent-child relationship between the nodes that make up the tree-type data structure,
Each node is associated with entity information representing the path of the node and the stored value of the node,
The search function
A node group that specifies the first search condition and the second search condition related to a path and / or a node storage value and includes a vertex node that is a specific node of a tree-type data structure and descendant nodes of the vertex node A function for designating a search range using a vertex node list that is an array of node identifiers of vertex nodes representing a partial tree by representing a partial tree by an identifier assigned to the vertex node;
In accordance with the first search condition, a first vertex node list including a vertex node representing a partial tree to which a node matching the first search condition belongs by tracing a parent-child relationship between the nodes within the search range. A vertex node representing a partial tree to which a node that is stored as a first search result and traces the parent-child relationship between the nodes within the search range according to the second search condition and that matches the first search condition belongs A function of saving a second vertex node list including the second search result as a second search result;
By executing a logical operation corresponding to a logical combination of the first search condition and the second search condition on the first vertex node list and the second vertex node list, the first search condition And a function for generating a search result logically combining the second search condition and
Including the program.
ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを記憶する記憶装置を有するコンピュータに、記憶装置に記憶されたデータを集計する集計機能を実現させるためのプログラムであって、
ルート・ノードを含む全ノードに、0又は1から始まる整数連番である固有のノード識別子が付与され、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、
各ノードに当該ノードのノードタイプ及びノード格納値を表す実体情報が関連付けられ、
前記集計機能は、
集計の分類対象を表す第1のノードタイプを指定し、集計の対象を表す第2のノードタイプを指定し、ツリー型データ構造の特定のノードである頂点ノードと当該頂点ノードの子孫ノードとを含むノード群である部分ツリーを当該頂点ノードに付与された識別子によって代表させることにより、部分ツリーを代表する頂点ノードのノード識別子からなる配列である頂点ノードリストを用いて集計の範囲を指定する機能と、
集計の範囲に含まれる各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーに属するノード群を特定し、当該ノード群の中に集計の対象を表す第2のノードタイプが関連付けられたノードが存在するかどうかを判定し、存在する場合に、当該ノードに関連付けられたノード格納値を、当該部分ツリーに属するノード群に関係した集計の分類対象を表す第1のノードタイプ毎に集計する機能と、
を含む、プログラム。
A computer having a storage device for storing 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 provided with a totaling function for summing up data stored in the storage device The program of
All nodes including the root node are given a unique node identifier that is an integer sequence number starting from 0 or 1. The node identifier assigned to each non-root node is assigned to each parent node of the non-root node. The given node identifier is associated, thereby expressing the parent-child relationship between the nodes that make up the tree-type data structure,
Each node is associated with entity information representing the node type and node stored value of the node,
The aggregation function is
Specify the first node type that represents the classification target of aggregation, specify the second node type that represents the aggregation target, and specify the vertex node that is a specific node of the tree-type data structure and the descendant nodes of the vertex node A function that designates a range of aggregation using a vertex node list that is an array of node identifiers of vertex nodes representing the partial tree by representing the partial tree that is a group of nodes represented by the identifier assigned to the vertex node. When,
For each partial tree included in the aggregation range, the node group belonging to the partial tree is identified by tracing the parent-child relationship between the nodes, and the second node type representing the aggregation target is associated with the node group. The node storage value associated with the node is determined for each first node type representing the classification target of aggregation related to the node group belonging to the partial tree. A function to aggregate,
Including the program.
ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを記憶する記憶装置を有するコンピュータに、記憶装置に記憶されたデータの少なくとも二つのノード群に順序を付ける順序付け機能を実現させるためのプログラムであって、
ルート・ノードを含む全ノードに、0又は1から始まる整数連番である固有のノード識別子が付与され、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、
各ノードに当該ノードのノードタイプ及びノード格納値を表す実体情報が関連付けられ、
前記順序付け機能は、
集計の対象を表すノードタイプを指定し、ツリー型データ構造の特定のノードである頂点ノードと当該頂点ノードの子孫ノードとを含むノード群である部分ツリーを当該頂点ノードに付与された識別子によって代表させることにより、少なくとも二つの部分ツリーを代表する頂点ノードのノード識別子からなる配列である頂点ノードリストを用いて集計の範囲を指定する機能と、
集計の範囲に含まれる各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーに属するノード群を特定し、当該ノード群の中に集計の対象を表すノードタイプが関連付けられたノードが存在するかどうかを判定し、存在する場合に、当該ノードに関連付けられたノード格納値を集計する機能と、
部分ツリー毎に集計されたノード格納値の順序関係に従って当該少なくとも二つの部分ツリーに順序を付ける機能と、
を含む、プログラム。
A computer having a storage device for storing data of a tree-type data structure including a root node and a non-root node which is a node other than the root node is arranged in a sequence for at least two nodes of data stored in the storage device. A program for realizing the ordering function to be attached,
All nodes including the root node are given a unique node identifier that is an integer sequence number starting from 0 or 1. The node identifier assigned to each non-root node is assigned to each parent node of the non-root node. The given node identifier is associated, thereby expressing the parent-child relationship between the nodes that make up the tree-type data structure,
Each node is associated with entity information representing the node type and node stored value of the node,
The ordering function is:
Specify a node type that represents the target of aggregation, and represent a partial tree that is a node group that includes a vertex node that is a specific node of the tree-type data structure and descendant nodes of the vertex node by an identifier assigned to the vertex node. A function for designating a range of aggregation using a vertex node list that is an array of node identifiers of vertex nodes representing at least two partial trees,
For each partial tree included in the range of aggregation, a node group belonging to the partial tree is identified by tracing the parent-child relationship between the nodes, and a node associated with a node type representing an aggregation target is included in the node group. A function for determining whether or not the node exists and, if it exists, a node storage value associated with the node;
A function of ordering the at least two partial trees according to the order relation of the node stored values aggregated for each partial tree;
Including the program.
ルート・ノードとルート・ノード以外のノードである非ルート・ノードを含むツリー型データ構造のデータを記憶する記憶装置を有するコンピュータに、記憶装置に記憶されたデータの少なくとも二つのノード群に順序を付ける順序付け機能を実現させるためのプログラムであって、
ルート・ノードを含む全ノードに、0又は1から始まる整数連番である固有のノード識別子が付与され、非ルート・ノードの各々に付与されたノード識別子に非ルート・ノードの各々の親ノードに付与されたノード識別子が関連付けられ、これにより、ツリー型データ構造を構成するノード間の親子関係が表現され、
各ノードに当該ノードのノードタイプ及びノード格納値を表す実体情報が関連付けられ、
前記順序付け機能は、
ツリー型データ構造の特定のノードである頂点ノードと当該頂点ノードの子孫ノードとを含むノード群である部分ツリーを当該頂点ノードに付与された識別子によって代表させることにより、少なくとも二つの部分ツリーを代表する頂点ノードのノード識別子からなる配列である頂点ノードリストを用いて順序付けの対象を指定し、順序付けの指標となるノードタイプを指定する機能と、
順序付けの対象に含まれる各部分ツリーについて、前記ノード間の親子関係を辿って当該部分ツリーに属するノード群を特定し、当該ノード群の中で、順序付けの指標となるノードタイプが関連付けられたノードに関連付けられたノード格納値を取得する機能と、
部分ツリー毎に取得されたノード格納値の順序関係に従って当該少なくとも二つの部分ツリーに順序を付ける機能と、
を含む、プログラム。
A computer having a storage device for storing data of a tree-type data structure including a root node and a non-root node which is a node other than the root node is arranged in a sequence for at least two nodes of data stored in the storage device. A program for realizing the ordering function to be attached,
All nodes including the root node are given a unique node identifier that is an integer sequence number starting from 0 or 1. The node identifier assigned to each non-root node is assigned to each parent node of the non-root node. The given node identifier is associated, thereby expressing the parent-child relationship between the nodes that make up the tree-type data structure,
Each node is associated with entity information representing the node type and node stored value of the node,
The ordering function is:
Represent at least two partial trees by representing a partial tree that is a node group including a vertex node that is a specific node of the tree-type data structure and descendant nodes of the vertex node by an identifier assigned to the vertex node. A function for designating an ordering target using a vertex node list that is an array of node identifiers of vertex nodes to be designated, and a node type that is an index for ordering;
For each partial tree included in the ordering target, a node group belonging to the partial tree is identified by tracing the parent-child relationship between the nodes, and a node type associated with the node type serving as an index for ordering is associated with the node group The ability to retrieve the stored value of the node associated with
A function for ordering the at least two partial trees according to the order relation of the node stored values acquired for each partial tree;
Including the program.
請求項19乃至27のうちいずれか1項に記載のプログラムを記録したコンピュータ読み取り可能な記録媒体。  A computer-readable recording medium on which the program according to any one of claims 19 to 27 is recorded.
JP2006544997A 2004-11-17 2005-11-14 Tree data search / aggregation / sorting method and program Expired - Fee Related JP4796970B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006544997A JP4796970B2 (en) 2004-11-17 2005-11-14 Tree data search / aggregation / sorting method and program

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
JP2004333783 2004-11-17
JP2004333783 2004-11-17
JP2006544997A JP4796970B2 (en) 2004-11-17 2005-11-14 Tree data search / aggregation / sorting method and program
PCT/JP2005/020808 WO2006054506A1 (en) 2004-11-17 2005-11-14 Tree data retrieving/accumulating/sorting method and program

Publications (2)

Publication Number Publication Date
JPWO2006054506A1 JPWO2006054506A1 (en) 2008-08-07
JP4796970B2 true JP4796970B2 (en) 2011-10-19

Family

ID=36407049

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006544997A Expired - Fee Related JP4796970B2 (en) 2004-11-17 2005-11-14 Tree data search / aggregation / sorting method and program

Country Status (2)

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

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8718030B2 (en) * 2007-03-26 2014-05-06 Qualcomm Incorporated Methods and apparatus for performing channel tree operations
JP5915033B2 (en) * 2011-09-01 2016-05-11 富士ゼロックス株式会社 Medical information search device and program
EP3376407B1 (en) * 2017-03-15 2020-09-16 censhare AG Efficient use of trie data structure in databases
CN110765123A (en) * 2018-07-09 2020-02-07 株式会社日立制作所 Material data storage method, device and system based on tree structure
CN110889022A (en) * 2018-08-17 2020-03-17 迈普通信技术股份有限公司 Data query method and device and electronic equipment
CN111414347B (en) * 2019-01-04 2023-06-20 阿里巴巴集团控股有限公司 Node information processing method and device, output method and storage and electronic equipment
CN111314245B (en) * 2020-01-17 2023-10-24 鹏城实验室 Message scheduling method and device, storage medium and electronic equipment
CN111553637B (en) * 2020-04-29 2023-09-26 杭州网易再顾科技有限公司 Method and device for generating pickup path, electronic equipment and storage medium
CN116150436B (en) * 2023-04-14 2023-08-08 北京锐服信科技有限公司 Data display method and system based on node tree
CN116680252A (en) * 2023-06-13 2023-09-01 智研汇(上海)科技有限公司 Tree data structure and node batch moving method thereof
CN117194739B (en) * 2023-09-12 2024-04-19 北京云枢创新软件技术有限公司 Method, electronic equipment and medium for searching hierarchical tree nodes based on hit state

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07319918A (en) * 1994-05-24 1995-12-08 Fuji Xerox Co Ltd Device for specifying retrieving object in document
JPH10240741A (en) * 1997-02-28 1998-09-11 Nippon Telegr & Teleph Corp <Ntt> Managing method for tree structure type data
JPH11110384A (en) * 1997-07-01 1999-04-23 Hitachi Ltd Method and device for retrieving and displaying structured document
JPH11195026A (en) * 1997-12-26 1999-07-21 Hitachi Ltd Directory server and information managing method used for the same
JP2004120657A (en) * 2002-09-27 2004-04-15 Internatl Business Mach Corp <Ibm> Tree structure document transmitting-receiving system, tree structure document transmitting apparatus, tree structure document receiving apparatus, tree structure document transmitting-receiving method, tree structure document transmitting method, tree structure document receiving method, and program
JP2004178084A (en) * 2002-11-25 2004-06-24 Systems Engineering Constructions Co Ltd Method, device and program for storing xml data, and recording medium with program recorded thereon

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07319918A (en) * 1994-05-24 1995-12-08 Fuji Xerox Co Ltd Device for specifying retrieving object in document
JPH10240741A (en) * 1997-02-28 1998-09-11 Nippon Telegr & Teleph Corp <Ntt> Managing method for tree structure type data
JPH11110384A (en) * 1997-07-01 1999-04-23 Hitachi Ltd Method and device for retrieving and displaying structured document
JPH11195026A (en) * 1997-12-26 1999-07-21 Hitachi Ltd Directory server and information managing method used for the same
JP2004120657A (en) * 2002-09-27 2004-04-15 Internatl Business Mach Corp <Ibm> Tree structure document transmitting-receiving system, tree structure document transmitting apparatus, tree structure document receiving apparatus, tree structure document transmitting-receiving method, tree structure document transmitting method, tree structure document receiving method, and program
JP2004178084A (en) * 2002-11-25 2004-06-24 Systems Engineering Constructions Co Ltd Method, device and program for storing xml data, and recording medium with program recorded thereon

Also Published As

Publication number Publication date
WO2006054506A1 (en) 2006-05-26
JPWO2006054506A1 (en) 2008-08-07

Similar Documents

Publication Publication Date Title
JP4796970B2 (en) Tree data search / aggregation / sorting method and program
JP4653157B2 (en) Tree search, aggregation, sorting method, information processing apparatus, and tree search, aggregation, sorting program
JP4537391B2 (en) Method, information processing apparatus, and program for handling tree-type data structure
JP4681544B2 (en) Array generation method, information processing apparatus, and program
US7444325B2 (en) Method and system for information extraction
JP4712718B2 (en) Array generation method and array generation program
JP5423676B2 (en) Data classification system, data classification method, and data classification program
WO2007020850A1 (en) Information processing method, information processing device, and information processing program
JP4681555B2 (en) Node insertion method, information processing apparatus, and node insertion program
JP5716966B2 (en) Data analysis apparatus, data analysis method and program
Wellenzohn et al. Dynamic interleaving of content and structure for robust indexing of semi-structured hierarchical data (extended version)
JP2005122509A (en) Program, system and method for analyzing hierarchical structure data
JP4951407B2 (en) Content parts retrieval method and apparatus
EP1681643B1 (en) Method and system for information extraction
JPWO2007066414A1 (en) Program and data extraction method
JP5633589B2 (en) Program, data extraction apparatus, and method
JPH07129610A (en) Similar shape retrieval device
Ho et al. ÀF-Tree: An Efficient and Flexible Àtructure for Estimating Àelectivity of Àimple Path Expressions with Àtatistical Accuracy Guarantee
JP2014199678A (en) Extraction control program, extraction control method, and extraction control device

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20081105

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20081105

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20110719

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110801

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140805

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees