JP2010108192A - Xml data retrieval method, device, and program - Google Patents
Xml data retrieval method, device, and program Download PDFInfo
- Publication number
- JP2010108192A JP2010108192A JP2008278883A JP2008278883A JP2010108192A JP 2010108192 A JP2010108192 A JP 2010108192A JP 2008278883 A JP2008278883 A JP 2008278883A JP 2008278883 A JP2008278883 A JP 2008278883A JP 2010108192 A JP2010108192 A JP 2010108192A
- Authority
- JP
- Japan
- Prior art keywords
- node
- path
- search
- nodes
- xml data
- 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.)
- Granted
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
本発明は、XMLデータ検索方法及び装置及びプログラムに係り、特に、構造化データである多数のXMLデータを蓄積・検索するデータベース/インデクスの分野で、蓄積したXMLデータの要約した構造情報を用いることで、検索実行時の処理を効率化することで、検索を高速に行うXMLデータ検索方法及び装置及びプログラムに関する。 The present invention relates to an XML data search method, apparatus, and program, and more particularly, to use summarized structure information of stored XML data in the field of a database / index for storing and searching a large number of XML data as structured data. Thus, the present invention relates to an XML data search method, apparatus, and program for performing search at high speed by improving the efficiency of the search execution process.
XMLとはマークアップ言語の一つで、XMLで記述されたデータは構造化され、構造に意味を持ったデータである。図17は、XMLデータとその構造を示した図である。XMLデータを構成する要素を識別するために使われるマークを「タグ」と呼び、タグに挟まれた間に値(テキスト)を記述する。タグは入れ子にすることができる。 XML is one of markup languages, and data described in XML is structured and meaningful in structure. FIG. 17 is a diagram showing XML data and its structure. A mark used to identify an element constituting XML data is called a “tag”, and a value (text) is described between the tags. Tags can be nested.
したがって、XMLデータは木構造で表すことができ、各節を「ノード」と呼ぶ。特に、根のノードを「ルート要素」("book")、値(記述内容)を「テキストノード」("宇宙の不思議")、タグ中に記述されたものを「属性」("no=1")と呼ぶ。 Therefore, XML data can be represented by a tree structure, and each node is called a “node”. In particular, the root node is “root element” (“book”), the value (description content) is “text node” (“mystery of the universe”), and what is described in the tag is “attribute” (“no = 1”) ").
各ノードは、"/"の後ろにルート要素からのタグを"/"で繋げた「パス」で指定する。例えば、本のタイトルを対象としたい場合、パスを「/book/title」と指定する。 Each node is specified by a “path” in which a tag from the root element is connected by “/” after “/”. For example, if you want to target the title of a book, specify the path as "/ book / title".
XMLデータに対して効率的な検索を実現しようとした場合、構造から記述内容を高速に取り出すことが可能でなければならない。一般的には、XMLデータの構造と記述内容を記録したインデクス(構造インデクス)を予め構築しておく。構造インデクスの構築は様々な方法が存在するが、多くの場合、XMLデータの持つ全てのパスと、該パスに指定される記述内容を関係付けるインデクスが構築される(例えば、特許文献1参照)。
XMLデータの検索の検索クエリには、パスとその値の制約が検索条件として指定される。例えば、XPath(XMLデータ中の特定の要素を指し示す記述方法)では、以下のような記述がなされる。 In a search query for searching XML data, a path and its value are specified as search conditions. For example, in XPath (a description method indicating a specific element in XML data), the following description is made.
/book/chapter[title='惑星とは']
これは、[/book/chapter/title]パスの値(テキスト)が「惑星とは」と記述されている[/book/chapter]を指している。
/ book / chapter [title = 'What is a planet']
This points to [/ book / chapter] where the value of [/ book / chapter / title] path (text) is described as "What is a planet?"
単純な検索手法としては、各XMLデータのルート要素から順次子ノードを辿っていき、検索条件に合ったノード群を探し出す方法があるが、大きなデータや多数のデータ群の場合や、パスが深いところを指している場合などには、走査に時間がかかってしまう。 As a simple search method, there is a method in which child nodes are sequentially traced from the root element of each XML data to find a node group that meets the search condition. However, in the case of large data or a large number of data groups, the path is deep. However, when it is pointing, it takes time to scan.
そこで、前述の特許文献1に示すような、処理に必要なノード群だけを直接取り出し、それらの親子/先祖子孫関係を判定することで、効率的な検索が行われる。ノード間の親子/先祖子孫関係の判定は、XMLデータの柔軟性から、1つのXMLデータ中に同一パスが繰り返し出現したり(図17の「/book/chapter」)、同一タグが再帰的に出現したり(図13の「title」)といった複雑な構造があり得るため、必要なものである。しかし実際には、1つのデータ中に1度しか出現しないパス・タグも多く、そのようなパスについても同等に処理を行うのは非効率である。
Therefore, as shown in the above-mentioned
本発明は、上記の点に鑑みなされたもので、複数回出現していないパスを対象とした検索をより効率的に行うことが可能なXMLデータ検索方法及び装置及びプログラムを提供することを目的とする。 The present invention has been made in view of the above points, and an object of the present invention is to provide an XML data search method, apparatus, and program capable of more efficiently performing a search for a path that does not appear multiple times. And
図1は、本発明の原理を説明するための図である。 FIG. 1 is a diagram for explaining the principle of the present invention.
本発明(請求項1)は、構造化データであるXML文書群の検索を行うXMLデータ検索方法であって、
XMLデータの構造と記述内容を管理するノード管理手段と、該XMLデータの持つ全てのパスと該パスに指定されるノードを関係付けるインデクスを構築し、保持するパスインデクス手段と、入力された検索クエリに含まれる検索パス及び検索キーワードに基づいて検索を行う検索手段と、を有する装置において、
ノード管理手段が、
取得したXML文書毎に文書IDを付与し、該XMLデータの各節である各ノードにノードIDを付与し、パスを特定し、該ノード間の親子・先祖子孫関係をノード情報としてノード情報記憶手段に格納するノード関係構築ステップ(ステップ1)を行い、
パスインデクス手段が、
ノード管理手段からパス、文書ID、ノード情報を取得し、XMLデータの持つ全てのパスと、該パスに指定されるノードを関係付けるノード関係情報を生成し、該パスが同一データで既出のパスである場合には、該パスに複数出現している旨の複数出現パス情報を付与し、パスインデクス記憶手段に格納するパスインデクス作成ステップ(ステップ2)を行い、
検索手段が、
検索パスに基づいて問い合わせ木を作成し、同一パスで複数出現しない問い合わせノード群を統合し、問い合わせノードを葉とし、親子・先祖子孫関係を示す関係判定ノードからなる実行木を生成する実行木作成ステップ(ステップ3)と、
問い合わせノードに基づいて、パスインデクス記憶手段と、ノード情報記憶手段からノード関係情報及びノード情報を取得するノード情報取得ステップ(ステップ4)と、
同一の文書IDを参照して、前記関係判定ノードの先祖となる問い合わせノードが複数出現している場合には、当該先祖となる問い合わせノードの前記ノード情報による親子・先祖子孫関係を判定し、適切な組み合わせを選択し、該問い合わせノードが1つの場合は同一データのものを組み合わせる関係判定ステップ(ステップ5)と、を行う。
The present invention (Claim 1) is an XML data retrieval method for retrieving an XML document group which is structured data,
Node management means for managing the structure and description contents of XML data, path index means for constructing and maintaining an index for associating all the paths of the XML data with the nodes specified in the path, and input search In a device having a search means for performing a search based on a search path and a search keyword included in a query,
Node management means
A document ID is assigned to each acquired XML document, a node ID is assigned to each node that is a section of the XML data, a path is specified, and node information is stored using the parent-child / ancestor-descendant relationship between the nodes as node information. Perform node relationship construction step (step 1) to be stored in the means,
The path index means
The path, document ID, and node information are acquired from the node management means, and node relation information that associates all the paths of the XML data with the node specified in the path is generated. If it is, a path index creating step (step 2) is performed in which multiple path information indicating that a plurality of paths have appeared is added and stored in the path index storage means,
Search means
Create a query tree based on the search path, integrate query nodes that do not appear multiple times in the same path, and create an execution tree that includes the query node as a leaf and a relationship determination node that indicates the parent-child / ancestor-descendant relationship Step (step 3);
Based on the inquiry node, a path index storage unit, a node information acquisition step (step 4) of acquiring node relation information and node information from the node information storage unit,
If multiple query nodes that are ancestors of the relationship determination node appear with reference to the same document ID, a parent-child / ancestor-descendant relationship is determined based on the node information of the query node that is the ancestor, and an appropriate If there is only one inquiry node, a relationship determination step (step 5) is performed for combining the same data.
また、本発明(請求項2)は、関係判定ステップ(ステップ5)において、
XMLデータの木構造におけるキストノード及び属性の値に対するインデクスを値インデクス記憶手段に保持しておき、
検索クエリに含まれる同一の検索パスに複数の制約があり、該検索パスが単一出現であれば、値インデクス記憶手段を参照して、該制約を満たすテキストノードを選択する。
In the present invention (Claim 2), in the relationship determining step (Step 5),
The index for the value of the text node and attribute in the tree structure of the XML data is stored in the value index storage means,
If there are a plurality of constraints on the same search path included in the search query and the search path appears as a single occurrence, the text index satisfying the constraint is selected with reference to the value index storage means.
図2は、本発明の原理構成図である。 FIG. 2 is a principle configuration diagram of the present invention.
本発明(請求項3)は、構造化データであるXML文書群の検索を行うXMLデータ検索装置であって、
取得したXML文書毎に文書IDを付与し、該XMLデータの各節である各ノードにノードIDを付与し、パスを特定し、該ノード間の親子・先祖子孫関係をノード情報としてノード情報記憶手段121に格納するノード管理手段120と、
ノード管理手段120からパス、文書ID、ノード情報を取得し、XMLデータの持つ全てのパスと、該パスに指定されるノードを関係付けるノード関係情報を生成し、該パスが同一データで既出のパスである場合には、該パスに複数出現している旨の複数出現パス情報を付与し、パスインデクス記憶手段111に格納するパスインデクス手段110と、
入力された検索クエリに含まれる検索パス及び検索キーワードに基づいて検索を行う検索手段140と、を有し、
検索手段140は、
検索パスに基づいて問い合わせ木を作成し、同一パスで複数出現しない問い合わせノード群を統合し、問い合わせノードを葉とし、親子・先祖子孫関係を示す関係判定ノードからなる実行木を生成する実行木作成手段141と、
問い合わせノードに基づいて、パスインデクス手段110のパスインデクス記憶手段111と、ノード管理手段120のノード情報記憶手段121からノード関係情報及びノード情報を取得するノード情報取得手段142と、
同一の文書IDを参照して、前記関係判定ノードの先祖となる問い合わせノードが複数出現している場合には、当該先祖となる問い合わせノードの前記ノード情報による親子・先祖子孫関係を判定し、適切な組み合わせを選択し、該問い合わせノードが1つの場合は同一データのものを組み合わせる関係判定手段143と、を有する。
The present invention (Claim 3) is an XML data retrieval apparatus for retrieving an XML document group which is structured data,
A document ID is assigned to each acquired XML document, a node ID is assigned to each node that is a section of the XML data, a path is specified, and node information is stored using the parent-child / ancestor-descendant relationship between the nodes as node information. Node management means 120 stored in the
The path, document ID, and node information are acquired from the
Search means 140 for performing a search based on a search path and a search keyword included in the input search query,
The search means 140 is
Create a query tree based on the search path, integrate query nodes that do not appear multiple times in the same path, and create an execution tree that includes the query node as a leaf and a relationship determination node that indicates the parent-child / ancestor-
Based on the inquiring node, the node
If multiple query nodes that are ancestors of the relationship determination node appear with reference to the same document ID, a parent-child / ancestor-descendant relationship is determined based on the node information of the query node that is the ancestor, and an appropriate And a relationship determination means 143 that combines the same data when there is one inquiry node.
また、本発明(請求項4)は、関係判定手段143は、
XMLデータの木構造におけるテキストノード及び属性の値に対するインデクスを値インデクス記憶手段に保持しておき、検索クエリに含まれる同一の検索パスに複数の制約があり、該検索パスが単一出現であれば、値インデクス記憶手段を参照して、該制約を満たすテキストノードを選択する
手段を含む。
In the present invention (Claim 4), the relationship determining means 143
Indexes for text nodes and attribute values in the XML data tree structure are stored in the value index storage means, and there are a plurality of restrictions on the same search path included in the search query. For example, it includes means for referring to the value index storage means and selecting text nodes that satisfy the constraint.
本発明(請求項5)は、請求項3または、4に記載のXMLデータ検索装置を構成する各手段としてコンピュータを機能させるためのXMLデータ検索プログラムである。
The present invention (Claim 5) is an XML data search program for causing a computer to function as each means constituting the XML data search apparatus according to
上記のように本発明によれば、XMLの木構造の親または先祖子孫関係となるノードが単一出現する場合には、同一データのものを組み合わせることで、検索を高速化することができる。 As described above, according to the present invention, when a single node having a parent or ancestor-descendant relationship of an XML tree structure appears, the search can be speeded up by combining the same data.
また、検索パスに制約条件がある場合に、テキストノード及び属性の値に対するインデクスの走査を一度に行うことができる。 Further, when there is a constraint condition in the search path, it is possible to scan the index for the text node and the attribute value at a time.
以下、図面と共に本発明の実施の形態を説明する。 Hereinafter, embodiments of the present invention will be described with reference to the drawings.
図3は、本発明の一実施の形態における検索装置の構成を示す。 FIG. 3 shows a configuration of the search device according to the embodiment of the present invention.
同図に示す検索装置100は、XMLの構造をパス単位で管理するパスインデクス部110と、XMLの各ノード間のXML構造における関係を把握するノード管理部120と、各ノードの値のインデクスを構築・管理する値インデクス部130と、検索を実行する検索部140と、を有する。パスインデクス部110とノード管理部120が、前述の背景技術で説明した構造インデクスに相当する。
The
パスインデクス部110は、XMLデータの持つ全てのパスと、当該パスに指定されるノードを関連付けるインデクスを構築し、パスインデクス記憶部111に保持する。構築の際には、パスが同一データ中で複数回出現したかについてもチェックし、パスインデックスと共に出現回数もパスインデクス記憶部111に格納する。
The
ノード管理部120は、各ノード間のXMLデータの構造上の関係を管理する。一般的には、構造上の関係を管理するために、XMLデータの各ノードにIDを付与し、ノード間の関係(先祖子孫関係など)をノード情報としてノード情報記憶部121に格納する。当該ノード情報としては、「範囲ラベル」がある。具体的な「範囲ラベル」の例としては、例えば特許文献1の技術を用いることができる。
The
値インデクス部130は、テキストノード及び属性の値に対するインデクス(B−Tree、ハッシュ、等)を構築し、値インデクス記憶部131で管理する。検索するだけであれば不要のものであるが、高速検索を実現するためには必要となる。
The
検索部140は、要求された検索クエリに含まれる検索パス及び検索キーワードに基づいて以下の手順を行う。
The
手順1.検索パスにマッチするノード(群)へのノード関係情報をパスインデクス部110から取得し、同時に、各パスが単一出現かどうかの情報も取得する。
手順2.上記のノード(群)に関するノード情報をノード管理部120から取得する。
(a)制約がある場合は、値インデックス部130から該当するノード(群)のみを選択する。この際、同一検索パスに対し、複数の制約がある場合は、パスが単一出現であれば、一度に走査できる場合がある。 "惑星とは"を制約の例とした場合、値(テキストノード)が"惑星とは"と完全一致しているという制約を持った「/book/chapter/title ノード群」であり、また、制約は「1以上 AND 2以下」と複数となることもある。
(A) When there is a restriction, only the corresponding node (group) is selected from the
手順3.親子/先祖子孫関係の判定を行う。ノード管理部120のノード記憶部121を参照して、親/先祖となるノード群が、単一出現か複数出現かにより処理を以下に分岐させる。
(a)複数出現ありの場合、親子/先祖子孫関係を判定し、適切な組み合わせのものを選択する(従来処理);
(b)単一出現の場合、同一データのものを組み合わせる;
という処理を行う。
(A) If there are multiple occurrences, determine the parent-child / ancestor-descendant relationship and select an appropriate combination (conventional processing);
(B) in the case of a single occurrence, combine the same data;
Perform the process.
すなわち、親/先祖候補のノード群が、複数出現する場合は従来通りの処理を行うが、単一出現の場合は、同一データに出現したかどうかを判定するだけ(上記3.(b))でよく、より高速な検索を実現できる。また同時に、複数の制約がある場合に、値インデクス部130の値インデクス記憶部131の走査を一度に行うことができ、高速化できる場合もある。
That is, when a plurality of parent / ancestor candidate node groups appear, the conventional processing is performed, but in the case of a single appearance, it is only determined whether or not they appear in the same data (3. (b) above). It is sufficient, and faster search can be realized. At the same time, when there are a plurality of restrictions, the value
以下に具体的な例を示す。図13のデータに対し、 Specific examples are shown below. For the data in FIG.
手順1.「/book/chapter」に相当するノード(3つ)を取得する。
手順2.
手順3.
手順4.上記の手順1のノードで、手順2と手順3の双方を子孫ノードに持つものを選択する。
これは、「/book/chapter」が複数回出現しており、候補となるノードも複数であるため、従来の処理手順である。 This is a conventional processing procedure because “/ book / chapter” appears multiple times and there are multiple candidate nodes.
これに対し、
/book[date/text()>='2008/01/01' and date/text()<='2008/12/31']
というXPathを処理する場合は、以下のような手順で行う(テキストノードは"text()"と表現する)。
In contrast,
/ book [date / text ()> = '2008/01/01' and date / text () <= '2008/12/31']
The XPath is processed in the following procedure (text node is expressed as "text ()").
手順1.「/book」に相当するノード(1つ)を取得する。
手順2.「/book/date」で値(テキストノード)が'2008/01/01'から'2008/12/31'のノード(1つ)を取得する。
手順3.手順1のノードで、手順2と同一データのものを選択する。
「/book/date/text()」が単一出現であるため、前述の例では、2回の手順となっていた制約付きノード取得が、手順2の1回で済んでおり、「/book」が単一出現であるため、手順3のノード選択も同一データかどうかのみの判定となっている。
Since “/ book / date / text ()” appears as a single occurrence, in the above example, constrained node acquisition, which was a two-time procedure, has been completed only once in the second step, and “/ book "Is a single appearance, the node selection in
同一データかどうかのみの判定でよい理由は、単一出現の場合、パスで親子/先祖子孫関係が自明であるため、省略できるからである。上記の例では、「/book/date/text()」が1つしかないのであれば、同一文書の「/book」の子孫でしかありえない。 The reason why it is only necessary to determine whether or not they are the same data is that, in the case of a single occurrence, the parent-child / ancestor-descendant relationship is obvious in the path and can be omitted. In the above example, if there is only one “/ book / date / text ()”, it can only be a descendant of “/ book” of the same document.
本発明の実施例として、前述の特許文献1の手法をベースに改良した例を説明する。
As an embodiment of the present invention, an example improved based on the method of
本実施例における検索装置は、図3に示すように、パスインデクス部110、ノード管理部120、値インデクス部130からなる。
As shown in FIG. 3, the search apparatus according to the present embodiment includes a
パスインデクス部110は、特許文献1の「要約情報」を管理するモジュールで、パスと、該パスに対応する各データのノードへの関係をパスインデクス記憶部111で保持し、加えて、単一出現かどうかの情報も保持する。
The
ノード管理部120は、図4に示すようなテーブルで各ノードの情報を管理する。図4に示すノード情報は、文書ID,preorder値、postorder値、タグ、値(value)からなる。なお、ノード情報は、図4に示すテーブル構成に限定されるものではなく、木構造の中で検索対象となるノードを特定する機能を持ち、先祖子孫関係を判定可能なものであればよい。以下では、「範囲ラベル」として、図5に示すように、ノード毎に2値(preorder値、postorder値)で表され、親ノードが子ノードを含むように付与する。これにより、任意のノード間で親子/先祖子孫関係を判定可能となる。
The
値インデクス部130は、テキストノード及び属性の値に対するインデクス(B-Tree、ハッシュ等)を構築・管理する。少なくともパスとその値の制限を条件に、検索が可能な形とする。例えば、パスと値の両方をキーに全てを対象としたインデクスを1つ作成してもよいし、パス毎に別々のインデクス(値がキーとなる)を作成してもよい。
The
検索部140は、検索クエリを受け取り、指定された検索パス及び検索キーワードにマッチするノードを、パスインデクス部110、ノード管理部120、値インデクス部130に問い合わせて特定し、当該ノードを検索結果として返却する。
The
以下に、XML文書の「格納フェイズ」、「検索フェイズ」からなる動作を説明する。 In the following, an operation consisting of “storage phase” and “search phase” of an XML document will be described.
<格納フェイズ>
当該格納フェイズでは、与えられたXML文書群から、各種インデクスを作成する。
<Storage phase>
In the storage phase, various indexes are created from the given XML document group.
XML文書群に対し、パスインデクス部110、ノード管理部120、値インデクス部130のそれぞれが処理を行う。
Each of the
図6は、本発明の一実施例の全体フローを示す。 FIG. 6 shows the overall flow of an embodiment of the present invention.
ステップ110) XML文書記憶装置10からXML文書を読み出す。
Step 110) The XML document is read from the XML
ステップ120) 読み出したXML文書毎に文書IDを付与する。 Step 120) A document ID is assigned to each read XML document.
ステップ130) ノード管理装置120において、以下の処理を行う。ノード管理装置120の動作を図7に示す。
Step 130) The
ノード管理装置120は、文書からノードを取り出し(ステップ131)、パスを特定し、パスインデックス部110に伝える(ステップ132)。次に、各ノード毎にノード間の関係(先祖子孫関係など)を表すノードID(範囲ラベル)を付与して(ステップ133)、ノード情報記憶部121に文書ID,ノードID等を格納する(ステップ134)。当該処理を全ノードについて繰り返す。
The
ステップ140)パスインデクス部110において、以下の処理を行う。パスインデクス部110の動作を図8に示す。
Step 140) The
パスインデクス部110は、ノード管理部120からパス、文書ID、ノード情報を受け取る(ステップ141)。ノード管理部120から受け取ったパスは同一データで既出のパスであるかをパスインデクス記憶部111を参照して判定し(ステップ142)、既出のパスでない場合は(ステップ142、No)、全データで既出のパスかを判定する(ステップ143)。既出のパスでない場合は(ステップ143、No),当該パスをパスインデクス記憶部111に新規登録する(ステップ144)。同一データで既出のパスである場合は(ステップ142、Yes)、当該パスに複数出現(multi)情報("true")を付与する(ステップ146)。さらに、図10に示すように、要約情報のパスとそれに相当するノード関係を保持する(ステップ145)。また、ステップ143において全データで既出のパスである場合(ステップ143、Yes)も、当該パスとノード情報の関連を保持する(ステップ145)。
The
なお、上記のステップ142において、既出のパスであるか否かを判定する際に、パスインデクス記憶部111の「multi」欄が"false"か"true"のいずれであるかにより判定する方法以外に、パス毎の出現回数を管理することも可能である。
Other than the method of determining whether the “multi” column of the path
図11に、インデクス記憶部111のストロングデータガイドの例を示す。ストロングデータガイドは、XML文書群の出現したパスを抽出してまとめたもので、パスの出現数や順序などは省略した要約情報である。図11のストロングデータガイドに上記のmulti情報を付与した例を図12に示す。
FIG. 11 shows an example of the strong data guide in the
<検索フェイズ>
図13は、本発明の一実施例の検索フェイズのフローを示す。
<Search phase>
FIG. 13 shows a flow of a search phase according to an embodiment of the present invention.
ステップ201) 検索部140は、図14に示すような問い合わせ木を作成する。
Step 201) The
ステップ202) 同一パスで複数出現していない問い合わせノード群を統合する。 Step 202) Integrate query nodes that do not appear multiple times in the same path.
ステップ203) 問い合わせノードを葉とし、先祖子孫関係を示す関係判定ノードを作成することにより、問い合わせ木に対する実行木を作成する。 Step 203) An execution tree for the query tree is created by creating a relationship determination node indicating the ancestor-descendant relationship with the query node as a leaf.
ステップ204) 問い合わせノードを選択する。 Step 204) Select an inquiry node.
ステップ205) パスインデクス部110、ノード管理部120から該当するノード情報(群)を取得する。
Step 205) The corresponding node information (group) is acquired from the
ステップ206) 値インデクス部130に問い合わせ値の制約を満たすものだけに絞り込む。
Step 206) The
ステップ207) 全ての問い合わせノード分、ステップ204以降の処理を繰り返す。 Step 207) The processing from step 204 onward is repeated for all inquiry nodes.
ステップ208) 関係判定ノードを選択する。 Step 208) A relationship determination node is selected.
ステップ209) 先祖となる問い合わせノードが複数出現しているかを判定し、出現している場合には、ステップ210に移行し、ステップ211に移行する。 Step 209) It is determined whether or not a plurality of inquiry nodes as ancestors have appeared. If they have appeared, the process proceeds to Step 210 and then to Step 211.
ステップ210) ノード管理部120から取得したノード群情報(範囲ラベル)に夜から構造ジョインにより、親子/先祖子孫関係を判定し、ステップ212に移行する。
Step 210) The parent-child / ancestor-descendant relationship is determined from the node group information (range label) acquired from the
ステップ211) ステップ209において、先祖となる問い合わせノードが単数の場合は文書IDのみのマッチングを行う。
Step 211) In
ステップ212) 全ての関係判定ノードに対して上記のステップ208以降の処理を繰り返す。 Step 212) The processing from step 208 onward is repeated for all relationship determination nodes.
ステップ213) 結果を組み立て、返却する。 Step 213) Assemble and return results.
以下に、具体的な例として、図17のデータに対し、 As a specific example, for the data in FIG.
XPathの問い合わせ木は、木で表現でき、図14のようになる(ステップ201)。同図において、二重線で囲まれている楕円のノードが、問い合わせノードを表している。同図(B)の例の場合、「/book/date/text()」の2つのノードが単一出現であることが図12からわかるため統合できる(ステップ202)。統合を行うことで、値インデクス部130に対する問い合わせ・絞込み処理が1回で行うことができる。
The XPath query tree can be expressed as a tree, as shown in FIG. 14 (step 201). In the figure, an elliptical node surrounded by a double line represents an inquiry node. In the case of the example shown in FIG. 12B, since it can be seen from FIG. 12 that two nodes “/ book / date / text ()” are single appearances, they can be integrated (step 202). By performing the integration, the inquiry / restriction process for the
次に、実行木を作成する(ステップ203)。図15に示すように、問い合わせノードを葉とし、先祖子孫関係を示す関係判定ノードを作成していく(ステップ204)。 Next, an execution tree is created (step 203). As shown in FIG. 15, a relation determination node indicating an ancestor-descendant relation is created using the inquiry node as a leaf (step 204).
次に、実行木に沿って、各処理を行っていく。まずは、葉ノードである問い合わせノードに対応するノード情報(範囲ラベル)をノード管理部120から取得する(ステップ205)。文書IDを"001"、範囲ラベルを図5に示す例とした場合、対応するノードは、図16に示すようになる。 Next, each process is performed along the execution tree. First, node information (range label) corresponding to an inquiry node that is a leaf node is acquired from the node management unit 120 (step 205). When the document ID is “001” and the range label is an example shown in FIG. 5, the corresponding nodes are as shown in FIG.
取得したノード情報群に対し、図16(A)の場合は、従来通り範囲ラベルによる構造ジョインを行って関係判定を行う(ステップ208、ステップ209,ステップ210)。ここで、「構造ジョイン」とは、直接親子関係だけでなく先祖子孫関係に対し、判別の組み合わせを選択することを指す。図16(B)の場合は、文書ID(この場合は"001"の合致)により判定を行う(ステップ208,ステップ209、ステップ211)。
In the case of FIG. 16A, the obtained node information group is subjected to a structure join using a range label as in the conventional case to determine the relationship (step 208,
最終的に得たノード情報から検索結果を組み立てて返却する(ステップ213)。 The search result is assembled and returned from the finally obtained node information (step 213).
なお、上記の実施の形態及び実施例における検索装置の構成要素の動作をプログラムとして構築し、検索装置として利用されるコンピュータにインストールする、または、ネットワークを介して流通させることが可能である。 In addition, it is possible to construct the operation of the constituent elements of the search device in the above-described embodiments and examples as a program and install it in a computer used as the search device, or distribute it via a network.
また、構築されたプログラムをハードディスクや、フレキシブルディスク・CD−ROM等の可搬記憶媒体に格納し、コンピュータにインストールする、または、配布することが可能である。 Further, the constructed program can be stored in a portable storage medium such as a hard disk, a flexible disk, or a CD-ROM, and can be installed or distributed in a computer.
なお、本発明は、上記の実施の形態及び実施例に限定されることなく、特許請求の範囲内において種々変更・応用が可能である。 The present invention is not limited to the above-described embodiments and examples, and various modifications and applications can be made within the scope of the claims.
本発明は、XMLデータ処理に適用可能である。 The present invention is applicable to XML data processing.
10 XMLデータ記憶装置
100 検索装置
110 パスインデクス手段、パスインデクス部
111 パスインデクス記憶手段、パスインデクス記憶部
120 ノード管理手段、ノード管理部
121 ノード情報記憶手段、ノード情報記憶部
130 値インデクス部
131 値インデクス記憶部
140 検索手段、検索部
141 実行木作成手段
142 ノード情報取得手段
143 関係判定手段
10 XML
Claims (5)
XMLデータの構造と記述内容を管理するノード管理手段と、該XMLデータの持つ全てのパスと、該パスに指定されるノードを関係付けるインデクスを構築し、保持するパスインデクス手段と、入力された検索クエリに含まれる検索パス及び検索キーワードに基づいて検索を行う検索手段と、を有する装置において、
前記ノード管理手段が、取得した前記XML文書毎に文書IDを付与し、該XMLデータの各節である各ノードにノードIDを付与し、パスを特定し、該ノード間の親子・先祖子孫関係をノード情報としてノード情報記憶手段に格納するノード関係構築ステップを行い
前記パスインデクス手段が、前記ノード管理手段から前記パス、前記文書ID、前記ノード情報を取得し、前記XMLデータの持つ全てのパスと、該パスに指定されるノードを関係付けるノード関係情報を生成し、該パスが同一データで既出のパスである場合には、該パスに複数出現している旨の複数出現パス情報を付与し、パスインデクス記憶手段に格納するパスインデクス作成ステップを行い、
前記検索手段が、
前記検索パスに基づいて問い合わせ木を作成し、同一パスで複数出現しない問い合わせノード群を統合し、問い合わせノードを葉とし、親子・先祖子孫関係を示す関係判定ノードからなる実行木を生成する実行木作成ステップと、
前記問い合わせノードに基づいて、前記パスインデクス記憶手段と、前記ノード情報記憶手段から前記ノード関係情報及び前記ノード情報を取得するノード情報取得ステップと、
同一の文書IDを参照して、前記関係判定ノードの先祖となる問い合わせノードが複数出現している場合には、当該先祖となる問い合わせノードの前記ノード情報による親子・先祖子孫関係を判定し、適切な組み合わせを選択し、該問い合わせノードが1つの場合は同一データのものを組み合わせる関係判定ステップと、
を行うことを特徴とするXMLデータ検索方法。 An XML data search method for searching an XML document group that is structured data,
Node management means for managing the structure and description contents of XML data, path index means for constructing and maintaining an index relating all the paths of the XML data, and nodes specified in the path, and input In an apparatus having a search means for performing a search based on a search path and a search keyword included in a search query,
The node management means assigns a document ID to each acquired XML document, assigns a node ID to each node that is a section of the XML data, specifies a path, and a parent-child / ancestor-descendant relationship between the nodes The node index is stored in the node information storage means as the node information. The path index means acquires the path, the document ID, and the node information from the node management means, and all the paths of the XML data have. And node relation information for associating the nodes specified in the path, and when the path is an existing path with the same data, multiple path information indicating that multiple paths appear is added to the path. And performing a path index creation step for storing in the path index storage means,
The search means
An execution tree that creates a query tree based on the search path, integrates a plurality of query nodes that do not appear in the same path, generates an execution tree that includes a query node as a leaf, and a relationship determination node that indicates a parent-child / ancestor-descendant relationship Creation steps,
Based on the inquiry node, the path index storage means, a node information acquisition step of acquiring the node relation information and the node information from the node information storage means,
If multiple query nodes that are ancestors of the relationship determination node appear with reference to the same document ID, a parent-child / ancestor-descendant relationship is determined based on the node information of the query node that is the ancestor, and an appropriate A relationship determination step of combining the same data if there is one inquiry node;
XML data search method characterized by performing.
前記XMLデータの木構造におけるテキストノード及び属性の値に対するインデクスを値インデクス記憶手段に保持しておき、
前記検索クエリに含まれる同一の検索パスに複数の制約があり、該検索パスが単一出現であれば、前記値インデクス記憶手段を参照して、該制約を満たすテキストノードを選択する
請求項1記載のXMLデータ検索方法。 In the relationship determining step,
Indexes for text nodes and attribute values in the tree structure of the XML data are stored in the value index storage means;
2. The same search path included in the search query has a plurality of constraints, and if the search path has a single appearance, the value index storage unit is referenced to select a text node that satisfies the constraint. The XML data search method described.
取得した前記XML文書毎に文書IDを付与し、該XMLデータの各節である各ノードにノードIDを付与し、パスを特定し、該ノード間の親子・先祖子孫関係をノード情報としてノード情報記憶手段に格納するノード管理手段と、
前記ノード管理手段から前記パス、前記文書ID、前記ノード情報を取得し、前記XMLデータの持つ全てのパスと、該パスに指定されるノードを関係付けるノード関係情報を生成し、該パスが同一データで既出のパスである場合には、該パスに複数出現している旨の複数出現パス情報を付与し、パスインデクス記憶手段に格納するパスインデクス手段と、
入力された検索クエリに含まれる検索パス及び検索キーワードに基づいて検索を行う検索手段と、を有し、
前記検索手段は、
前記検索パスに基づいて問い合わせ木を作成し、同一パスで複数出現しない問い合わせノード群を統合し、問い合わせノードを葉とし、親子・先祖子孫関係を示す関係判定ノードからなる実行木を生成する実行木作成手段と、
前記問い合わせノードに基づいて、前記パスインデクス手段の前記パスインデクス記憶手段と、前記ノード管理手段の前記ノード情報記憶手段から前記ノード関係情報及び前記ノード情報を取得するノード情報取得手段と、
同一の文書IDを参照して、前記関係判定ノードの先祖となる問い合わせノードが複数出現している場合には、当該先祖となる問い合わせノードの前記ノード情報による親子・先祖子孫関係を判定し、適切な組み合わせを選択し、該問い合わせノードが1つの場合は同一データのものを組み合わせる関係判定手段と、
を有することを特徴とするXMLデータ検索装置。 An XML data search apparatus for searching an XML document group that is structured data,
A document ID is assigned to each acquired XML document, a node ID is assigned to each node that is a section of the XML data, a path is specified, and node information includes a parent-child / ancestor-descendant relationship between the nodes as node information. Node management means for storing in the storage means;
The path, the document ID, and the node information are acquired from the node management unit, and node relation information that associates all the paths of the XML data with the node specified in the path is generated. A path index means for giving multiple appearance path information indicating that a plurality of paths appear in the path and storing them in the path index storage means in the case of an existing path in the data;
Search means for performing a search based on a search path and a search keyword included in the input search query,
The search means includes
An execution tree that creates a query tree based on the search path, integrates a plurality of query nodes that do not appear in the same path, generates an execution tree that includes a query node as a leaf, and a relationship determination node that indicates a parent-child / ancestor-descendant relationship Creating means;
Based on the inquiry node, the path index storage means of the path index means, and node information acquisition means for acquiring the node relation information and the node information from the node information storage means of the node management means;
If multiple query nodes that are ancestors of the relationship determination node appear with reference to the same document ID, a parent-child / ancestor-descendant relationship is determined based on the node information of the query node that is the ancestor, and an appropriate A relationship determination unit that combines the same data when there is one inquiry node;
An XML data search apparatus characterized by comprising:
前記XMLデータの木構造におけるテキストノード及び属性の値に対するインデクスを値インデクス記憶手段に保持しておき、前記検索クエリに含まれる同一の検索パスに複数の制約があり、該検索パスが単一出現であれば、前記値インデクス記憶手段を参照して、該制約を満たすテキストノードを選択する
手段を含む
請求項3記載のXMLデータ検索装置。 The execution tree creation means includes:
Indexes for text nodes and attribute values in the tree structure of the XML data are stored in the value index storage means, and there are a plurality of restrictions on the same search path included in the search query, and the search path appears as a single 4. An XML data search apparatus according to claim 3, further comprising means for selecting a text node satisfying the constraint with reference to the value index storage means.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008278883A JP5225022B2 (en) | 2008-10-29 | 2008-10-29 | XML data search method, apparatus and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008278883A JP5225022B2 (en) | 2008-10-29 | 2008-10-29 | XML data search method, apparatus and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2010108192A true JP2010108192A (en) | 2010-05-13 |
JP5225022B2 JP5225022B2 (en) | 2013-07-03 |
Family
ID=42297592
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008278883A Expired - Fee Related JP5225022B2 (en) | 2008-10-29 | 2008-10-29 | XML data search method, apparatus and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5225022B2 (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006228155A (en) * | 2005-02-21 | 2006-08-31 | Nippon Telegr & Teleph Corp <Ntt> | Xml data processing apparatus, xml data processing method, xml data processing program, and storage medium having xml data processing program recorded therein |
JP2008129842A (en) * | 2006-11-21 | 2008-06-05 | Hitachi Ltd | Index generation method, index generation device, and program thereof |
JP2008146424A (en) * | 2006-12-12 | 2008-06-26 | Nippon Telegr & Teleph Corp <Ntt> | Xml document conformity calculation method, its program, and information processor |
JP2008234357A (en) * | 2007-03-20 | 2008-10-02 | Toshiba Corp | Structured document retrieval system, program and index data structure |
-
2008
- 2008-10-29 JP JP2008278883A patent/JP5225022B2/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006228155A (en) * | 2005-02-21 | 2006-08-31 | Nippon Telegr & Teleph Corp <Ntt> | Xml data processing apparatus, xml data processing method, xml data processing program, and storage medium having xml data processing program recorded therein |
JP2008129842A (en) * | 2006-11-21 | 2008-06-05 | Hitachi Ltd | Index generation method, index generation device, and program thereof |
JP2008146424A (en) * | 2006-12-12 | 2008-06-26 | Nippon Telegr & Teleph Corp <Ntt> | Xml document conformity calculation method, its program, and information processor |
JP2008234357A (en) * | 2007-03-20 | 2008-10-02 | Toshiba Corp | Structured document retrieval system, program and index data structure |
Non-Patent Citations (2)
Title |
---|
CSNG200900024021; 兵藤正樹: 'XML文書に対する構造を指定した全文検索方式の提案' 情報処理学会論文誌 論文誌ジャーナル[CD-ROM] Vol.49,No.9, 20080915, pp.3280-3290, 社団法人情報処理学会 * |
JPN6012059444; 兵藤正樹: 'XML文書に対する構造を指定した全文検索方式の提案' 情報処理学会論文誌 論文誌ジャーナル[CD-ROM] Vol.49,No.9, 20080915, pp.3280-3290, 社団法人情報処理学会 * |
Also Published As
Publication number | Publication date |
---|---|
JP5225022B2 (en) | 2013-07-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7139746B2 (en) | Extended markup language (XML) indexing method for processing regular path expression queries in a relational database and a data structure thereof | |
US8868620B2 (en) | Techniques for composing data queries | |
US8346813B2 (en) | Using node identifiers in materialized XML views and indexes to directly navigate to and within XML fragments | |
US8001106B2 (en) | Systems and methods for tokenizing and interpreting uniform resource locators | |
US8566343B2 (en) | Searching backward to speed up query | |
US9659001B2 (en) | Query evaluation using ancestor information | |
US20090019015A1 (en) | Mathematical expression structured language object search system and search method | |
US20050192983A1 (en) | Structured data storage method, structured data storage apparatus, and retrieval method | |
JP2008052662A (en) | Structured document management system and program | |
KR20090028758A (en) | Methods and apparatus for reusing data access and presentation elements | |
JP2007156965A (en) | Document processing method, program, and system | |
US8082492B2 (en) | Structured-document management apparatus, search apparatus, storage method, search method and program | |
JP2006185408A (en) | Database construction device, database retrieval device, and database device | |
JP2005190163A (en) | Method, apparatus and program for retrieving structured data | |
US20130297657A1 (en) | Apparatus and Method for Forming and Using a Tree Structured Database with Top-Down Trees and Bottom-Up Indices | |
US8171040B2 (en) | Method and system for navigation of a data structure | |
Sanz et al. | Fragment-based approximate retrieval in highly heterogeneous XML collections | |
JP5225021B2 (en) | Full-text search method, apparatus and program | |
JP5225022B2 (en) | XML data search method, apparatus and program | |
JP4649339B2 (en) | XPath processing apparatus, XPath processing method, XPath processing program, and storage medium | |
JP2010267081A (en) | Information search method, device and program | |
KR100775852B1 (en) | System and method for searching resource of application program | |
JP2009217436A (en) | Collaborative sorting apparatus and program | |
JP4334450B2 (en) | Structured document search apparatus and structured document search method | |
Marin-Castro et al. | VR-Tree: A novel tree-based approach for modeling Web Query Interfaces |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20110223 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20121108 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20121113 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20130107 |
|
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: 20130305 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130312 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5225022 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20160322 Year of fee payment: 3 |
|
S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
LAPS | Cancellation because of no payment of annual fees |