JP5320697B2 - Collation processing program and collation processing apparatus - Google Patents
Collation processing program and collation processing apparatus Download PDFInfo
- Publication number
- JP5320697B2 JP5320697B2 JP2007195081A JP2007195081A JP5320697B2 JP 5320697 B2 JP5320697 B2 JP 5320697B2 JP 2007195081 A JP2007195081 A JP 2007195081A JP 2007195081 A JP2007195081 A JP 2007195081A JP 5320697 B2 JP5320697 B2 JP 5320697B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- axis
- automaton
- axis conversion
- search expression
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/80—Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
- G06F16/83—Querying
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
この発明は、要素識別子により要素が区切られた階層構造を有する文書データから検索式に該当するデータを検索する照合処理プログラムに関し、特に、検索式の構造によらず文書データから該当データを検索することができる照合処理プログラム等に関するものである。 The present invention relates to a collation processing program for retrieving data corresponding to a search expression from document data having a hierarchical structure in which elements are separated by element identifiers. In particular, the data is searched from document data regardless of the structure of the search expression. It is related with the collation processing program etc. which can be performed.
近年、コンピュータで処理される文書データとして、XML(Extensible Markup Language)などが利用されている。このXMLは、タグとして参照される要素識別子「<」や、「/>」を使用した階層構造を含み、テキスト形式よりも多くの情報を含ませることが可能となっているため、コンピュータにおいてますます多用されてきている(以下、XMLに基づいて記述された階層構造をなす文書データをXMLデータと表記する)。 In recent years, XML (Extensible Markup Language) or the like is used as document data processed by a computer. This XML includes a hierarchical structure using element identifiers "<" and "/>" that are referred to as tags, and can contain more information than text format. (Hereinafter, document data having a hierarchical structure described based on XML is referred to as XML data).
そして、階層構造を含むXMLデータを効率的に検索するため、一般的には、クエリ(Xpath式)などの検索式を使用し、そのクエリに該当する文書データおよびノードを検索する方法が知られている(例えば、特許文献1参照)。 In order to efficiently search XML data including a hierarchical structure, a method of searching for document data and nodes corresponding to the query is generally used by using a search expression such as a query (Xpath expression). (For example, refer to Patent Document 1).
しかしながら、XMLデータのますますの巨大化にともない、ストリーム処理に基づいて、コンピュータに負荷をかけることなく、クエリに該当する文書およびノードを検索することが求められているが、クエリに逆行軸などが含まれている場合には、ストリーム処理によってXMLデータを検索することが困難であるという問題があった。 However, as XML data grows larger and larger, it is required to search for documents and nodes corresponding to the query based on stream processing without putting a load on the computer. Is included, there is a problem that it is difficult to search XML data by stream processing.
図34は、従来技術の問題点を説明するための図である。ストリーム処理によってXMLデータを検索することが困難な理由を説明すると、ストリーム指向に基づいた処理では、すでに読んだデータを再度読むことができないが、クエリに逆行軸が含まれていると、現在のデータ位置(図34のDn)よりも過去のデータ(図34のD1〜Dn−1)にアクセスする必要があるためである。 FIG. 34 is a diagram for explaining the problems of the prior art. Explaining why it is difficult to retrieve XML data by stream processing, stream-oriented processing cannot reread already read data, but if the query includes a retrograde axis, This is because it is necessary to access past data (D1 to Dn-1 in FIG. 34) rather than the data position (Dn in FIG. 34).
すなわち、クエリに分岐などが含まれているばあであっても、XMLデータからクエリに該当する文書データ等を高速かつ効率よく検索することが極めて重要な課題となっている。 That is, even if the query includes a branch or the like, it is a very important issue to search the document data corresponding to the query from the XML data at high speed and efficiently.
この発明は、上述した従来技術による問題点を解消するためになされたものであり、クエリの構成によらず、XMLデータからクエリに該当する文書データ等を高速かつ効率よく検索することができる照合処理プログラムおよび照合処理装置を提供することを目的とする。 The present invention has been made to solve the above-described problems caused by the prior art, and is a collation capable of quickly and efficiently retrieving document data corresponding to a query from XML data, regardless of the structure of the query. An object is to provide a processing program and a verification processing device.
上述した課題を解決し、目的を達成するため、本発明は、コンピュータに、要素識別子により要素が区切られた階層構造を有する文書データを記憶装置に記憶する文書記憶手順と、前記記憶装置に記憶された文書データに含まれるデータを検索する検索式を取得した場合に、取得した検索式に対して軸変換を実行し、当該検索式を子供軸によって構成される検索式に変換する軸変換手順と、前記軸変換手順によって変換された検索式に含まれる要素識別子の種類を識別して当該検索式に対応するオートマトンを作成するオートマトン作成手順と、前記文書データに含まれるデータと前記オートマトンとを順に照合して前記検索式に該当するデータを出力する照合処理手順と、を実行させることを特徴とする。 In order to solve the above-described problems and achieve the object, the present invention provides a computer with a document storage procedure for storing document data having a hierarchical structure in which elements are separated by element identifiers in a storage device, and storing the document data in the storage device. Axis conversion procedure to perform axis conversion on the acquired search expression and convert the search expression to a search expression composed of child axes when a search expression for searching data included in the document data is acquired Automaton creation procedure for identifying the type of element identifier included in the search expression converted by the axis conversion procedure and creating an automaton corresponding to the search expression, data included in the document data, and the automaton. And a collation process procedure for collating in order and outputting data corresponding to the search formula.
また、本発明は、上記発明において、前記軸変換手順は、前記検索式に兄弟軸が存在しているか否かを判定し、兄弟軸が存在している場合に、当該兄弟軸を親軸と子供軸とに変換することを特徴とする。 Further, the present invention is the above invention, wherein the axis conversion procedure determines whether or not a sibling axis exists in the search formula, and when the sibling axis exists, the sibling axis is set as a parent axis. It is characterized by converting to a child axis.
上記発明において、前記軸変換手順は、前記検索式に親軸が存在しているか否かを判定し、親軸が存在している場合に、当該親軸を子供軸に変換する。すなわち、軸変換の一例として「親軸を子供軸に変換」を扱うことができ、実現方法として例えば、参考文献1(D.Olteanu et al.,“XPath:Looking Forward”,Proc.XMLDM'02,2002.)がある。 In the above invention, the axis conversion procedure determines whether or not a parent axis exists in the search formula, and when the parent axis exists, converts the parent axis to a child axis. That is, “conversion of parent axis to child axis” can be handled as an example of axis conversion. For example, Reference 1 (D. Olteanu et al., “XPath: Looking Forward”, Proc.XMLDM'02 , 2002.).
また、上記発明において、前記検索式は、制約条件となる述語部を有し、前記軸変換手順は、変換前の検索式と変換後の検索式との関係を同値に保ったまま、前記検索式に含まれる述語部の位置を変更する。 In the above invention, the search expression includes a predicate part that is a constraint condition, and the axis conversion procedure maintains the relationship between the search expression before conversion and the search expression after conversion at the same value. Change the position of the predicate part included in the expression.
また、本発明は、上記発明において、前記照合処理手順は、前記文書データに含まれるデータと前記オートマトンとを順に照合していく過程において検出されるデータを一時記憶テーブルに順次記憶し、照合が終了した時点において前記一時記憶テーブルに記憶されているデータを出力することを特徴とする。 Also, in the present invention, in the above invention, the collation processing procedure sequentially stores data detected in the process of collating data included in the document data and the automaton in order in a temporary storage table. The data stored in the temporary storage table is output at the time of termination.
本発明によれば、要素識別子により要素が区切られた階層構造を有する文書データを記憶装置に記憶し、記憶装置に記憶された文書データに含まれるデータを検索する検索式を取得した場合に、取得した検索式に対して軸変換を実行し、当該検索式を子供軸によって構成される検索式に変換し、変換した検索式に含まれる要素識別子の種類を識別して当該検索式に対応するオートマトンを作成し、文書データに含まれるデータとオートマトンとを順に照合して検索式に該当するデータを出力するので、検索式の構成によらず、文書データから検索式に該当するデータを高速かつ効率よく検索することができる。 According to the present invention, when storing document data having a hierarchical structure in which elements are separated by element identifiers in a storage device, and obtaining a search expression for searching for data included in the document data stored in the storage device, Axis conversion is performed on the acquired search expression, the search expression is converted into a search expression constituted by child axes, and the type of element identifier included in the converted search expression is identified to correspond to the search expression An automaton is created, and the data contained in the document data and the automaton are collated in order, and the data corresponding to the search expression is output. Therefore, the data corresponding to the search expression can be quickly retrieved from the document data regardless of the structure of the search expression. You can search efficiently.
また、本発明によれば、検索式に兄弟軸が存在しているか否かを判定し、兄弟軸が存在している場合に、当該兄弟軸を親軸と子供軸とに変換するので、ストリーム処理によって、検索式に該当するデータを効率よく検索することができる。 Further, according to the present invention, it is determined whether or not a sibling axis exists in the search expression. When the sibling axis exists, the sibling axis is converted into a parent axis and a child axis. By processing, data corresponding to the search expression can be efficiently searched.
また、本発明によれば、検索式に親軸が存在しているか否かを判定し、親軸が存在している場合に、当該親軸を子供軸に変換するので、ストリーム処理によって、検索式に該当するデータを効率よく検索することができる。軸変換の一例として「親軸を子供軸に変換」を扱うことができ、実現方法として例えば、参考文献1(D.Olteanu et al.,“XPath:Looking Forward”,Proc.XMLDM'02,2002.)がある。 Further, according to the present invention, it is determined whether or not a parent axis exists in the search formula, and when the parent axis exists, the parent axis is converted into a child axis. Data corresponding to the expression can be searched efficiently. As an example of axis conversion, “transform parent axis to child axis” can be handled. As an implementation method, for example, Reference 1 (D. Olteanu et al., “XPath: Looking Forward”, Proc. XMLDM'02, 2002 .)
また、本発明によれば、変換前の検索式と変換後の検索式との関係を同値に保ったまま、検索式に含まれる述語部の位置を変更するので、検索式に該当するデータを効率よく検索することができる。 In addition, according to the present invention, the position of the predicate part included in the search expression is changed while maintaining the relationship between the search expression before conversion and the search expression after conversion at the same value. You can search efficiently.
また、本発明によれば、文書データに含まれるデータとオートマトンとを順に照合していく過程において検出されるデータを一時記憶テーブルに順次記憶し、照合が終了した時点において一時記憶テーブルに記憶されているデータを出力するので、分岐を含む検索式に該当するデータを効率よく出力することができる。 In addition, according to the present invention, data detected in the process of sequentially collating data contained in document data and an automaton is sequentially stored in the temporary storage table, and stored in the temporary storage table when the collation is completed. Therefore, data corresponding to a search expression including a branch can be output efficiently.
以下に添付図面を参照して、この発明に係る照合処理プログラムおよび照合処理装置の好適な実施の形態を詳細に説明する。 Exemplary embodiments of a verification processing program and a verification processing device according to the present invention will be described below in detail with reference to the accompanying drawings.
まず、XMLデータおよびクエリの逆行軸について説明する。図1は、XMLデータの木表現とXMLデータのストリーム表現とを示す図であり、図2は、逆行軸を含むクエリ(検索式)の一例を示す図である。 First, the reverse axis of the XML data and query will be described. FIG. 1 is a diagram illustrating a tree representation of XML data and a stream representation of XML data, and FIG. 2 is a diagram illustrating an example of a query (search expression) including a reverse axis.
図1に示すように、XMLデータの木表現では、XMLデータは、papers10、paper11,12、author13,16、title14,15の各要素を有し、それぞれの要素を接続している。 As shown in FIG. 1, in the tree representation of XML data, the XML data has elements of papers10, paper11, 12, author13, 16, and title14, 15, and connects these elements.
具体的には、papers10は、paper11,12に接続され、paper11は、author13およびtitle14に接続され、paper12は、title15およびauthor16に接続されている。また、author13,16は、文書データ「asai」に接続され、title14は、文書データ「XML」に接続され、title15は、文書データ「Data Stream」に接続されている。
Specifically,
ここで、papers10とpaper11,12との関係を、親と子と定義する。また、paper11,12との関係を兄弟とし、paper11を兄、paper12を弟と定義する。同様に、paper11とauthor13、title14との関係を親と子と定義する。また、author13とtitle14との関係を兄弟とし、author13を兄、title14を弟と定義する。
Here, the relationship between
また、paper12とtitle15、author16との関係を親と子と定義する。そして、title15とauthor16との関係を兄弟とし、title15を兄、author16を弟と定義する。また、各要素の下側に接続された要素を子孫と定義する。例えば、papers10の子孫は、paper11,12、author13,16、title14,15となる。
Further, the relationship between
なお、XMLデータのストリーム表現では、各要素がXMLデータの木表現の左側の軸から順に並べられている。このストリーム表現によるXMLデータに対してクエリによるデータ検索を行う場合には、メモリ使用量が少なくて済みかつ、巨大データをあつかいやすいというメリットがあるが、すでに読んだデータを再度読むことができない。例えば、ストリーム表現されたXMLデータにおいて、(open,title)(text,“XML”)を参照した後に、(open,author)(text,“asai”)を読むことができない。 In the stream representation of XML data, each element is arranged in order from the left axis of the tree representation of XML data. In the case of performing a data search by a query with respect to the XML data represented by this stream expression, there is an advantage that the memory usage is small and it is easy to deal with huge data, but already read data cannot be read again. For example, in the stream-represented XML data, (open, author) (text, “asai”) cannot be read after (open, title) (text, “XML”) is referenced.
続いて、図2の説明に移行すると、図2に示すクエリの意味は、[../author=“asai”]という制約条件のもとで、papers直下のpaper直下のtitle要素を検索するという意味である。なお、図2の場合の制約条件[../author=“asai”]の意味は、title要素の親(この場合はpaper)の直下に「asai」という文書データを持ったauthorが存在するという制約条件である。 Subsequently, when shifting to the explanation of FIG. 2, the meaning of the query shown in FIG. 2 is to search for the title element directly under the papers under the constraint condition [../author=“asai ”]. Meaning. In the case of FIG. 2, the constraint condition [../author=“asai ”] means that there is an author having document data“ asai ”directly under the parent of the title element (in this case, paper). It is a constraint condition.
図2のクエリによって検索される要素は、図1のtitle14とtitle15となり、図3に示すような検索結果が表示されることになる。図3は、図1のXMLデータを図2に示すクエリで検索した場合の検索結果を示す図である。 The elements searched by the query of FIG. 2 are title14 and title15 of FIG. 1, and the search results as shown in FIG. 3 are displayed. FIG. 3 is a diagram showing a search result when the XML data of FIG. 1 is searched by the query shown in FIG.
しかしながら、図2に示すクエリは、一旦、titleを参照した後に、titleの親軸paperを参照する必要があるため(逆行軸を含んでいるため)、図1のXMLデータをストリーム処理によってそのまま検索することが困難であるという問題がある。図2に示す例では、「../」が逆行軸を表している。 However, since the query shown in FIG. 2 needs to refer to the parent axis paper of the title after referring to the title once (including the retrograde axis), the XML data in FIG. There is a problem that it is difficult to do. In the example shown in FIG. 2, “../” represents the retrograde axis.
次に、本実施例にかかる照合処理装置について説明する。本実施例にかかる照合処理装置は、上述したような逆行軸や分岐などが含まれるクエリを軸変換アルゴリズムに基づいて軸変換し、軸変換したクエリを利用して、ストリーム処理によるXMLデータの検索を実行する。このように、本実施例にかかる照合処理装置は、クエリの軸変換を行った後に、ストリーム処理によるXMLデータの検索を実行するので、クエリの構成によらず、XMLデータからクエリに該当する文書データなどを高速かつ効率よく検索することができる。 Next, a verification processing apparatus according to the present embodiment will be described. The collation processing apparatus according to the present embodiment performs the axis conversion on the query including the retrograde axis and the branch as described above based on the axis conversion algorithm, and searches the XML data by the stream processing using the axis converted query. Execute. As described above, since the collation processing apparatus according to the present embodiment performs the search of the XML data by the stream processing after performing the axis conversion of the query, the document corresponding to the query from the XML data regardless of the configuration of the query. Data and the like can be searched quickly and efficiently.
図4は、本実施例にかかる照合処理装置の構成を示す機能ブロック図である。同図に示すように、この照合処理装置100は、入力部110と、出力部120と、記憶部130と、前処理部140と、後処理部150とを備えて構成される。
FIG. 4 is a functional block diagram illustrating the configuration of the verification processing apparatus according to the present embodiment. As shown in the figure, the
このうち、入力部110は、各種の情報を入力する入力手段であり、キーボードやマウス、マイク、データ読取装置などによって構成され、例えば、上述したXMLデータ、クエリ等を入力する。出力部120は、各種の情報(例えば、クエリに該当するデータ)を出力する手段であり、モニタ(若しくはディスプレイ、タッチパネル)等によって構成される。
Among these, the
記憶部130は、前処理部140および後処理部150による各種処理に必要なデータおよびプログラムを記憶する記憶手段(格納手段)であり、特に本発明に密接に関連するものとしては、XMLデータ131と、パストライ132と、BINファイル133と、クエリデータ134と、兄弟対応テーブル135と、オートマトンデータ136と、ヒットテーブル137と、スタック138とを備える。
The
XMLデータ131は、タグとして参照される要素識別子「<」や、「/>」などを使用した階層構造をなす文書データである。図5は、XMLデータのデータ構造の一例を示す図である。図5に示すXMLデータを木表現で表すと、図6のように示すことができる。図6は、図5に示すXMLデータを木表現で表した場合の図である。図6に関する説明は、図1の木表現にかかる説明と同様であるため、説明を省略する。 The XML data 131 is document data having a hierarchical structure using element identifiers “<” and “/>” that are referred to as tags. FIG. 5 is a diagram illustrating an example of the data structure of XML data. If the XML data shown in FIG. 5 is represented by a tree representation, it can be shown as in FIG. FIG. 6 is a diagram when the XML data shown in FIG. 5 is represented in a tree representation. 6 is the same as the description of the tree representation of FIG.
パストライ132は、XMLデータの重複するパスを省略し、XMLデータの各要素に一意のIDを割り当てたデータである。図7は、パストライ132のデータ構造の一例を示す図である。同図に示すように、このパストライ132は、複数のタグ(papers、paper、author、title)を備え、各タグに一意のIDを割り当てている。 The path trie 132 is data in which overlapping paths of XML data are omitted and a unique ID is assigned to each element of the XML data. FIG. 7 is a diagram illustrating an example of the data structure of the path trie 132. As shown in the figure, this path trie 132 includes a plurality of tags (papers, paper, author, title), and a unique ID is assigned to each tag.
図7に示す例では、タグ「papers」にタグID(1)を割り当て、タグ「paper」にタグID(2)を割り当て、タグ「author」にタグID(3)を割り当て、タグ「title」にタグID(4)を割り当てている。 In the example illustrated in FIG. 7, tag ID (1) is assigned to tag “papers”, tag ID (2) is assigned to tag “paper”, tag ID (3) is assigned to tag “author”, and tag “title” is assigned. Is assigned a tag ID (4).
なお、図6に示したXMLデータ(木表現)では、paperからauthorに至る軸およびpaperからtitleに至る軸がそれぞれ重複しているので、パストライ132は重複した軸を一つの軸にまとめている。 In the XML data (tree representation) shown in FIG. 6, the axis from paper to author and the axis from paper to title overlap, so the path trie 132 combines the overlapping axes into one axis. .
図8は、図7に示した各タグのデータ構造の一例を示す図である。同図に示すように、このタグは、タグ名と、タグIDと、子節へのポインタとを備える。ここで、図7に示した「papers」のタグを例にあげて説明すると、タグ名には「papers」が登録され、タグIDには、タグID(1)が登録され、子節へのポインタには、子節となる「paper」のポインタが登録される。 FIG. 8 shows an example of the data structure of each tag shown in FIG. As shown in the figure, this tag includes a tag name, a tag ID, and a pointer to a child clause. Here, the “papers” tag shown in FIG. 7 will be described as an example. “Papers” is registered as the tag name, tag ID (1) is registered as the tag ID, and In the pointer, a pointer of “paper” as a child clause is registered.
BINファイル133は、XMLデータ131(図5参照)に含まれる各要素をパストライ132(図7参照)の各タグのIDで置き換えたデータである。図9は、BINファイル133のデータ構造の一例を示す図である。同図に示すように、このBINファイル133は、各要素の位置を識別するための識別番号1001〜1010と、タグIDで置き換えた要素とから構成される。
The
具体的に、図5と図9とを比較すると、<papers>は、[(1)に変換され、<paper>は、[(2)に変換され、<author>は、[(3)に変換され、<title>は、[(4)に変換されている。また、</papers>は、/(1)に変換され、</paper>は、/(2)に変換され、</author>は、/(3)に変換され、</title>は、/(4)に変換されている。 Specifically, comparing FIG. 5 and FIG. 9, <papers> is converted to [(1), <paper> is converted to [(2), and <author> is converted to [(3). After conversion, <title> is converted into [(4). Also, </ papers> is converted to / (1), </ paper> is converted to / (2), </ author> is converted to / (3), and </ title> / (4).
クエリデータ134は、入力部110から入力されるクエリを記憶したデータである。図10は、クエリデータ134として記憶されるクエリの一例を示す図である。なお、図10に示すクエリの意味は、図2において説明したクエリと同様の意味であるため説明を省略する。
The
兄弟対応テーブル135は、クエリに対して軸変換を実施した場合に、軸変換後の各要素の兄弟関係を記憶するためのテーブルである。図11は、兄弟対応テーブル135のデータ構造の一例を示す図である。同図に示すように、この兄弟テーブル135には、各要素の兄弟関係が示されている。例えば、図11では、「2<3」と記録されているので、番号2,3番によって識別される各要素のうち、番号2の要素が兄となり、番号3の要素が弟となることを表している。
The sibling correspondence table 135 is a table for storing the sibling relationship of each element after axis conversion when axis conversion is performed on the query. FIG. 11 is a diagram illustrating an example of a data structure of the brother correspondence table 135. As shown in the figure, the sibling table 135 shows the sibling relationship of each element. For example, in FIG. 11, since “2 <3” is recorded, among the elements identified by the
オートマトンデータ136は、軸変換されたクエリに基づいて生成されるオートマトンを記憶するデータである。オートマトンデータ136に関する詳しい説明は後述する。
The
ヒットテーブル137は、BINファイル133と、オートマトンデータ136とを利用して、検索対象を検索する場合に利用するテーブルである。図12は、ヒットテーブル137のデータ構造の一例を示す図である。同図に示すように、このヒットテーブル137は、文脈ノード検出イベントCが発生したBINファイル133の位置および述語受理イベント(Am)が派生したBINファイル133の位置を格納するフィールドを複数有する。なお、文脈ノード検出イベントおよび述語受理イベントに関する説明は後述する。
The hit table 137 is a table used when searching for a search object using the
スタック138は、ヒットテーブル137に格納するデータを一時的に記憶するデータである。図13は、スタックのデータ構造の一例を示す図である。同図に示すように、スタック138は、文脈ノード検出イベントCが発生したBINファイル133の位置および述語受理イベント(Am)が派生したBINファイル133の位置を格納するフィールドを1つ有する。
The
図4の説明に戻ると、前処理部140は、XMLデータ131に基づいて、パストライ132およびBINファイル133を生成する手段であり、パストライ作成部141およびBINファイル作成部142を備える。なお、前処理部140は、入力部110から、XMLデータを取得した場合には、取得したXMLデータを記憶部130に記憶させる。
Returning to the description of FIG. 4, the
パストライ作成部141は、XMLデータ131(図5参照)に基づいて、パストライ132(図7参照)を作成する手段である。具体的に、パストライ作成部141は、XMLデータ131を解析し、XMLデータ131の重複するパスを検出する。そして、XMLデータ131に重複するパスが存在する場合には、重複するパスのうち、1つのパスを残した状態で、XMLデータ131の各要素に対応するタグを作成し、XMLデータ131の親子関係に則して、各タグを接続したパストライ132(図7参照)を作成する。また、パストライ作成部141は、各タグに一意のタグIDを割り当てる。
The path trie
BINファイル作成部142は、XMLデータ131(図5参照)およびパストライ132(図7参照)を基にして、BINファイル133(図9参照)を作成する手段である。具体的に、BINファイル作成部133は、XMLデータ131の各要素と、パストライ132のタグ名とを比較し、XMLデータ131の各要素の名称に対応するタグ名のタグIDを割り当て、BINファイル133を作成する。
The BIN
後処理部150は、照合処理を行い、クエリデータ134に該当するデータを検出する手段であり、軸変換処理部151と、オートマトン作成部152と、照合処理部153とを備える。なお、後処理部150は、入力部110から、クエリデータを取得した場合には、クエリデータ134として、記憶部130に記憶する。また、後処理部150は、検出したデータを出力部120に出力する。
The
軸変換処理部151は、クエリデータ134に対して軸変換を行う手段である。図14は、軸変換処理部151の処理の概要を説明するための図である。同図に示すように、軸変換処理部151は、クエリ(逆行軸を含む)に対して軸変換を実行し、子供軸のみで構成されるクエリを生成する。そして、クエリの各要素名とパストライ132のタグ名とを比較して、各要素名に対応するタグ名のタグIDで各要素を変換する。
The axis conversion processing unit 151 is a unit that performs axis conversion on the
以下において、軸変換処理部151の処理を具体的に説明する。軸変換において、軸変換処理部151は、クエリデータ134に対して、兄弟軸変換処理を実行した後に、親軸変換処理を実行する。ここでは、まず、軸変換処理部151が行う兄弟軸変換について説明する。
Below, the process of the axis conversion process part 151 is demonstrated concretely. In the axis conversion, the axis conversion processing unit 151 executes the parent axis conversion process after executing the sibling axis conversion process on the
(兄弟軸変換処理)
兄弟軸変換処理において、軸変換処理部151は、クエリデータ134から兄弟軸を検出する。例えば、兄弟軸は、クエリ上で、「following-sibling」、「preceding-sibling」によって示される。軸変換処理部151は、兄弟軸を検出した場合に、兄弟軸変換ルールを用いて、兄弟軸を親軸と子供軸に変換し、兄弟関係を兄弟対応テーブル135に登録する。
(Brother axis conversion processing)
In the sibling axis conversion process, the axis conversion processing unit 151 detects a sibling axis from the
兄弟軸変換ルールは、
「/a/following-sibling::b⇒/a/../b」
「/a/preceding-sibling::b⇒/a/../b」
となる。
Sibling axis conversion rules are
“/A/following-sibling::b⇒/a/../b”
"/A/preceding-sibling::b⇒/a/../b"
It becomes.
図15は、兄弟軸変換処理を補足説明するための図である。同図において、XMLデータのノード「C」を検索するためのクエリは、「/a/b/following-sibling::c」となり、兄弟軸「following-sibling」を含んでいることがわかる。このクエリ「/a/b/following-sibling::c」に上記した兄弟軸変換ルールを適用すると、「/a/b/../c」に変換することができ、兄弟軸を、親軸と子供軸のみで表すことが可能となる。 FIG. 15 is a diagram for supplementarily explaining the sibling axis conversion process. In the drawing, the query for searching the node “C” of the XML data is “/ a / b / following-sibling :: c”, and it is understood that the sibling axis “following-sibling” is included. By applying the sibling axis conversion rule described above to this query “/ a / b / following-sibling :: c”, it is possible to convert it to “/a/b/../c”. It is possible to represent only with the child axis.
また、軸変換処理部151は、兄弟軸を親軸と子供軸に変換した場合に、その兄弟関係を、兄弟対応テーブル135に登録する。図15に示す例では、2番によって識別されるbが兄、3番によって識別されるcが弟であるため、兄弟対応テーブル135に登録される情報は、「2<3」となる。 In addition, the axis conversion processing unit 151 registers the sibling relationship in the sibling correspondence table 135 when the sibling axis is converted into the parent axis and the child axis. In the example shown in FIG. 15, b identified by No. 2 is an older brother, and c identified by No. 3 is a younger brother, so the information registered in the brother correspondence table 135 is “2 <3”.
軸変換処理部151は、兄弟軸を親軸と子供軸に変換した後に、変換したクエリに対して同値性ルールを適用し、述語部(クエリの[]の部分)のネスト([]の内部に更に[]が存在するものをネストと呼ぶ)を消す。また、連続する述語部では、親軸を含む述語部が先頭に来るように、同値性ルールを適用してクエリを並び替える。例えば、「π[a][../b][c/d]」に同値性ルールを適用して、「π[../b][a][c/d]」に並び替える。 The axis conversion processing unit 151 converts the sibling axis into a parent axis and a child axis, and then applies an equivalence rule to the converted query, and nests the predicate part ([] part of the query) If there is a [] in it, it is called a nest. In the continuous predicate parts, the equivalence rule is applied to rearrange the queries so that the predicate part including the parent axis comes first. For example, the equivalence rule is applied to “π [a] [../ b] [c / d]” and rearranged to “π [../ b] [a] [c / d]”.
同値性ルールは、下記のように、同値性ルール1〜7が存在する。なお、下記のπ1、π2は、任意のクエリのパス表現である。また、任意の子節x∈Nに対してS[π1](x)=S[π2](x)が成り立つとき、π1とπ2は同値であるといい、「π1≡π2」と表記する。
同値性ルール1:π1/π≡π2/π(π1≡π2の場合のみ適用)
同値性ルール2:π/π1≡π/π2(π1≡π2の場合のみ適用)
同値性ルール3:π[π1]≡π[π2](π1≡π2の場合のみ適用)
同値性ルール4:π1[π]≡π2[π](π1≡π2の場合のみ適用)
同値性ルール5:π[π1[π2]]≡π[π1/π2]
同値性ルール6:π[[π1]π2]≡π[π1][π2]
同値性ルール7:π[π1][π2]≡π[π2][π1]
Equivalence rule 1: π1 / π≡π2 / π (applicable only when π1≡π2)
Equivalence rule 2: π / π1≡π / π2 (applicable only when π1≡π2)
Equivalence rule 3: π [π1] ≡π [π2] (applicable only when π1≡π2)
Equivalence rule 4: π1 [π] ≡π2 [π] (applicable only when π1≡π2)
Equivalence rule 5: π [π1 [π2]] ≡π [π1 / π2]
Equivalence rule 6: π [[π1] π2] ≡π [π1] [π2]
Equivalence rule 7: π [π1] [π2] ≡π [π2] [π1]
(親軸変換処理)
親軸変換処理において、軸変換処理部151は、クエリデータ親軸を検出する。そして、軸変換処理部151は、親軸変換ルールを適用し、検出した親軸を子供軸に変換する。
なお、親軸を子供軸に変換する手法は、例えば、参考文献1(D.Olteanu et al.,“XPath:Looking Forward”,Proc.XMLDM'02,2002.)に開示された手法を用いることができる。
親軸変換ルールは、
親軸変換ルール1:π/a/../≡π[a]
親軸変換ルール2:a/../≡./[π]/a
が存在する。
(Parent axis conversion process)
In the parent axis conversion process, the axis conversion processing unit 151 detects the query data parent axis. Then, the axis conversion processing unit 151 applies a parent axis conversion rule and converts the detected parent axis into a child axis.
For example, the method disclosed in Reference Document 1 (D. Olteanu et al., “XPath: Looking Forward”, Proc. XMLDM'02, 2002.) is used as a method for converting a parent axis into a child axis. Can do.
The parent axis conversion rule is
Parent axis conversion rule 1: π / a /../ ≡π [a]
Parent axis conversion rule 2: a /../ ≡ ./ [π] / a
Exists.
軸変換処理部151は、親軸を子供軸に変換した後に、変換したクエリに対して同値性ルールを適用し、述語部のネストを消す。また、連続する述語部では、親軸を含む述語部が先頭に来るように、同値性ルールを適用してクエリを並び替える。なお、同値性ルールは、上記した同値性ルール1〜7と同様であるため説明を省略する。
After converting the parent axis to the child axis, the axis conversion processing unit 151 applies the equivalence rule to the converted query and deletes the predicate part from nesting. In the continuous predicate parts, the equivalence rule is applied to rearrange the queries so that the predicate part including the parent axis comes first. Note that the equivalence rule is the same as the
ここで、親軸変換ルールおよび同値性ルールを適用して、親軸を含むクエリのパスを変換する処理の具体例を示す。変換対象となるクエリのパスを
π=/b1/b2[b3/b4/../../../b8]
とする。このパスπには、変換すべき親軸「../」が3つ含まれている。
Here, a specific example of processing for converting a path of a query including the parent axis by applying the parent axis conversion rule and the equivalence rule will be described. The path of the query to be converted is π = /b1/b2[b3/b4/../../../b8]
And This path π includes three parent axes “../” to be converted.
πの一番左の親軸に対して親軸変換ルール1を適用したものをπ1とすると、
π1=/b1/b2[b3[b4]../../b8]
となる。そして、π1の一番左の親軸に対して親軸変更ルール1を適用したものをπ2とすると、
π2=/b1/b2[b3[b4]]../b8]
となる。
The When [pi 1 obtained by applying the parent
π 1 = / b1 / b2 [b3 [b4] ../../ b8]
It becomes. And, if the parent
π 2 = / b1 / b2 [b3 [b4]] ../ b8]
It becomes.
続いて、π2に同値性ルール5を適用すると、
π2=/b1/b2[b3/b4]../b8]
となり、同値性ルール5を適用したπ2に同値性ルール6を適用すると、
π2=/b1/b2[b3/b4][../b8]
となる。
Subsequently, applying
π 2 = / b1 / b2 [b3 / b4] ../ b8]
When the
π 2 = / b1 / b2 [b3 / b4] [../ b8]
It becomes.
また、同値性ルール6を適用したπ2に同値性ルール7を適用すると、
π2=/b1/b2[../b8][b3/b4]
となる。そして、同値性ルール5〜7を適用したπ2に親軸変換ルール2を適用したものをπ3とすると、
π2=/b1[b8]b2[b3/b4]
となる。
When the
π 2 = / b1 / b2 [../ b8] [b3 / b4]
It becomes. Then, when π 3 is the π 2 to which the equivalence rules 5 to 7 are applied, and the parent
π 2 = / b1 [b8] b2 [b3 / b4]
It becomes.
なお、軸変換処理部151は、クエリに対して親軸(あるいは先祖軸)変換処理を行う場合には、子孫軸をパストライで展開してから、親軸の変換を行う。例えば、
π=/a//../d
に対して親軸変換処理を実行する場合には、
π=/a/b/../d,a/b/c/d/../d
に展開した後に、親軸変換処理を行い、
π=/a[b]d,a/b/c[b]d
に変換する。
In addition, when performing the parent axis (or ancestor axis) conversion processing on the query, the axis conversion processing unit 151 performs parent axis conversion after expanding the descendant axes with a path trie. For example,
π = /a//../d
When executing the parent axis conversion process for
π = /a/b/../d, a / b / c / d /../ d
After expanding to the parent axis conversion process,
π = / a [b] d, a / b / c [b] d
Convert to
軸変換処理部151は、クエリデータ134に記憶されたクエリに対して、兄弟軸変換処理および親軸変換処理を実行し、軸変換を実施したクエリをクエリデータ134に登録する(軸変換前のクエリを軸変換後のクエリによって更新する)。そして、軸変換処理部151は、変換後のクエリの各要素名と、パストライ132のタグ名とを比較して、クエリの各要素名をタグIDに変換する。タグIDに変換したクエリを変換クエリと表記する。
The axis conversion processing unit 151 performs a sibling axis conversion process and a parent axis conversion process on the query stored in the
図4の説明に戻ると、オートマトン作成部152は、軸変換処理部151によって作成された変換クエリに対応するオートマトンデータを作成する手段である。オートマトン作成部152が作成したオートマトンデータは、オートマトンデータ136として記憶部130に記憶される。
Returning to the description of FIG. 4, the
ここで、オートマトン作成部152の処理について具体的に説明する。図16は、オートマトン作成部152の処理を補足説明するための図である。なお、ここでは、説明の便宜上、クエリを
Q=/Syain/ACT/[contains(cast,"浅井")]chara[contains(name,"ブルー")]
とし、かかるクエリの各要素をタグIDに変換した変換クエリを
Q'=(2)[(5):e1](3)[(6):e2]
とし、オートマトン生成にかかる説明を行う。なお、かかる変換クエリQ’において、「(2)」は「/Syain/ACT」に対応し、「(3)」は「chara」に対応し、「[(5):e1]」は、「[contains(cast,"浅井")]」に対応し、「[(6):e2]」は、「[contains(name,"ブルー")]」に対応する(変換クエリQ’に対応するオートマトンが、図16の下段に示すオートマトンとなる)。
Here, the processing of the
Q = / Syain / ACT / [contains (cast, "Asai")] chara [contains (name, "Blue")]
And a conversion query that converts each element of the query into a tag ID
Q '= (2) [(5): e1] (3) [(6): e2]
Let us explain the automaton generation. In this conversion query Q ′, “(2)” corresponds to “/ Syain / ACT”, “(3)” corresponds to “chara”, and “[(5): e1]” corresponds to [contains (cast, "Asai")], and "[(6): e2]" corresponds to "[contains (name," blue ")]" (automaton corresponding to conversion query Q ' Is the automaton shown in the lower part of FIG. 16).
図16に示すオートマトンは、複数のノード構造体20〜27、イベント構造体30〜34を備えている。また、各ノード構造体20〜26、イベント構造体30〜31を結ぶ線は、かかる線に対応する条件を満たした場合に、矢印の方向に処理が移行することとなる。なお、図16におけるεは、無条件で矢印の方向に処理が移行することを示し、Σ\{n}は、n以外の場合に、矢印の方向に処理が移行することを示している。
The automaton illustrated in FIG. 16 includes a plurality of
まず、オートマトン作成部152は、変換クエリQ’を解析して、
述語パスIDの集合:A={a1,...an}(nは自然数)
分岐パスIDの集合:A={z1,...zn}(nは自然数)
文脈パスID:c
評価パスID:d
各ai∈Aに対するキーワード集合key(ai)
を抽出する。
First, the
Set of predicate path IDs: A = {a1, ... an} (n is a natural number)
Set of branch path IDs: A = {z1, ... zn} (n is a natural number)
Context path ID: c
Evaluation path ID: d
Keyword set key (ai) for each ai∈A
To extract.
図16に示す変換クエリQ’では、オートマトン作成部152は、述語パスIDの集合として、「(5)、(6)」を抽出し、分岐パスIDの集合として、「(2)、(3)」を抽出する。また、文脈パスIDとして「(3)」を抽出する。文脈パスIDの抽出方法としては、変換クエリQ’の最後の述語部[]の前に該当するものを抽出する。
In the conversion query Q ′ illustrated in FIG. 16, the
また、オートマトン作成部152は、評価パスIDとして「(2)」を抽出する。評価パスIDは、例えば、変換クエリQ’の最左のものが抽出される。そして、キーワード集合key(ai)として、「e1(浅井)」、「e2(ブルー)」を抽出する。
In addition, the
続いて、オートマトン作成部152は、オートマトンの初期状態Ini(図16のノード構造体20)、開始状態Open(開始記号”[”)を読んだ状態;ノード構造体21)、終了状態Close(終了記号”/”;ノード構造体27)を作成する。なお、Goto(Ini、”[”)=OpenおよびGoto(Ini、”/”)=Closeとする。
Subsequently, the
オートマトン作成部152は、任意のi=1〜nに対して、以下の処理1−1〜1−6を行う。まず、処理1−1において、オートマトン作成部152は、述語パスID(ai∈A)に対応する状態State(ai)を作成する。図16に示す例では、(5)に対応するState(a1)のノード構造体22と(6)に対応するState(a2)のノード構造体24とが生成される。
The
処理1−2において、オートマトン作成部152は、key(ai)を受理するキーワード参照オートマトンを作成し、各状態State(ai)のノード構造体からつなげる。図16に示す例では、State(a1)のノード構造体22からイベント構造体30「A1」に至るまでの各ノード構造体22,23とイベント構造体30とを繋ぎ、State(a2)のノード構造体24からイベント構造体31「A2」に至るまでのノード構造体24,25,26とイベント構造体31とを繋ぐ。
In process 1-2, the
続いて、処理1−3において、オートマトン作成部152は、各状態State(ai)に対して、Goto(Open,ai)=State(ai)となるように、State(a1)のノード構造体22とノード構造体21とを接続し、State(a2)のノード構造体24とノード構造体21とを接続する。
Subsequently, in process 1-3, the
また、処理1−4では、オートマトン作成部152は、パストライ上におけるaiの任意の子供に対して、Goto(Close,b)=State(ai)となるように、State(a2)のノード構造体24とノード構造体27とを接続する。図16に示す例では、タグID(6)に該当するタグ(name)の子供がタグID(7)に該当するタグ(ID)となる。
Also, in process 1-4, the
処理1−5において、オートマトン作成部152は、分岐パスID(zi∈)に対応する状態State(zi)を作成する。図16に示す例では、(2)に対応するState(z1)のイベント構造体32「Z1」と、(3)に対応するState(z2)のイベント構造体33「Z2」とが生成される。
In process 1-5, the
処理1−6において、オートマトン作成部152は、各状態State(z1)に対して、Goto(close,zi)=State(zi)となるように、State(z1)のイベント構造体32とノード構造体27とを接続し、State(z2)のイベント構造体33とノード構造体27とを接続する。
In process 1-6, the
続いて、オートマトン作成部152は、文脈パスID「c」に対する状態State(c)を作成する。図16に示す例では、イベント構造体34「C」が作成される。そして、Goto(Open,c)=State(c)となるように、ノード構造体21とイベント構造体34とを接続する。
Subsequently, the
また、オートマトン作成部152は、評価パスID「d」に対応する状態State(d)を作成する。図16に示す例では、イベント構造体32「D」が作成される(図16では、「Z1」と「D」とを一つのイベント構造体32にまとめている)。そして、そして、Goto(close,d)=State(d)となるように、ノード構造体33とイベント構造体27とを接続する。
Further, the
上述したような各種の処理をオートマトン作成部152は実行し、変換クエリQ’に対応するオートマトンデータを作成し、作成したオートマトンデータを記憶部130に記憶する。
The
ここで、上述したオートマトンデータに含まれるノード構造体のデータ構造およびイベント構造体のデータ構造について説明する。図17は、ノード構造体のデータ構造の一例を示す図であり、図18は、イベント構造体のデータ構造の一例を示す図である。 Here, the data structure of the node structure and the data structure of the event structure included in the above-described automaton data will be described. FIG. 17 is a diagram illustrating an example of the data structure of the node structure, and FIG. 18 is a diagram illustrating an example of the data structure of the event structure.
図17に示すように、ノード構造体は、ノード構造体を識別するノードIDと、イベント構造体へのポインタと、他のノード構造体へのポインタを備える。例えば、図16に示すノード構造体21を例にあげると、イベント構造体へのポインタは、イベント構造体34に該当するポインタが格納される。また、ノード構造体へのポインタは、ノード20,22,24に該当するポインタが格納される。
As shown in FIG. 17, the node structure includes a node ID for identifying the node structure, a pointer to the event structure, and a pointer to another node structure. For example, taking the
また、図18に示すように、イベント構造体は、イベント構造体を識別するイベントIDと、クエリを識別するクエリIDと、イベント型(文脈ノード検出イベント、述語受理イベント、述語評価イベント、クエリ評価イベント)を識別するイベント型と、イベント構造体のデータ位置と、他のイベント構造体へのポインタを備える。 As shown in FIG. 18, the event structure includes an event ID for identifying the event structure, a query ID for identifying the query, and an event type (context node detection event, predicate acceptance event, predicate evaluation event, query evaluation). Event type for identifying the event), the data position of the event structure, and pointers to other event structures.
図4の説明に戻ると、照合処理部153は、BINファイル133とオートマトンデータ136と基にして、クエリデータ134に該当するデータを出力する手段である。ここで、照合処理部153の処理を具体的に説明する。なお、ここでは説明の便宜上、図19に示すBINファイルと、図16に示したオートマトンデータとを用いて説明する。図19は、照合処理を説明するためのBINファイルのデータ構造の一例を示す図である。
Returning to the explanation of FIG. 4, the
なお、照合処理部153がBINファイルをオートマトンデータ代入して処理を遂行する過程において発生するイベントEを、E=(Q,T,P)と定義する。ここで、イベントEに含まれる「Q」はクエリIDを示し、「T」はイベント型を示し、「P」はイベントが発生した瞬間のデータ位置を示す。
An event E that occurs in the process in which the
照合処理部153は、イベントEの「T」が文脈ノード検出イベント(C)のとき、クエリID「Q」のヒットテーブル137(図12参照)に新規エントリを登録し、登録した新規エントリの内容に、現在のスタック138(図13参照)の内容を登録する。
When “T” of event E is the context node detection event (C), the matching
照合処理部153は、イベントEの「T」が述語受理イベント(Am)のとき、クエリID「Q」のヒットテーブル137、およびスタック138の第m項目にイベントEに含まれる「P」を登録する。
When “T” of event E is a predicate acceptance event (Am), the matching
照合処理部153は、イベントEの「T」が述語評価イベント(Zm)のとき、クエリID「Q」のヒットテーブル137において、第m目が空欄となっているエントリを削除し、スタック138の第m項目を削除する。
When “T” of event E is a predicate evaluation event (Zm), the matching
照合処理部153は、イベントEの「T」がクエリ評価イベント(D)のとき、クエリID「Q」のヒットテーブルに生き残っているエントリを、正解として出力部120に出力する。
When “T” of event E is a query evaluation event (D), the
以上をふまえた上で、図16に示すオートマトンと図19に示すBINファイルと用いた照合処理部153の処理をBINファイルの位置「1001」〜「1011」に分けて説明する。
Based on the above, the processing of the
(BINファイルの位置「1001」)
照合処理部153は、BINファイルの位置「1001」に対応するデータ「[(1) シグマ戦隊中原ジャー」をオートマトンに代入する。すると、かかるデータは、ノード構造体20を始点とし、ノード構造体21に移行した段階で、次に対応する文字が存在しなくなるため、ノード構造体20に戻り、位置「1001」の検索は終了する。
(BIN file position “1001”)
The matching
(BINファイルの位置「1002」)
照合処理部153は、BINファイルの位置「1002」に対応するデータ「[(2)」をオートマトンに代入する。すると、かかるデータは、ノード構造体20を始点とし、ノード構造体21に移行した段階で、次に対応する文字が存在しなくなるため、ノード構造体20に戻り、位置「1002」の検索は終了する。
(BIN file position “1002”)
The
(BINファイルの位置「1003」)
照合処理部153は、BINファイルの位置「1003」に対応するデータ「[(3) シグマブルー1」をオートマトンに代入する。すると、かかるデータは、ノード構造体20を始点として、イベント構造体34に到達する。イベント構造体34に到達した時点で、照合処理部153は、イベントE1=(Q1、C、1003)を発生させる。
(BIN file position “1003”)
The matching
図20は、イベントE1=(Q1、C、1003)が発生した時点での、ヒットテーブル137の状態を示す図である。なお、図20に示すヒットテーブル137の「1003」の行に対応する、A1〜Amには、スタック138の値がコピーされる(現段階において、スタック138には何も登録されていないので、ヒットテーブル137に現段階で何もコピーされない)。
FIG. 20 is a diagram illustrating the state of the hit table 137 when the event E1 = (Q1, C, 1003) occurs. Note that the values of the
(BINファイルの位置「1004」)
照合処理部153は、BINファイルの位置「1004」に対応するデータ「[(6) ブルー /(6)」をオートマトンに代入する。すると、かかるデータは、ノード構造体20を始点として、イベント構造体31に到達する。イベント構造体31に到達した時点で、照合処理部153は、イベントE2=(Q1、A2、1004)を発生させる。
(BIN file position “1004”)
The matching
図21は、イベントE2=(Q1、A2、1004)が発生した時点でのヒットテーブル137の状態を示す図であり、図22は、イベントE2=(Q2、A2、1004)が発生した時点でのスタック138の状態を示す図である。図21、図22に示すように、「A2」の該当位置に「1004」が登録される。
FIG. 21 is a diagram showing the state of the hit table 137 when the event E2 = (Q1, A2, 1004) occurs. FIG. 22 shows the state when the event E2 = (Q2, A2, 1004) occurs. It is a figure which shows the state of the
(BINファイルの位置「1005」)
照合処理部153は、BINファイルの位置「1005」に対応するデータ「/(3)」をオートマトンに代入する。すると、かかるデータは、ノード構造体20を始点として、イベント構造体32に到達する。イベント構造体32に到達した時点で、照合処理部153は、イベントE3=(Q1、Z2、1005)を発生させる。
(BIN file location “1005”)
The matching
イベントE3=(Q1、Z2、1005)が発生すると、照合処理部153は、ヒットテーブル137を参照し、「A2」が未設定の行を削除する。なお、図21に示すように、現段階で、ヒットテーブル137には、「A2」に値が設定されているため、行の削除は実行されない。また、イベントE3=(Q1、Z2、1005)が発生すると、照合処理部153は、スタック138の「A2」をクリアする。
When the event E3 = (Q1, Z2, 1005) occurs, the
(BINファイルの位置「1006」)
照合処理部153は、BINファイルの位置「1006」に対応するデータ「[(3) シグマブルー2」をオートマトンに代入する。すると、かかるデータは、ノード構造体20を始点として、イベント構造体34に到達する。イベント構造体34に到達した時点で、照合処理部153は、イベントE4=(Q1、C、1006)を発生させる。
(BIN file location “1006”)
The matching
図23は、イベントE4=(Q1、C、1006)が発生した時点でのヒットテーブル137の状態を示す図である。同図に示すように、ヒットテーブル137の「C」の列に「1006」が登録される。 FIG. 23 is a diagram showing the state of the hit table 137 when the event E4 = (Q1, C, 1006) occurs. As shown in the figure, “1006” is registered in the “C” column of the hit table 137.
(BINファイルの位置「1007」)
照合処理部153は、BINファイルの位置「1007」に対応するデータ「[(6) ブルー /(6)」をオートマトンに代入する。すると、かかるデータは、ノード構造体20を始点として、イベント構造体31に到達する。イベント構造体31に到達した時点で、照合処理部153は、イベントE5=(Q1、A2、1007)を発生させる。
(BIN file location “1007”)
The matching
図24は、イベントE5=(Q1、A2、1007)が発生した時点でのヒットテーブル137の状態を示す図であり、図25は、イベントE5=(Q1、A2、1007)が発生した時点でのスタック138の状態を示す図である。図24、図25に示すように、「A2」の該当位置に「1007」が登録される。
FIG. 24 is a diagram showing the state of the hit table 137 when the event E5 = (Q1, A2, 1007) occurs, and FIG. 25 shows the state when the event E5 = (Q1, A2, 1007) occurs. It is a figure which shows the state of the
(BINファイルの位置「1008」)
照合処理部153は、BINファイルの位置「1008」に対するデータ「/(3)」をオートマトンに代入する。すると、かかるデータは、ノード構造体20を始点として、イベント構造体33に到達する。イベント構造体33に到達した時点で、照合処理部153は、イベントE6=(Q1、Z2、1008)を発生させる。
(BIN file location “1008”)
The
イベントE6=(Q1、Z2、1008)が発生すると、照合処理部153は、ヒットテーブル137を参照し、「A2」が未設定の行を削除する。なお、図24に示すように、現段階で、ヒットテーブル137には、「A2」に値が設定されているため、行の削除は実行されない。また、イベントE6=(Q1、Z2、1008)が発生すると、照合処理部153は、スタック138の「A2」をクリアする。
When the event E6 = (Q1, Z2, 1008) occurs, the
(BINファイルの位置「1009」)
照合処理部153は、BINファイルの位置「1009」に対するデータ「[(5) 浅井達哉 /(5)」をオートマトンに代入する。すると、かかるデータは、ノード構造体20を始点として、イベント構造体30に到達する。イベント構造体30に到達した時点で、照合処理部153は、イベントE7=(Q1、A1、1009)を発生させる。
(BIN file position “1009”)
The matching
図26は、イベントE7=(Q1、A1、1009)が発生した時点でのヒットテーブル137の状態を示す図であり、図27は、イベントE7=(Q1、A1、1009)が発生した時点でのスタック138の状態を示す図である。図26、図27に示すように、「A1」の該当位置「1009」が登録される。
FIG. 26 is a diagram showing the state of the hit table 137 when the event E7 = (Q1, A1, 1009) occurs, and FIG. 27 shows the state when the event E7 = (Q1, A1, 1009) occurs. It is a figure which shows the state of the
(BINファイルの位置「1010」)
照合処理部153は、BINファイルの位置「1010」に対するデータ「/(2)」をオートマトンに代入する。するとかかるデータは、ノード構造体20を始点として、イベント構造体32に到達する。イベント構造体32に到達した時点で、照合処理部153は、イベントE8=(Q1、Z1、1010)、E9=(Q1、D、1010)を発生させる。
(BIN file position “1010”)
The matching
イベントE8=(Q1、Z1、1010)が発生すると、照合処理部153は、ヒットテーブル137を参照し、「A1」が未設定の行を削除する。なお、図26に示すように、現段階で、ヒットテーブル137には、「A1」に値が設定されているため、行の削除は実行されない。また、イベントE8=(Q1、Z1、1010)が発生すると、照合処理部153は、スタック138の「A1」をクリアする。
When the event E8 = (Q1, Z1, 1010) occurs, the
イベントE9=(Q1、D、1010)が発生すると、照合処理部153は、ヒットテーブル137を参照し、ヒットテーブル137の「C」列に登録された位置情報を出力部120に出力する。図26に示す例では、BINファイルの位置「1003」、「1006」が出力される。かかる位置データが、クエリデータ134に該当するデータとなる。なお、イベントE9=(Q1、D、1010)が発生すると、照合処理部153は、ヒットテーブル137に登録されたデータを削除する。
When the event E9 = (Q1, D, 1010) occurs, the matching
(BINファイル位置「1011」)
照合処理部153は、BINファイルの位置「1011」に対応するデータ「/(1)」をオートマトンに代入する。すると、かかるデータは、ノード構造体20を始点とし、ノード構造体27に移行した段階で、次に対応する文字が存在しなくなるため、ノード構造体20に戻り、位置「1011」の検索は終了する。
(BIN file position “1011”)
The matching
次に、本実施例にかかる照合処理装置100の処理について説明する。図28は、本実施例にかかる照合処理装置100の処理手順を示すフローチャートである。同図に示すように、照合処理装置100は、XMLデータ131を取得し(ステップS101)、パストライ作成部141がXMLデータ131を基にしてパストライ132を作成し(ステップS102)、BINファイル作成部142がXMLデータ131およびパストライ132を基にしてBINファイルを作成する(ステップS103)。
Next, the process of the
そして、照合処理装置100は、クエリデータ134を取得し(ステップS104)、クエリデータ134に逆行軸が存在するか(あるいは、軸変換が必要であるか)否かを判定する(ステップS105)。
And the
クエリデータ134に逆行軸が存在しない場合(あるいは、軸変換が不要な場合)には(ステップS106,No)、ステップS108に移行する。ステップS108に関する説明は後述する。 If there is no retrograde axis in the query data 134 (or if no axis conversion is required) (No in step S106), the process proceeds to step S108. The description regarding step S108 will be described later.
一方、クエリデータ134に逆行軸が存在する場合(あるいは、軸変換が必要な場合)には(ステップS106,Yes)、軸変換処理部151がクエリデータ134の軸変換処理を実行し(ステップS107)、クエリデータ134の各要素をタグID(パスID)に変換する(ステップS108)。
On the other hand, when the retrograde axis exists in the query data 134 (or when axis conversion is necessary) (Yes in step S106), the axis conversion processing unit 151 executes the axis conversion process of the query data 134 (step S107). ), Each element of the
そして、照合処理装置100は、オートマトン作成部152がクエリデータ134を基にしてオートマトンデータ136を作成し(ステップS109)、照合処理部153がオートマトンデータ136とBINファイル133に基づいて、照合処理を実行する(ステップS110)。
Then, in the
次に、図28のステップS107に示した軸変換処理について説明する。図29は、本実施例にかかる軸変換処理を示すフローチャートである。同図に示すように、軸変換処理部151は、クエリデータのパス表現をπとし、兄弟対応テーブル135を初期化して(ステップS201)、πに兄弟軸が存在するか否かを判定する(ステップS202)。 Next, the axis conversion process shown in step S107 of FIG. 28 will be described. FIG. 29 is a flowchart illustrating the axis conversion process according to the present embodiment. As shown in the figure, the axis conversion processing unit 151 sets π as the path expression of the query data, initializes the sibling correspondence table 135 (step S201), and determines whether or not a sibling axis exists in π ( Step S202).
πに兄弟軸が存在しない場合には(ステップS203,No)、ステップS208に移行する。ステップS208に関する説明は後述する。一方、πに兄弟軸が存在する場合には(ステップS203,Yes)、πの一番左の兄弟軸に、兄弟軸変換ルールを適用し(ステップS204)、兄弟対応テーブル135に兄弟関係を登録する(ステップS205)。 If no sibling axis exists in π (step S203, No), the process proceeds to step S208. The description regarding step S208 will be described later. On the other hand, if there is a sibling axis in π (step S203, Yes), the sibling axis conversion rule is applied to the leftmost sibling axis of π (step S204), and the sibling relationship is registered in the sibling correspondence table 135. (Step S205).
そして、軸変換処理部151は、同値性ルールが適用できる場合に、πに同値性ルールを適用し(ステップS206)、クエリデータ134のパス表現πを更新する(ステップS207)。 When the equivalence rule can be applied, the axis conversion processing unit 151 applies the equivalence rule to π (step S206) and updates the path expression π of the query data 134 (step S207).
続いて、軸変換処理部151は、πに親軸が存在するか否かを判定し(ステップS208)、πに親軸が存在しない場合には(ステップS209,No)、ステップS213に移行する。ステップS213に関する説明は後述する。 Subsequently, the axis conversion processing unit 151 determines whether or not a parent axis exists in π (step S208). If no parent axis exists in π (step S209, No), the process proceeds to step S213. . The description regarding step S213 will be described later.
一方、πに親軸が存在する場合には(ステップS209,Yes)、πの一番左の親軸に、親軸変換ルールを適用し(ステップS210)、同値性ルールが適用できる場合に、πに同値性ルールを適用し(ステップS211)、クエリデータ134のパス表現πを更新し(ステップS212)、クエリデータ134のパス表現πと兄弟対応テーブル135を出力する(ステップS213)。
On the other hand, when the parent axis exists in π (step S209, Yes), the parent axis conversion rule is applied to the leftmost parent axis of π (step S210), and the equivalence rule can be applied. The equivalence rule is applied to π (step S211), the path expression π of the
次に、図28のステップS109に示したオートマトン作成処理について説明する。図30は、本実施例にかかるオートマトン作成処理を示すフローチャートである。同図に示すように、オートマトン作成部152は、クエリデータ134を解析し、述語パスIDの集合、分岐パスIDの集合、文脈パスID、キーワード集合を抽出する(ステップS301)。
Next, the automaton creation process shown in step S109 of FIG. 28 will be described. FIG. 30 is a flowchart illustrating the automaton creation process according to the present embodiment. As shown in the figure, the
そして、オートマトン作成部152は、オートマトンの初期状態Ini、開始状態Open、終了状態Closeを作成し(ステップS302)、述語パスIDに対応する状態State(ai)を作成し(ステップS303)、キーワード集合を受理する照合オートマトンを作成しState(ai)に接続する(ステップS304)。
Then, the
続いて、オートマトン作成部152は、Goto(Opne,ai)=State(ai)に設定し(ステップS305)、パストライ上におけるaiの任意の子供bに対して、Goto(Close,d)=State(ai)に設定し(ステップS306)、分岐パスIDに対する状態State(zi)を作成し(ステップS307)、Goto(Opne,zi)=State(zi)に設定する(ステップS308)。
Subsequently, the
そして、オートマトン作成部152は、文脈パスIDに対する状態State(c)を作成し(ステップS309)、Goto(Open,c)=State(c)に設定し(ステップS310)、評価パスIDに対応する状態State(d)を作成し(ステップS311)、Goto(Open,d)=State(d)に設定する(ステップS312)。
Then, the
次に、図28のステップS110に示した照合処理について説明する。図31は、本実施例にかかる照合処理を示すフローチャートである。同図に示すように、照合処理部153は、s=Ini(初期状態)に設定し(ステップS401)、BINファイル133に次の文字aが存在するか否かを判定し(ステップS402)、存在しない場合には(ステップS403,No)、照合処理を終了する。
Next, the collation process shown in step S110 of FIG. 28 will be described. FIG. 31 is a flowchart illustrating the collating process according to the present embodiment. As shown in the figure, the
一方、BINファイル133に次の文字aが存在する場合には(ステップS403,Yes)、s=Goto(s,a)とし(ステップS404)、sがイベント発生ノードか否か判定する(ステップS405)。 On the other hand, when the next character a is present in the BIN file 133 (step S403, Yes), s = Goto (s, a) is set (step S404), and it is determined whether or not s is an event occurrence node (step S405). ).
そして、照合処理部153は、sがイベント発生ノードでない場合には(ステップS406,No)、ステップS402に移行する。一方、sがイベント発生ノードである場合には(ステップS406,Yes)、イベント評価処理を実行して(ステップS407)、ステップS402に移行する。
Then, when s is not an event occurrence node (No at Step S406), the
次に、図31のステップS407に示したイベント評価処理について説明する。図32は、本実施例にかかるイベント評価処理を示すフローチャートである。同図に示すように、照合処理部153は、発生したイベントをE=(Q,T,P)とし、Qのヒットテーブル137をH(Q)に設定し(ステップS501)、スタック138をStack=φで初期化する(ステップS502)。
Next, the event evaluation process shown in step S407 of FIG. 31 will be described. FIG. 32 is a flowchart illustrating event evaluation processing according to the present embodiment. As shown in the figure, the
そして、照合処理部153は、Tが文脈検出イベントか否かを判定し(ステップS503)、文脈検出イベントである場合には(ステップS504,Yes)、ヒットテーブルH(Q)に新規エントリ(P、Stack)を追加し(ステップS505)、イベント評価処理を終了する。
Then, the matching
一方、Tが文脈検出イベントでない場合には(ステップS504,No)、Tが述語受理イベント(Am)であるか否かを判定し(ステップS506)、述語受理イベント(Am)である場合には(ステップS507,Yes)、ヒットテーブルH(Q)の第m項目にPを記入し、スタックの第m項目にPを記入し(ステップS508)、イベント評価処理を終了する。 On the other hand, when T is not a context detection event (step S504, No), it is determined whether T is a predicate acceptance event (Am) (step S506), and when T is a predicate acceptance event (Am). (Step S507, Yes), P is entered in the m-th item of the hit table H (Q), P is entered in the m-th item of the stack (step S508), and the event evaluation process is terminated.
一方、Tが述語受理イベント(Am)でない場合には(ステップS507,No)、Tが述語受理イベント(Zm)か否かを判定し(ステップS509)、述語受理イベント(Zm)である場合には(ステップS510,Yes)、ヒットテーブルH(Q)の全エントリのうち、第m項目が空欄であるものを削除し、スタック138の第m項目を削除し(ステップS511)、イベント評価処理を終了する。 On the other hand, if T is not a predicate acceptance event (Am) (step S507, No), it is determined whether T is a predicate acceptance event (Zm) (step S509), and if T is a predicate acceptance event (Zm). (Yes in step S510), deletes all entries in the hit table H (Q) whose mth item is blank, deletes the mth item in the stack 138 (step S511), and performs event evaluation processing. finish.
一方、Tが述語受理イベント(Zm)でない場合には(ステップS510,No)、Tをクエリ評価イベントと判定し(ステップS512)、ヒットテーブルH(Q)の全エントリを解として出力し(ステップS513)、ヒットテーブルH(Q)をクリアする(ステップS514)。 On the other hand, if T is not a predicate acceptance event (Zm) (step S510, No), T is determined as a query evaluation event (step S512), and all entries in the hit table H (Q) are output as solutions (step S512). S513), the hit table H (Q) is cleared (step S514).
上述してきたように、本実施例にかかる照合処理装置100は、パストライ作成部141がXMLデータ131に基づいてパストライ132を作成し、BINファイル作成部142がXMLデータ131およびパストライ132に基づいてBINファイル133を作成する。そして、軸変換処理部151が軸変換アルゴリズムに基づいて、クエリデータ134の軸変換処理を行い、オートマトン作成部152が軸変換されたクエリデータ134に基づいてオートマトンデータ136を作成し、照合処理部153がオートマトンデータ136にBINファイル133を入力してクエリデータ134に該当するデータを出力するので、クエリデータの逆行軸など含まれていても、ストリーム処理によって、XMLデータ131からクエリデータに該当するデータを検索することができる。
As described above, in the
また、本実施例にかかる照合処理装置100は、BINファイル作成部142が、XMLデータ131の各要素をタグIDに変換したBINファイル133を作成し、照合処理部153が、タグIDに変換されたBINファイル133を用いて数値比較のみの照合処理を行うので、照合処理装置100にかかる負担を軽減させることができる。
Further, in the
また、本実施例にかかる照合処理装置100は、軸変換処理部151が軸変換アルゴリズム(兄弟軸変換ルール、親軸変換ルール、同値性ルール)に基づいて、クエリデータ134の全ての軸を子供軸に変換するので、クエリデータ134の階層管理が不要になり、高速にクエリデータ134に該当するデータを検索することができる。
Further, in the
ところで、本実施例において説明した各処理のうち、自動的に行われるものとして説明した処理の全部または一部を手動的に行うこともでき、あるいは、手動的に行われるものとして説明した処理の全部あるいは一部を公知の方法で自動的に行うこともできる。この他、上記文書中や図面中で示した処理手順、制御手順、具体的名称、各種のデータやパラメータを含む情報については、特記する場合を除いて任意に変更することができる。 By the way, among the processes described in the present embodiment, all or a part of the processes described as being automatically performed can be manually performed, or the processes described as being performed manually can be performed. All or a part can be automatically performed by a known method. In addition, the processing procedure, control procedure, specific name, and information including various data and parameters shown in the above-described document and drawings can be arbitrarily changed unless otherwise specified.
また、図4に示した照合処理装置100の構成は機能概念的なものであり、必ずしも物理的に図示の如く構成されていることを要しない。すなわち、各装置の分散・統合の具体的形態は図示のものに限られず、その全部または一部を、各種の負荷や使用状況などに応じて、任意の単位で機能的または物理的に分散・統合して構成することができる。さらに、各装置にて行われる各処理機能は、その全部または任意の一部がCPU(あるいは、MCU、MPU)および当該CPUにて解析実行されるプログラムにて実現され、あるいは、ワイヤードロジックによるハードウェアとして実現され得る。
Further, the configuration of the
図33は、図4に示した照合処理装置100が備えるコンピュータのハードウェア構成を示す図である。このコンピュータ60は、ユーザからのデータの入力を受け付ける入力装置61、モニタ62、RAM(Random Access Memory)63、ROM(Read Only Memory)64、記憶媒体からデータを読み取る媒体読取装置65、CPU(Central Processing Unit)66、およびHDD(Hard Disk Drive)67をバス68で接続して構成される。
FIG. 33 is a diagram illustrating a hardware configuration of a computer included in the
そして、HDD67には、上述した照合処理装置100の機能と同様の機能を発揮する前処理プログラム67b、後処理プログラム67cが記憶されている。そして、CPU66が前処理プログラム67b、後処理プログラム67cをHDD67から読み出して実行することにより、上述した照合処理装置100の機能部の機能を実現する前処理プロセス66a、後処理プロセス66bが起動される。この前処理プロセス66a、後処理プロセス66bは、図4に示した前処理部140、後処理部150にそれぞれ対応する。
The
また、HDD67には、上述した照合処理装置100の記憶部130に記憶されるデータに対応する各種データ67aが記憶される。この各種データ67aは、図4に示したXMLデータ131、パストライ132、BINファイル133、クエリデータ134、兄弟対応テーブル135、オートマトンデータ136、ヒットテーブル137、スタック138に対応する。
In addition, the
CPU66は、各種データ67aをHDD67に記憶するとともに、各種データ67aをHDD67から読み出してRAM63に格納し、RAM63に格納された各種データ63aを利用して照合処理を行う。
The
(付記1)コンピュータに
要素識別子により要素が区切られた階層構造を有する文書データを記憶装置に記憶する文書記憶手順と、
前記記憶装置に記憶された文書データに含まれるデータを検索する検索式を取得した場合に、取得した検索式に対して軸変換を実行し、当該検索式を子供軸によって構成される検索式に変換する軸変換手順と、
前記軸変換手順によって変換された検索式に含まれる要素識別子の種類を識別して当該検索式に対応するオートマトンを作成するオートマトン作成手順と、
前記文書データに含まれるデータと前記オートマトンとを順に照合して前記検索式に該当するデータを出力する照合処理手順と、
を実行させるための照合処理プログラム。
(Supplementary note 1) Document storage procedure for storing document data having a hierarchical structure in which elements are separated by element identifiers in a storage device in a computer;
When a search expression for searching for data included in document data stored in the storage device is acquired, axis conversion is performed on the acquired search expression, and the search expression is converted into a search expression configured by child axes. Axis conversion procedure to convert,
An automaton creation procedure for identifying an element identifier type included in the search expression converted by the axis conversion procedure and creating an automaton corresponding to the search expression;
A collation processing procedure for collating data contained in the document data and the automaton in order and outputting data corresponding to the search formula;
Verification processing program for executing
(付記2)前記軸変換手順は、前記検索式に兄弟軸が存在しているか否かを判定し、兄弟軸が存在している場合に、当該兄弟軸を親軸と子供軸とに変換することを特徴とする付記1に記載の照合処理プログラム。
(Supplementary Note 2) The axis conversion procedure determines whether or not a sibling axis exists in the search expression, and if a sibling axis exists, converts the sibling axis into a parent axis and a child axis. The collation processing program according to
(付記3)前記照合処理手順は、前記文書データに含まれるデータと前記オートマトンとを順に照合していく過程において検出されるデータを一時記憶テーブルに順次記憶し、照合が終了した時点において前記一時記憶テーブルに記憶されているデータを出力することを特徴とする付記1または2に記載の照合処理プログラム。
(Supplementary Note 3) The collation processing procedure sequentially stores data detected in the process of collating the data included in the document data with the automaton in the temporary storage table, and the temporary data is stored when the collation is completed. The collation processing program according to
(付記4)前記記憶装置に記憶された文書データおよび検索式に含まれる各要素識別子を数値に変換する数値変換手順を更にコンピュータに実行させることを特徴とする付記1〜3のいずれか一つに記載の照合処理プログラム。
(Supplementary note 4) Any one of
(付記5)要素識別子により要素が区切られた階層構造を有する文書データを記憶装置に記憶する文書記憶工程と、
前記記憶装置に記憶された文書データに含まれるデータを検索する検索式を取得した場合に、取得した検索式に対して軸変換を実行し、当該検索式を子供軸によって構成される検索式に変換する軸変換工程と、
前記軸変換工程によって変換された検索式に含まれる要素識別子の種類を識別して当該検索式に対応するオートマトンを作成するオートマトン作成工程と、
前記文書データに含まれるデータと前記オートマトンとを順に照合して前記検索式に該当するデータを出力する照合処理工程と、
を含んだことを特徴とする照合処理方法。
(Supplementary Note 5) Document storage step of storing document data having a hierarchical structure in which elements are divided by element identifiers in a storage device;
When a search expression for searching for data included in document data stored in the storage device is acquired, axis conversion is performed on the acquired search expression, and the search expression is converted into a search expression configured by child axes. An axis conversion process to convert;
An automaton creating step of identifying an element identifier type included in the search formula converted by the axis conversion step and creating an automaton corresponding to the search formula;
A collation processing step of sequentially collating data included in the document data and the automaton and outputting data corresponding to the search formula;
The collation processing method characterized by including.
(付記6)要素識別子により要素が区切られた階層構造を有する文書データを記憶する文書記憶手段と、
前記文書記憶手段に記憶された文書データに含まれるデータを検索する検索式を取得した場合に、取得した検索式に対して軸変換を実行し、当該検索式を子供軸によって構成される検索式に変換する軸変換手段と、
前記軸変換手段によって変換された検索式に含まれる要素識別子の種類を識別して当該検索式に対応するオートマトンを作成するオートマトン作成手段と、
前記文書データに含まれるデータと前記オートマトンとを順に照合して前記検索式に該当するデータを出力する照合処理手段と、
を備えたことを特徴とする照合処理装置。
(Supplementary Note 6) Document storage means for storing document data having a hierarchical structure in which elements are divided by element identifiers;
When a search expression for searching for data included in document data stored in the document storage means is acquired, axis conversion is performed on the acquired search expression, and the search expression is configured by a child axis. Axis conversion means for converting to
Automaton creating means for identifying the type of element identifier included in the search expression converted by the axis conversion means and creating an automaton corresponding to the search expression;
Collating processing means for sequentially collating data included in the document data and the automaton and outputting data corresponding to the search formula;
A collation processing device comprising:
以上のように、本発明にかかる照合処理プログラムおよび照合処理装置は、要素識別子により要素が区切られた階層構造を有する文書データから検索式に該当するデータを検索する検索システムなどに有用であり、特に、検索式の構成によらず、高速に検索式に該当するデータを検索する必要がある場合に適している。 As described above, the collation processing program and the collation processing device according to the present invention are useful for a retrieval system that retrieves data corresponding to a retrieval formula from document data having a hierarchical structure in which elements are separated by element identifiers, In particular, it is suitable when it is necessary to search data corresponding to the search formula at a high speed regardless of the configuration of the search formula.
60 コンピュータ
61 入力装置
62 モニタ
63 RAM
63a,67a 各種データ
64 ROM
65 媒体読取装置
66 CPU
66a 前処理プロセス
66b 後処理プロセス
67 HDD
67b 前処理プログラム
67c 後処理プログラム
68 バス
100 照合処理装置
110 入力部
120 出力部
130 記憶部
131 XMLデータ
132 パストライ
133 BINファイル
134 クエリデータ
135 兄弟対応テーブル
136 オートマトンデータ
137 ヒットテーブル
138 スタック
140 前処理部
141 パストライ作成部
142 BINファイル作成部
150 後処理部
151 軸変換処理部
152 オートマトン作成部
153 照合処理部
60 Computer 61
63a, 67a
65
Claims (4)
要素識別子により要素が区切られた階層構造を有する文書データを記憶装置に記憶する文書記憶手順と、
前記記憶装置に記憶された文書データに含まれるデータを検索する検索式を取得し、前記検索式に兄弟軸が存在する場合に、前記検索式に対して軸変換を実行し、軸変換を行った検索式に親軸が含まれている場合には、軸変換を行った検索式に対して更に軸変換を実行することで、子供軸のみによって構成される検索式に変換する軸変換手順と、
前記軸変換手順によって変換された検索式に含まれる要素識別子の種類を識別して当該検索式に対応するオートマトンを作成するオートマトン作成手順と、
前記文書データに含まれるデータと前記オートマトンとを順に照合して前記検索式に該当するデータを出力する照合処理手順と、
を実行させるための照合処理プログラム。 A document storage procedure for storing, in a storage device, document data having a hierarchical structure in which elements are separated by element identifiers in a computer;
A search expression for searching for data included in the document data stored in the storage device is acquired, and when a sibling axis exists in the search expression, axis conversion is performed on the search expression to perform axis conversion. If the search formula contains a parent axis , an axis conversion procedure for converting to a search formula composed only of child axes by further performing axis conversion on the search formula that has undergone axis conversion, ,
An automaton creation procedure for identifying an element identifier type included in the search expression converted by the axis conversion procedure and creating an automaton corresponding to the search expression;
A collation processing procedure for collating data contained in the document data and the automaton in order and outputting data corresponding to the search formula;
Verification processing program for executing
前記文書記憶手段に記憶された文書データに含まれるデータを検索する検索式を取得し、前記検索式に兄弟軸が存在する場合に、前記検索式に対して軸変換を実行し、軸変換を行った検索式に親軸が含まれている場合には、軸変換を行った検索式に対して更に軸変換を実行することで、子供軸のみによって構成される検索式に変換する軸変換手段と、
前記軸変換手段によって変換された検索式に含まれる要素識別子の種類を識別して当該検索式に対応するオートマトンを作成するオートマトン作成手段と、
前記文書データに含まれるデータと前記オートマトンとを順に照合して前記検索式に該当するデータを出力する照合処理手段と、
を備えたことを特徴とする照合処理装置。 Document storage means for storing document data having a hierarchical structure in which elements are separated by element identifiers;
A search expression for searching for data included in the document data stored in the document storage means is acquired, and when there is a sibling axis in the search expression, axis conversion is performed on the search expression, and axis conversion is performed. Axis conversion means for converting into a search expression composed only of child axes by further performing axis conversion on the search expression that has undergone axis conversion when the search expression that has been performed includes a parent axis When,
Automaton creating means for identifying the type of element identifier included in the search expression converted by the axis conversion means and creating an automaton corresponding to the search expression;
Collating processing means for sequentially collating data included in the document data and the automaton and outputting data corresponding to the search formula;
A collation processing device comprising:
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007195081A JP5320697B2 (en) | 2007-07-26 | 2007-07-26 | Collation processing program and collation processing apparatus |
US12/179,212 US20090030887A1 (en) | 2007-07-26 | 2008-07-24 | Recording medium in which collation processing program is stored, collation processing device and collation processing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007195081A JP5320697B2 (en) | 2007-07-26 | 2007-07-26 | Collation processing program and collation processing apparatus |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2009032025A JP2009032025A (en) | 2009-02-12 |
JP5320697B2 true JP5320697B2 (en) | 2013-10-23 |
Family
ID=40296267
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007195081A Active JP5320697B2 (en) | 2007-07-26 | 2007-07-26 | Collation processing program and collation processing apparatus |
Country Status (2)
Country | Link |
---|---|
US (1) | US20090030887A1 (en) |
JP (1) | JP5320697B2 (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010191486A (en) | 2009-02-13 | 2010-09-02 | Sony Corp | Information processing apparatus, information processing method, and program |
JP5262864B2 (en) * | 2009-03-10 | 2013-08-14 | 富士通株式会社 | Storage medium, search method and search device |
JP5637896B2 (en) * | 2011-02-24 | 2014-12-10 | 富士通株式会社 | Window processing apparatus, method and program |
JP2013045208A (en) * | 2011-08-23 | 2013-03-04 | Fujitsu Ltd | Data generation method, device and program, retrieval processing method, and device and program |
CN103827861B (en) * | 2012-09-07 | 2017-09-08 | 株式会社东芝 | Structured document management device and method |
EP2738093B1 (en) | 2012-11-30 | 2015-09-02 | WB Electronics Spolka Akcyjna | Method of landing of a surveillance unmanned aerial vehicle and and a surveillance unmanned aerial vehicle |
JP5998942B2 (en) * | 2013-01-08 | 2016-09-28 | 富士通株式会社 | Update method, update program, and verification processing apparatus |
US20140351239A1 (en) * | 2013-05-23 | 2014-11-27 | Microsoft Corporation | Hardware acceleration for query operators |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4036718B2 (en) * | 2002-10-02 | 2008-01-23 | インターナショナル・ビジネス・マシーンズ・コーポレーション | Document search system, document search method, and program for executing document search |
US7171407B2 (en) * | 2002-10-03 | 2007-01-30 | International Business Machines Corporation | Method for streaming XPath processing with forward and backward axes |
JP4247108B2 (en) * | 2003-12-25 | 2009-04-02 | 株式会社東芝 | Structured document search method, structured document search device, and program |
US7469249B2 (en) * | 2004-03-08 | 2008-12-23 | International Business Machines Corporation | Query-driven partial materialization of relational-to-hierarchical mappings |
JP2006127235A (en) * | 2004-10-29 | 2006-05-18 | Toshiba Corp | Structured document management system, structured document management method and program |
US20070143321A1 (en) * | 2005-12-16 | 2007-06-21 | International Business Machines Corporation | Converting recursive hierarchical data to relational data |
-
2007
- 2007-07-26 JP JP2007195081A patent/JP5320697B2/en active Active
-
2008
- 2008-07-24 US US12/179,212 patent/US20090030887A1/en not_active Abandoned
Also Published As
Publication number | Publication date |
---|---|
US20090030887A1 (en) | 2009-01-29 |
JP2009032025A (en) | 2009-02-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5320697B2 (en) | Collation processing program and collation processing apparatus | |
JP4256416B2 (en) | Data structure conversion system and program | |
US6895550B2 (en) | Computer-implemented PDF document management | |
US20100281030A1 (en) | Document management & retrieval system and document management & retrieval method | |
WO2007116204A1 (en) | Information extraction methods and apparatus including a computer-user interface | |
Meuschke et al. | Improving academic plagiarism detection for STEM documents by analyzing mathematical content and citations | |
WO2008041366A1 (en) | Document searching device, document searching method, and document searching program | |
JP2008171181A (en) | Structured data search apparatus | |
JPH08147320A (en) | Information retrieving method and system | |
JP2010165272A (en) | Information processing method, information processor and program | |
WO2009113289A1 (en) | New case generation device, new case generation method, and new case generation program | |
JP3632643B2 (en) | Structured document management device | |
Awad et al. | An interactive tool for extracting low-quality spreadsheet tables and converting into relational database | |
JP6983105B2 (en) | Data storage system and data retrieval method | |
KR20220041337A (en) | Graph generation system of updating a search word from thesaurus and extracting core documents and method thereof | |
JP6589317B2 (en) | Rewriting device, processing method and program thereof, and information processing device | |
JP2007164462A (en) | Question answering system, question answering method and question answering program | |
JP2008269106A (en) | Schema extraction method, information processor, computer program, and recording medium | |
JP2008090396A (en) | Electronic document retrieval method, electronic document retrieval device, and program | |
Hsiao et al. | Extracting bibliographical data for PDF documents with HMM and external resources | |
CN112364175B (en) | Ontology concept hierarchy acquisition method, system and storage medium based on WEB resources | |
Boukhaled et al. | Stylistic Features Based on Sequential Rule Mining for Authorship Attribution | |
JP2009251845A (en) | Retrieval result evaluation device and retrieval result evaluation method | |
CN118051619A (en) | Author name disambiguation method based on network embedding and semantic characterization | |
JP5971571B2 (en) | Structural document management system, structural document management method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20100517 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20121002 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20121203 |
|
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: 20130618 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130701 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5320697 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |