JP3508623B2 - Structured document management system and method, and recording medium - Google Patents

Structured document management system and method, and recording medium

Info

Publication number
JP3508623B2
JP3508623B2 JP14115399A JP14115399A JP3508623B2 JP 3508623 B2 JP3508623 B2 JP 3508623B2 JP 14115399 A JP14115399 A JP 14115399A JP 14115399 A JP14115399 A JP 14115399A JP 3508623 B2 JP3508623 B2 JP 3508623B2
Authority
JP
Japan
Prior art keywords
attribute
document
name
index
dtd
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP14115399A
Other languages
Japanese (ja)
Other versions
JP2000331021A (en
Inventor
拓哉 北野
みさ 波内
邦敏 鶴岡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP14115399A priority Critical patent/JP3508623B2/en
Publication of JP2000331021A publication Critical patent/JP2000331021A/en
Application granted granted Critical
Publication of JP3508623B2 publication Critical patent/JP3508623B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、文書管理技術に関
し、特に、構造化文書をデータベースを用いて管理する
装置方法並びに記録媒体に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a document management technique, and more particularly to an apparatus method and a recording medium for managing a structured document using a database.

【0002】[0002]

【従来の技術】[構造化文書]テキスト文書の中に、記
号“<”と“>”とで囲まれた文字列、すなわちタグを文
書中に埋め込んで部分文書(「文書要素」という)を作
成し、文書要素単位で、文書の表示やデータ解析を行う
文書の作成手段として、SGML(Standardized Gene
ralized Markup Language)、XML(eXtensible M
arkup Language)、及びHTML(HyperText Markup
Language)などが知られている。これらSGML、X
ML、HTMLによって作成した文書を一般に、「構造
化文書」と呼ぶ。
2. Description of the Related Art [Structured document] In a text document, a character string surrounded by symbols "<" and ">", that is, a tag is embedded in the document to form a partial document (referred to as "document element"). SGML (Standardized Gene) is used as a document creation means for creating and displaying documents and data analysis in document element units.
ralized Markup Language), XML (eXtensible M)
arkup Language) and HTML (HyperText Markup)
Language) is known. These SGML, X
A document created by ML or HTML is generally called a "structured document".

【0003】タグのタグ名やタグ同士の関係などの定義
は、DTD(Document Type Definition;文書型定
義)によって与えており、構造化文書の文書要素の構造
は、このDTDのタグの定義に従うことになる。
Definitions such as tag names of tags and relationships between tags are given by DTD (Document Type Definition), and the structure of the document element of the structured document follows the definition of the tag of this DTD. become.

【0004】タグによって識別される文書要素(elemen
t;「要素」とも略記される)は、ある要素から見て0
または1つの親要素、すなわち自分自身を含む要素と、
0以上の子要素、すなわち自分がその内部に含む要素を
持ち、この構造を木構造で表現することができる。本明
細書では、この文書要素の木構造のことを、「構造化文
書の論理構造」と呼ぶ。
A document element (elemen identified by a tag
t; also abbreviated as "element") is 0 when viewed from an element.
Or one parent element, that is, an element that contains itself,
It has zero or more child elements, that is, elements contained within itself, and this structure can be represented by a tree structure. In this specification, the tree structure of this document element is referred to as a “logical structure of a structured document”.

【0005】[構造化文書のデータベースによる管理]
構造化文書の文書構造に関する情報をデータベースで管
理することにはいくつかの利点がある。データベースか
らの取出しの対象に、文書だけではなく文書中のタグに
よって識別される要素を単位とした部分文書(文書要
素)の取出しが可能となる。
[Management of structured document by database]
Managing information about the document structure of structured documents in a database has several advantages. It is possible to take out not only a document but also a partial document (document element) in which the element identified by the tag in the document is a unit to be taken out from the database.

【0006】またデータベースからの検索手段に、全文
検索や文書の書誌情報による検索に加えて、構造化文書
の論理構造に関する情報を条件とした検索が可能とな
る。すなわち要素の木構造上におけるさまざまな条件を
満たす文書、またはその文書要素を取り出すことが可能
となる。
In addition to the full-text search and the search based on the bibliographic information of the document, the search means from the database can perform the search on the condition of the information on the logical structure of the structured document. That is, it is possible to extract a document that satisfies various conditions on the tree structure of an element or a document element thereof.

【0007】このような構造化文書をデータベースに格
納し、文書構造や文書自身に対するインデックスを作成
し、このインデックスを利用して特定の文書及び文書要
素を管理・検索する技術に関する刊行物として、例えば
特開平6−131340号公報、特開平10−240752号公報等の
記載が参照される。
Such a structured document is stored in a database, an index is created for the document structure and the document itself, and a publication relating to a technique for managing and retrieving specific documents and document elements using this index, for example, Reference is made to the descriptions in JP-A-6-131340 and JP-A-10-240752.

【0008】このうち上記特開平6−131340号公報で
は、登録要求とともに処理対象を文書部品(すなわち要
素)として文書処理装置から受け付ける文書部品受付手
段と、前記受け付けた文書部品を解析して論理構造を特
定する論理構造特定手段と、前記文書部品を1以上保持
する文書部品保持手段と、前記特定した論理構造のイン
デックスを生成するインデックス生成手段と、前記生成
されたインデックスを1以上保持するインデックス保持
手段と、を有する構造化文書の文書部品管理装置の構成
が開示されており、実際の文書ファイルを恒常的な2次
記憶装置に格納し、インデックスに対してアクセスを行
うことにより、実際の文書ファイルを取り出すことな
く、文書の内部構造を条件とした検索が容易となり、ま
た、多量の文書群の中から特定の構造を高速に検索する
ことが可能としている。
Among them, in the above-mentioned Japanese Patent Laid-Open No. 6-131340, a document component receiving means for receiving a processing request as a document component (that is, an element) from a document processing device together with a registration request, and a logical structure by analyzing the received document component. , A document structure holding unit that holds one or more of the document parts, an index generation unit that generates an index of the specified logical structure, and an index holding unit that holds one or more generated indexes. And a structure of a document parts management device for a structured document having means, and storing the actual document file in a permanent secondary storage device and accessing the index to obtain the actual document. It becomes easy to search on the condition of the internal structure of the document without extracting the file. Is it possible to find the structure of the high-speed.

【0009】また上記特開平10−240752号公報には、構
造化文書を対象とした構造指定検索において、論理要素
の文書中における出現位置に関する条件を指定できるよ
うにして精度の高い構造指定検索を可能にすることを課
題として、文書をデータベースに登録する際、各登録対
象文書の持つ論理構造を重ね合わせ、文書中での出現位
置が等しい構造要素を単一のメタノードによって代表さ
せた構造インデックスを作成し、文書検索時には構造イ
ンデックスを参照して指定された構造条件を満足するメ
タノードの集合を求め、それらのメタノードの識別子を
キーとして文字列インデックスを検索することにより、
指定条件を満たす文書群を求める手段を提供し、これに
より、構造化文書の集合からなる文書データベース上に
おいて、精度の高い構造指定検索が可能とした方法が開
示されている。
Further, in the above-mentioned Japanese Patent Laid-Open No. 10-240752, in the structure designation search for a structured document, a highly accurate structure designation search is made possible by designating the condition regarding the appearance position of the logical element in the document. As an issue to be made possible, when registering a document in the database, the logical structure of each registration target document is overlapped, and the structure index that represents the structural elements with the same appearance position in the document by a single metanode is used. By creating and searching for a set of metanodes that satisfy the specified structure condition by referring to the structure index at the time of document search, and searching the character string index using the identifiers of these metanodes as keys,
Disclosed is a method for providing a means for obtaining a document group satisfying a specified condition, thereby enabling a highly accurate structure-specified search on a document database including a set of structured documents.

【0010】[0010]

【発明が解決しようとする課題】しかしながら、上記し
た刊行物等に記載された装置、及び方法は下記記載の問
題点を有している。
However, the apparatus and method described in the above publications have the following problems.

【0011】上記特開平10−240752号公報に記載される
方法は、複数の文書の論理構造を管理するインデックス
の作成に、その複数の文書の個々の論理構造を重ね合わ
せていくことによって作成している。具体的には、文書
をデータベースに登録する際、各登録対象文書の持つ論
理構造を重ね合わせ、文書中での出現位置が等しい構造
要素を単一のメタノードによって代表させた構造インデ
ックスを作成し、文書検索時には構造インデックスを参
照して指定された構造条件を満足するメタノードの集合
を求め、それらのメタノードの識別子をキーとして文字
列インデックスを検索することにより、指定条件を満た
す文書群を求めている。
The method described in Japanese Patent Laid-Open No. 10-240752 is created by creating an index for managing the logical structure of a plurality of documents and superimposing the individual logical structures of the plurality of documents. ing. Specifically, when registering a document in the database, the logical structure of each registration target document is overlaid, and a structure index is created in which structure elements that have the same appearance position in the document are represented by a single metanode. At the time of document retrieval, a set of metanodes that satisfy the specified structural condition is obtained by referring to the structure index, and a character string index is searched by using the identifiers of those metanodes as keys to obtain a document group that satisfies the specified condition. .

【0012】しかしながら、上記特開平10−240752号公
報に記載の方法では、このような複数の文書の論理構造
を重ね合わせることによって作成する構造インデックス
を検索時に利用して、ユーザが意図する論理構造条件に
適った文書を常に取出すことが保証できるか否か不明で
ある。
However, in the method described in the above-mentioned Japanese Patent Laid-Open No. 10-240752, the structural index created by superposing the logical structures of a plurality of such documents is utilized at the time of retrieval, and the logical structure intended by the user is used. It is unclear whether it can be guaranteed that the documents that meet the conditions are always taken out.

【0013】一般的に、構造化文書はある特定のDTD
に従い、DTDが異なる文書は一般的に種類が異なる文
書と判断される。
In general, a structured document is a particular DTD.
Accordingly, documents having different DTDs are generally judged to be different types of documents.

【0014】DTDが異なれば同じ要素名を持つ文書は
ほとんど存在しないであろうし、仮に同じ構造で同じ名
前をもつ要素が文書中に存在していたとしても、それが
同じ用法に基づいた同じ意味を持つものとは限らない。
Documents having the same element name will hardly exist if the DTDs are different, and even if an element having the same structure and the same name exists in the document, it has the same meaning based on the same usage. It is not always the one with.

【0015】上記特開平10−240752号公報に記載の方法
の問題は、DTDが異なる複数の文書を登録しようとす
る場合、文書中での出現位置が等しい構造要素を単一の
メタノードによって代表させた構造インデックスを作成
することが、実際には、不可能であり、仮にメタノード
を作成できたとしても、実際の文書の要素に対して意味
的な一意性を保証することはできない。
The problem of the method described in Japanese Patent Laid-Open No. 10-240752 is that when a plurality of documents having different DTDs are to be registered, structuring elements having the same appearance position in the document are represented by a single metanode. It is actually impossible to create a structured index, and even if a metanode can be created, it is not possible to guarantee semantic uniqueness for the elements of the actual document.

【0016】このため、そのような構造インデックスに
基づく検索によって取出した文書も、利用者が本当に意
図した構造要素に基づいて取出された文書かどうか保証
することはできない。
Therefore, it is not possible to guarantee whether the document retrieved by such a search based on the structural index is a document retrieved based on the structural element that the user really intended.

【0017】すなわち、上記特開平10−240752号公報に
記載の方法において、インデックスは、単一のDTD、
もしくは極めて類似したDTDに従う文書に対しては有
効な方法であるが、DTDの構造が大きく異なる文書に
対しては不利な方法といえる。
That is, in the method described in JP-A-10-240752, the index is a single DTD,
Alternatively, it is an effective method for documents conforming to extremely similar DTDs, but it is a disadvantageous method for documents having greatly different DTD structures.

【0018】一方、上記特開平6−131340号公報に記載
の装置では、論理構造のインデックスを生成するインデ
ックス生成手段を備え、インデックスに対してアクセス
を行うことにより、実際の文書ファイルを取り出すこと
なく、文書の内部構造を条件とした検索が容易となり、
また、多量の文書群の中から特定の構造を高速に検索す
ることが可能としているが、このインデックス構造に
は、登録情報、部品種別、部品種別による固有情報など
が設けられており、インデックスとしては、情報量が多
すぎる。
On the other hand, the apparatus described in the above-mentioned Japanese Patent Laid-Open No. 6-131340 is provided with index generating means for generating an index having a logical structure, and by accessing the index, without extracting the actual document file. , It becomes easy to search based on the internal structure of the document,
In addition, it is possible to search for a specific structure from a large number of documents at high speed, but this index structure contains registration information, part type, unique information by part type, etc. Has too much information.

【0019】一般に、インデックスの情報は、計算機の
メモリ上にロードされて計算されるが、計算機のメモリ
資源には限りがあり、一度にロード可能なインデックス
の情報量も制限される。
In general, index information is loaded and calculated in the memory of a computer, but the memory resources of the computer are limited and the amount of index information that can be loaded at one time is also limited.

【0020】一つの文書や一つの要素に対するインデッ
クスの情報量が小さければ小さいほど、より多くの文書
や要素に対するインデックスによる計算処理をメモリ上
で実行することが可能となり、結果として、より多量の
文書群の中から特定の構造を高速に検索することが可能
となる。
The smaller the information amount of the index for one document or one element, the more the calculation process by the index for more documents or elements can be executed on the memory, and as a result, the more documents there are. It is possible to quickly search for a specific structure in the group.

【0021】インデックスを利用した文書検索では、第
一に多量の文書群から目的の文書群をすばやく絞り込む
ことが大きな目的の一つである。
In the document search using the index, first of all, one of the major purposes is to quickly narrow down a target document group from a large number of document groups.

【0022】インデックス構造が内包するいくつかの情
報について、目的の文書群を絞り込んだ後に、文書中か
ら取出して照合しても、検索性能全体に影響を与えるこ
とは少ないはずである。
Even if the target document group is narrowed down with respect to some information contained in the index structure, and the information is retrieved and collated from the document, it should have little influence on the entire retrieval performance.

【0023】したがって本発明は、上記問題点に鑑みて
なされたものであって、その目的は、DTDが異なるな
ど、構造の異なる複数の文書の集合に対するインデック
ス付けし、前記複数の文書の集合に対する検索時のイン
デックスを利用する装置及び方法を提供することにあ
る。
Therefore, the present invention has been made in view of the above problems, and an object thereof is to index a set of a plurality of documents having different structures such as different DTDs, and to the set of a plurality of documents. An object of the present invention is to provide an apparatus and method that uses an index at the time of search.

【0024】本発明の他の目的は、インデックスの省メ
モリ化という観点から、情報量を極力抑え、構造化文書
の論理構造に基づく検索をより高速に行う方法及び装置
を提供することにある。これ以外の本発明の目的、特徴
等は以下の説明から直ちに明らかとされるであろう。
Another object of the present invention is to provide a method and apparatus for suppressing the amount of information as much as possible from the viewpoint of memory saving of an index and performing a search based on the logical structure of a structured document at a higher speed. Other objects, features, and the like of the present invention will be immediately apparent from the following description.

【0025】[0025]

【課題を解決するための手段】前記目的を達成する本発
明は、データベースのスキーマとして、文書を管理する
文書クラス、文書の集合を管理する文書フォルダクラ
ス、DTDを管理するDTDクラスを有し、文書クラス
には文書の要素の木構造関係を管理する要素ツリーイン
デックス、文書フォルダクラスには文書の要素、属性毎
にインデックスを作成し管理する要素−属性インデック
ス、DTDクラスには要素名と属性名をIDとして管理
するためのテーブルをそれぞれ持たせる。
According to the present invention to achieve the above object, a database schema includes a document class for managing documents, a document folder class for managing a set of documents, and a DTD class for managing DTDs. The document class is an element tree index that manages the tree structure relationship of document elements, the document folder class is a document element, and an element-attribute index that creates and manages an index for each attribute. The DTD class is an element name and attribute name. Each has a table for managing as an ID.

【0026】本発明において、データベースに文書を格
納する時に、文書格納実行手段の要素ツリーインデック
ス作成手段は、要素ツリーインデックスを、要素−属性
インデックス作成手段は要素−属性インデックスを、要
素−属性IDテーブル作成手段は要素−属性IDテーブ
ルをそれぞれ作成し、要素名IDと属性名IDは数値と
して与える。
In the present invention, when storing a document in the database, the element tree index creating means of the document storing execution means, the element tree index, the element-attribute index creating means the element-attribute index, and the element-attribute ID table. The creating means respectively creates the element-attribute ID table, and gives the element name ID and the attribute name ID as numerical values.

【0027】また本発明において、文書検索手段は、前
記要素ツリーインデックス、前記要素−属性IDテーブ
ル、前記要素−属性インデックスを用いて、前記データ
ベースから、構造化文書を検索する。文書要素の取出し
に際して、構造化文書中のある文書要素からの相対的な
関係として、前記文書要素に対する親要素、祖先要素、
子要素、子孫要素、兄要素、弟要素、前要素、次要素の
うちのいずれか又はこれらの組合せで取出しを行う。
In the present invention, the document retrieval means retrieves a structured document from the database using the element tree index, the element-attribute ID table, and the element-attribute index. When retrieving a document element, a parent element, an ancestor element for the document element, and a relative relationship from a document element in the structured document
The child element, the descendant element, the elder brother element, the younger brother element, the previous element, the next element, or a combination thereof is extracted.

【0028】[0028]

【発明の実施の形態】本発明の実施の形態について説明
する。図1は、本発明の一実施の形態の構成を示す図で
ある。本発明の一実施の形態において、データベース1
のスキーマのクラスとして、文書を管理する文書クラス
11と、文書の集合を管理する文書フォルダクラス12
と、DTDを管理するDTDクラス13とを有する。文
書クラス11には、文書の要素の木構造関係を管理する
要素ツリーインデックス14を持たせ、文書フォルダク
ラス12には、文書の要素ごと、属性ごとにインデック
スを作成し管理する要素−属性インデックス15を持た
せ、さらにDTDクラス13には要素名と属性名をID
として管理するための要素−属性IDテーブル16を持
たせる。
BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of the present invention will be described. FIG. 1 is a diagram showing a configuration of an embodiment of the present invention. In one embodiment of the present invention, the database 1
A document class 11 that manages documents and a document folder class 12 that manages a set of documents as the schema classes of
And a DTD class 13 that manages the DTD. The document class 11 has an element tree index 14 for managing the tree structure relationship of the elements of the document, and the document folder class 12 has an element-attribute index 15 for creating and managing indexes for each element and attribute of the document. And the DTD class 13 has an element name and an attribute name
An element-attribute ID table 16 for managing

【0029】データベース1に構造化文書(単に「文
章」と略記される)を格納するときは文書格納実行部2
1が起動され、検索を実行するときは検索実行部22が
起動される。
When storing a structured document (simply abbreviated as “sentence”) in the database 1, the document storage execution unit 2
1 is started, and when executing the search, the search execution unit 22 is started.

【0030】文書格納実行部21は、要素ツリーインデ
ックス作成部211と、要素−属性インデックス作成部
212と、要素−属性IDテーブル作成部213とを備
え、データベース1への文書の格納する際に、要素ツリ
ーインデックス作成部211は要素ツリーインデックス
14を、要素−属性インデックス作成部212は要素−
属性インデックス15を、要素−属性IDテーブル作成
部213は要素−属性IDテーブル16をそれぞれ作成
する。
The document storage execution unit 21 includes an element tree index creation unit 211, an element-attribute index creation unit 212, and an element-attribute ID table creation unit 213, and when storing a document in the database 1, The element tree index creation unit 211 uses the element tree index 14, and the element-attribute index creation unit 212 uses the element-
The attribute index 15 and the element-attribute ID table creating unit 213 respectively create the element-attribute ID table 16.

【0031】本発明は、文書や要素をデータベースへ格
納するためのデータ格納構造を提供し、その格納構造に
基づいた省メモリのインデックスの構造を提供し、かつ
前記インデックス構造に基づいた要素の取り出し方法を
提供している。また本発明は、データベースに複数の文
書を分類して格納し、前記分類した各文書の集合を対象
とした検索を行うシステムに利用することができる。特
に、文書の論理構造、すなわち文書中の各要素同士の関
係を制約条件とした、文書及び要素単位の検索要求を受
け付け、前記文書及び要素単位の取出しを可能としてい
る。
The present invention provides a data storage structure for storing documents and elements in a database, provides a memory-saving index structure based on the storage structure, and retrieves elements based on the index structure. Provide a way. Further, the present invention can be used in a system in which a plurality of documents are classified and stored in a database, and a search is performed on a set of the classified documents. In particular, it accepts a search request in document and element units, with the logical structure of the document, that is, the relationship between each element in the document as a constraint condition, and makes it possible to extract the document and element units.

【0032】また検索処理を高速に行うため、前記文書
の論理構造、及び文書の要素、要素の属性の情報を保持
するインデックスのデータ構造を極力小さくすることに
より、計算機のメモリ資源をあまり消費させないで検索
処理を実現させる。
In order to perform the retrieval process at high speed, the memory resource of the computer is not so much consumed by minimizing the logical structure of the document and the data structure of the index that holds the information of the document element and the attribute of the element. To realize the search process.

【0033】[文書管理・検索のためのデータベースス
キーマ]まず本発明におけるデータベースのスキーマに
ついて説明する。図2は、データベースのスキーマに関
するクラスを示す図である。図2に示した記法は、OM
T(Object Modeling Technique)に準拠する。
[Database Schema for Document Management / Search] First, the database schema in the present invention will be described. FIG. 2 is a diagram showing classes related to the schema of the database. The notation shown in FIG. 2 is OM
It conforms to T (Object Modeling Technique).

【0034】本発明において、データベースに文書を格
納することは、文書格納実行部21によって格納対象の
文書を、各クラスのインスタンスとして作成し登録する
ことである。
In the present invention, storing a document in the database means creating a document to be stored by the document storage executing unit 21 and registering it as an instance of each class.

【0035】また本発明においてデータベースから文書
を検索して取出すことは、文書検索実行部22によって
検索条件を満たす各クラスのインスタンスを特定し、そ
のインスタンスを文書としてシステム外部に取出すこと
である。
In the present invention, retrieving a document from the database means extracting an instance of each class satisfying the retrieval condition by the document retrieval executing unit 22 and retrieving the instance as a document from the system.

【0036】データベース1に、文書やDTDを格納す
るために、そのスキーマのクラスとして文書クラス11
とDTDクラス13を用意する。
In order to store documents and DTDs in the database 1, the document class 11 is a class of its schema.
And prepare DTD class 13.

【0037】データベース1に格納する各文書、各DT
Dは、それぞれ文書クラス11のインスタンス、DTD
クラス13のインスタンスとして管理する。
Each document and each DT stored in the database 1
D is an instance of document class 11, DTD
It is managed as an instance of class 13.

【0038】文書クラス11のインスタンスを、「文書
オブジェクト」と呼ぶ。同様に、図2の文書フォルダク
ラス12のインスタンスを「文書フォルダオブジェク
ト」、DTDクラス13のインスタンスを「DTDオブ
ジェクト」と呼ぶ。
An instance of the document class 11 is called a "document object". Similarly, an instance of the document folder class 12 in FIG. 2 is called a “document folder object” and an instance of the DTD class 13 is called a “DTD object”.

【0039】クラスのインスタンスには、該クラス内で
一義的に識別可能なID(識別情報)が割り振られる。
An ID (identification information) that can be uniquely identified within the class is assigned to each instance of the class.

【0040】このIDは、データベース管理システムに
よって与えられる場合もあるし、アプリケーション側で
唯一となるように設定するようにしてもよい。
This ID may be given by the database management system, or may be set uniquely on the application side.

【0041】図3は、本発明を説明するための図であ
り、文書オブジェクトと、DTDオブジェクトの関係の
一例を示す図である。
FIG. 3 is a diagram for explaining the present invention and is a diagram showing an example of the relationship between a document object and a DTD object.

【0042】図3において、(文書)A111、(文書)
B112、(文書)C113が文書クラスのインスタンスであ
り、(DTD)X131、(DTD)Y132がDTDクラス
13のインスタンスである。データベース1は、これら
個々のインスタンスを管理するとともに、どの文書が、
どのDTDに基づいて作成されたのかを表すインスタン
ス間のリンクも管理する。
In FIG. 3, (document) A111, (document)
B112 and (document) C113 are instances of the document class, and (DTD) X131 and (DTD) Y132 are instances of the DTD class 13. The database 1 manages these individual instances and
It also manages links between instances that indicate which DTD was created based on.

【0043】文書クラス11は、データベース1中の全
文書、すなわち文書オブジェクトの全集合を管理し、文
書クラス11と文書オブジェクト111、112、113は、is
−a関係を構成するが、文書オブジェクトの集合を管理
するための手段として、文書フォルダクラス12を用意
する。
The document class 11 manages all the documents in the database 1, that is, the entire set of document objects. The document class 11 and the document objects 111, 112, 113 are is
A document folder class 12 is prepared as a means for managing a set of document objects, which constitutes the -a relationship.

【0044】文書フォルダクラス12は、任意の文書オ
ブジェクトの集合を管理する。実際には、ある条件を満
たす文書オブジェクトの集合を一つの文書フォルダクラ
ス12のインスタンスで管理することになる。
The document folder class 12 manages a set of arbitrary document objects. In reality, a set of document objects satisfying a certain condition is managed by one document folder class 12 instance.

【0045】例えば、著者ごとに文書をまとめたり、年
代ごとや出版社ごとにまとめてその文書集合を管理する
ような場合である。本発明においては、文書フォルダク
ラス12と文書クラス11は、member−of関係を構成す
る。
For example, there is a case in which documents are grouped by author or grouped by age group or publisher to manage the set of documents. In the present invention, the document folder class 12 and the document class 11 form a member-of relationship.

【0046】文書フォルダクラス12のインスタンス、
すなわち文書フォルダオブジェクトは、木構造に基づく
分類階層を構築するための構造を有する。
An instance of the document folder class 12,
That is, the document folder object has a structure for constructing a classification hierarchy based on a tree structure.

【0047】すなわち、すべての文書フォルダオブジェ
クトは、親に相当する、0または1つの文書フォルダオ
ブジェクトと、子に相当する0以上の文書フォルダオブ
ジェクトとそれぞれ関係を持つことができる。
That is, all the document folder objects can have a relation with 0 or 1 document folder object corresponding to the parent and 0 or more document folder objects corresponding to the children.

【0048】図4に示したインスタンスの例では、(文
書フォルダ)α121と(文書フォルダ)β122、(文書フォル
ダ)γ123との間は、(文書フォルダ)α121が親で、(文書
フォルダ)β122と(文書フォルダ)γ123がその子となる
親子関係を持つ。
In the example of the instance shown in FIG. 4, the (document folder) α121 is the parent and the (document folder) β122 is between the (document folder) α121 and the (document folder) β122, and the (document folder) γ123. (Document folder) γ123 has a parent-child relationship as its child.

【0049】同様に、(文書フォルダ)β122と(文書フォ
ルダ)δ124、(文書フォルダ)ε125との間は、(文書フォ
ルダ)β122が親で、(文書フォルダ)δ124と(文書フォル
ダ)ε125がその子となる親子関係、(文書フォルダ)γ12
3と(文書フォルダ)ζ126との間は、(文書フォルダ)γ12
3が親で、(文書フォルダ)ζ126がその子となる親子関係
を持つ。
Similarly, between (document folder) β122 and (document folder) δ124, (document folder) ε125, (document folder) β122 is a parent, and (document folder) δ124 and (document folder) ε125 are its children. Parent-child relationship, (document folder) γ12
Between (Document folder) ζ 126 and (Document folder) γ 12
3 is a parent, and (document folder) ζ 126 has a parent-child relationship in which it is a child.

【0050】応用例として、 ・著者ごとにまとめた文書の文書フォルダオブジェクト
を親とし、 ・その子として男女別著者の文書フォルダオブジェクト
を作成して文書を分類する、という構成、あるいは、年
代別に文書を分類する場合に、 ・例えば1990年代でまとめた文書フォルダオブジェクト
を親とし、 ・1990年代の1年ごとの文書フォルダオブジェクトを子
として分類する、 等の構成が挙げられる。
As an application example, the document folder objects of the documents collected for each author are used as parents, and the document folder objects of the authors for men and women are created as their children to classify the documents, or the documents are classified according to ages. When classifying, for example, the document folder objects collected in the 1990s are used as parents, and the document folder objects for each year in the 1990s are used as children, and so on.

【0051】実際に親子の関係を持たせる方法に厳密な
規則はないが、一般には、子の文書フォルダオブジェク
トによって親の文書フォルダオブジェクトが構成される
というpart−of関係を構成する。
Although there is no strict rule on the method of actually providing a parent-child relationship, in general, a child-document folder object constitutes a parent document folder object, forming a part-of relationship.

【0052】[要素−属性IDテーブル]構造化文書に
おける論理構造に関する検索条件を指定して特定の文書
や要素を取出すときには、文書に含まれる要素名、属性
名などの文字列データを具体的に検索条件に指定する必
要がある。
[Element-attribute ID table] When a search condition for a logical structure in a structured document is specified and a specific document or element is extracted, character string data such as an element name and an attribute name included in the document are concretely specified. Must be specified in search conditions.

【0053】これら文字列データを含む検索条件に一致
する文書や要素を取出すためには、データベース中の文
書オブジェクトの文字列データを、計算機のメモリ上に
ロードし、前記検索条件の要素名、属性名との判定を行
う必要がある。しかしながら、要素名や属性名などの文
字列データは、文書オブジェクトが持つ文書全体の文字
列データに比べればはるかにサイズ(長さ)が小さいこ
とが一般的であり、文書オブジェクト全体をそのまま計
算機のメモリ上にロードするのは効率的でない。このた
め、要素名や属性名など、検索条件を満たすかどうかの
判定に必要な情報のみを有するインデックスをあらかじ
め作成しておいて、検索時には、インデックスのみを計
算機のメモリ上にロードして計算する方法が用いられ
る。
In order to retrieve the document or element that matches the search condition including these character string data, the character string data of the document object in the database is loaded on the memory of the computer, and the element name and attribute of the search condition are loaded. It is necessary to judge the name. However, the character string data such as the element name and the attribute name is generally much smaller in size (length) than the character string data of the entire document held by the document object. Loading on memory is not efficient. For this reason, an index that has only the information necessary for determining whether or not the search condition is satisfied, such as the element name and attribute name, is created in advance, and at the time of search, only the index is loaded into the memory of the computer for calculation. A method is used.

【0054】ところで、インデックスで、要素名や属性
名を文字列データとして扱う場合、計算機のメモリに
は、その文字列長分のデータ領域を必要とする。具体的
には、1文字1バイト(かな漢字は1文字2バイト)で
ある計算機が多い。このため、データベース中の要素名
や属性名が長大であった場合には、ロードに必要なメモ
リ上のデータをそれだけ必要とすることになり、計算性
能上不利となる。
By the way, when the element name and the attribute name are treated as character string data in the index, the memory of the computer requires a data area corresponding to the character string length. Specifically, many computers have one character for one byte (one character for Kana and Kanji for two bytes). For this reason, if the element name or attribute name in the database is long, that much data on memory required for loading is needed, which is disadvantageous in terms of calculation performance.

【0055】そこで、本発明においては、インデックス
における要素名や属性名などの文字列に関するメモリの
消費を節約するために、DTDクラス13と一対一の関
係をもつ要素−属性IDテーブル16を備えている。
Therefore, in the present invention, the element-attribute ID table 16 having a one-to-one relationship with the DTD class 13 is provided in order to save the memory consumption of character strings such as element names and attribute names in the index. There is.

【0056】構造化文書中で扱われる要素名や属性名
は、構造化文書が従うDTDによってその種類と数が限
定される。単一のDTDの範囲において、要素名は一意
に定められ、また属性名は、DTDの範囲の前記要素の
範囲において、一意に定められる。
The type and number of element names and attribute names handled in the structured document are limited by the DTD that the structured document follows. Within the scope of a single DTD, element names are uniquely defined, and attribute names are uniquely defined within the range of the elements of the DTD.

【0057】このDTD内で定義される各要素名に対し
て唯一となるような要素名IDを数値として与え、その
要素名と要素名IDとの対応関係のテーブルを作成し、
このテーブルを、DTDのオブジェクトと一対一の関係
で要素−属性IDテーブル16のインスタンスとしてデ
ータベースに格納する。
An element name ID that is unique to each element name defined in this DTD is given as a numerical value, and a table of the correspondence relationship between the element name and the element name ID is created.
This table is stored in the database as an instance of the element-attribute ID table 16 in a one-to-one relationship with the DTD object.

【0058】属性名に関しても、DTDオブジェクト内
の要素に対して唯一であり、かつ異なる要素名の間で同
じ属性名が存在する場合でも、これらを識別できるよう
な属性名IDを数値で与える。すなわち属性名IDは、
その値からどの要素の属性名であるかを判別できるよう
な数値が割り当てられる。
With respect to the attribute name as well, even if the element name is unique to the element in the DTD object and the same attribute name exists among different element names, an attribute name ID that can identify them is given by a numerical value. That is, the attribute name ID is
A numerical value is assigned so that the attribute name of the element can be determined from the value.

【0059】そして属性名と属性名IDとの対応関係を
テーブルとして作成し、そのテーブルを、先ほど作成し
た要素−属性IDテーブル16のインスタンスとして、
データベースに格納する。
Then, the correspondence between the attribute name and the attribute name ID is created as a table, and the table is used as an instance of the element-attribute ID table 16 created earlier.
Store in database.

【0060】図8は、本発明の一実施の形態における、
要素−属性IDテーブル16におけるインスタンスの一
例を示す図である。要素名IDと属性名IDの数値の割
り当ては、前述のDTD内および要素内での一意性が保
証されれば任意の値でよい。DTDに対する要素名ID
と属性名IDの与え方の一例を示す。
FIG. 8 shows an embodiment of the present invention.
It is a figure which shows an example of the instance in the element-attribute ID table 16. Numerical values may be assigned to the element name ID and the attribute name ID as long as the uniqueness in the DTD and the element is guaranteed. Element name ID for DTD
An example of how to give the attribute name ID will be described.

【0061】図5は、本発明の一実施の形態において、
要素名IDを与える処理手順を示すフローチャートであ
る。ただし、ここで扱うDTDは、妥当性が保証され、
かつDTDの内部サブセット、外部サブセット、外部実
体などの使用によって、前記DTDの記述が複数の文書
に分割されている場合には、構造化文書のDTDのパー
サ(構文解析器)によって一つの文書中にすべてがマー
ジされ、一つの文書中にDTDの情報がすべて記述され
ているものとする。またDTDのパーサによってパラメ
ータ実体も展開済みであるものとする。そして、図5に
示す処理手順は、このようなDTDについてその記述を
先頭から最後までを連続的に読み込むこととする。
FIG. 5 shows an embodiment of the present invention.
It is a flow chart which shows a processing procedure which gives element name ID. However, the validity of the DTD handled here is guaranteed,
When the DTD description is divided into a plurality of documents by using the DTD internal subset, external subset, external entity, etc., the DTD parser (parser) of the structured document Are merged, and all the DTD information is described in one document. It is also assumed that the parameter entity has already been expanded by the DTD parser. Then, in the processing procedure shown in FIG. 5, the description of such a DTD is continuously read from the beginning to the end.

【0062】図5を参照すると、ステップS101で変数
iの初期化し、ステップS102、S107間のループ処理を
行う。このループ内の処理では、まず、ステップS103
でDTD内の要素型宣言(element type declaratio
n)を探し、要素型宣言が見つかった場合、ステップS1
05で、該要素宣言の要素名の要素IDを上位桁の値をi
とし、下位の桁の値を0とした数値とし、つづいてステ
ップS106で変数iを一つインクリメントする。ステップ
S104の判定において、要素型宣言が見つらない場合、
処理を終了する。なお、要素型宣言は、文書要素の名
前、要素の階層構造(親子、兄弟関係等)を規定するも
のである。
Referring to FIG. 5, the variable i is initialized in step S101, and a loop process between steps S102 and S107 is performed. In the processing in this loop, first, step S103.
With element type declaration in DTD (element type declaratio
n), and if an element type declaration is found, step S1
In 05, the element ID of the element name of the element declaration is set to the value of the upper digit i
Then, the value of the lower digit is set to 0, and the variable i is incremented by 1 in step S106. If the element type declaration is not found in the determination in step S104,
The process ends. The element type declaration defines the name of the document element and the hierarchical structure (parent-child, sibling relationship, etc.) of the element.

【0063】図5において、ステップS105における要
素名IDの上位桁の値とは、数字の桁において予め定め
た桁の間を境として左側の桁の値ことをいい、下位桁の
値とはその右側の桁の値ことをいう。例えば数値「1234
5678」で境目の桁の間を4、5桁目とすると、上位桁の値
は「1234」、下位桁の値は「5678」となる。
In FIG. 5, the value of the upper digit of the element name ID in step S105 means the value of the digit on the left side between the predetermined digits of the numeral digit, and the value of the lower digit thereof. The value of the right digit. For example, the value "1234
If the digits between the boundaries of "5678" are defined as the 4th and 5th digits, the value of the higher digit is "1234" and the value of the lower digit is "5678".

【0064】図6は、属性名IDを与える処理手順を示
すフローチャートである。
FIG. 6 is a flowchart showing a processing procedure for giving an attribute name ID.

【0065】ステップS111とステップS122間のループ
処理は、DTD内で属性リスト宣言(attribute-list
declaration)を探して処理するものであり、属性リス
ト宣言内の要素名に相当する要素名IDを求め、属性リ
スト宣言が見つかった場合、変数iを初期化して、ルー
プ処理に入り、属性リスト宣言内で属性名を探し属性名
が見つかった場合、その属性名の属性IDを上位桁の値
を要素名ID、下位桁の値をiとした値とする。なお、
DTD内の属性リスト宣言は、要素の付加情報として属
性を定義するものであり、どの要素にどの属性が付く
か、属性名、属性として指定可能な値、デフォルト値等
を規定するものである。
The loop processing between step S111 and step S122 is performed by the attribute list declaration (attribute-list) in the DTD.
declaration) is processed, the element name ID corresponding to the element name in the attribute list declaration is obtained, and when the attribute list declaration is found, the variable i is initialized and the loop process is started to execute the attribute list declaration. If an attribute name is found by searching for the attribute name in the item, the attribute ID of the attribute name is set as the element name ID for the upper digit value and the lower digit value for i. In addition,
The attribute list declaration in the DTD defines an attribute as additional information of an element, and defines which attribute is attached to which element, an attribute name, a value that can be designated as an attribute, a default value, and the like.

【0066】当該DTDのすべての要素名の要素名ID
が割り振られた後、前記DTDの記述の先頭から最後ま
でを連続的に読み込むこととする。
Element name IDs of all element names of the DTD
After is allocated, the description from the beginning to the end of the DTD description is continuously read.

【0067】図6のステップS119における属性名ID
の上位桁と下位桁の意味は、図5のステップS105にお
ける要素名IDの場合と同じである。ただし条件とし
て、要素名IDと属性名IDの上位桁と下位桁の境目の
位置は同じとする。要素名IDと属性名IDの数値の桁
数をどこまで用意するか、また上位桁と下位桁をどこで
分けるかなどは、文書のDTDの中で前述の一意性を保
証すべき要素名や属性名がどれほどの数になるか予測を
立てて決定することになる。
Attribute name ID in step S119 of FIG.
The meaning of the upper digit and the lower digit of is the same as that of the element name ID in step S105 of FIG. However, as a condition, the position of the boundary between the upper digit and the lower digit of the element name ID and the attribute name ID is the same. The number of digits of the numerical value of the element name ID and the attribute name ID to be prepared, and where to divide the high-order digit and the low-order digit, etc., are the element names and attribute names for which the above-mentioned uniqueness should be guaranteed in the DTD of the document. It will be decided by predicting how many will be.

【0068】仮に要素名IDと属性名IDがそれぞれ4
バイトとし、その上位桁と下位桁をそれぞれ2バイトず
つとすると、文書のDTDの中で前述の一意性の保証が
可能な要素名の数は65535個(216−1)となり、同じく文
書のDTDの中の各要素の中で前述の一意性の保証が可
能な属性名の数も65535個となる。4バイトというデー
タ量は、文字列に換算すると4文字分にしか相当しな
い。実際、文字列は最後がヌル文字で終わることを考え
ると、実質3文字分である。DTD内の要素名や属性名
が3文字を超えて定義されている場合、要素名や属性名
を表すデータ領域を節約することができる。
It is assumed that the element name ID and the attribute name ID are 4 respectively.
If the upper digit and the lower digit are 2 bytes each, the number of element names in the DTD of the document that can guarantee the uniqueness is 65535 (2 16 −1), which is also the same as the document. The number of attribute names that can guarantee the uniqueness is 65535 among the elements in the DTD. The data amount of 4 bytes corresponds to only 4 characters when converted into a character string. In fact, considering that the character string ends with a null character, the character string is actually three characters. When the element name or attribute name in the DTD is defined with more than three characters, the data area representing the element name or attribute name can be saved.

【0069】次に、本発明の一実施の形態における要素
−属性IDテーブル16の構造について説明する。
Next, the structure of the element-attribute ID table 16 in the embodiment of the present invention will be described.

【0070】前述の通り、要素−属性IDテーブルに
は、要素名と要素名ID、属性名と属性名IDのそれぞ
れの対応関係のテーブルを含む。よって、要素−属性I
Dテーブルの構造として、少なくとも、(要素名ID、
要素名)、(属性名ID、属性名)の二つの項目を有する
データ構造を用意する。
As described above, the element-attribute ID table includes a table of correspondence relationships between element names and element name IDs, and attribute names and attribute name IDs. Therefore, element-attribute I
As the structure of the D table, at least (element name ID,
A data structure having two items of (element name) and (attribute name ID, attribute name) is prepared.

【0071】要素−属性IDテーブル16におけるデー
タエントリの順序は、それぞれ要素名、属性名の辞書的
な順序でソートしてリストとしておく。これは、各デー
タエントリの要素名、属性名の辞書的な順序を比較する
二分探索によって、それぞれ対応する要素名ID、属性
名IDをより早く調べられるようにするためである。
The order of data entry in the element-attribute ID table 16 is sorted in a lexicographical order of element names and attribute names, respectively, to make a list. This is to enable the corresponding element name ID and attribute name ID to be checked earlier by a binary search that compares the dictionary order of the element name and attribute name of each data entry.

【0072】要素−属性IDテーブル作成部213は、上
記したデータ構造の要素−属性IDテーブルを作成し、
DTDオブジェクトと一対一の関係を保持したままデー
タベース1に格納する。
The element-attribute ID table creating section 213 creates the element-attribute ID table having the above-mentioned data structure,
The data is stored in the database 1 while maintaining a one-to-one relationship with the DTD object.

【0073】図7、及び図8は、以上の手順に従って要
素名ID、属性名IDを割り振った例を示す図である。
図7にはDTDの一例が示されている。図7において、
「!ELEMENT 要素名 内容モデル」が要素型宣言であ
あり、「!ATTLIST 要素名、属性値候補、デフォルト
値」は属性リスト宣言である。またCDATAは文字デ
ータのことをいう。要素型宣言の#PCDATAは混在
内容(mixed type)を指定するものである。
FIGS. 7 and 8 are diagrams showing an example in which the element name ID and the attribute name ID are assigned according to the above procedure.
FIG. 7 shows an example of DTD. In FIG.
"! ELEMENT element name content model" is the element type declaration, and "! ATTLIST element name, attribute value candidate, default value" is the attribute list declaration. Also, CDATA means character data. #PCDATA in the element type declaration specifies mixed content.

【0074】図8は、図7に示すDTDの中の要素名や
属性名に対応して要素名ID、属性名IDを割り振った
例を示している。要素名ID、属性名IDはヘキサデシ
マル表示で示してある。この例では、要素名IDと属性
名IDの値は16進数で4バイト、上位桁下位桁共に2バ
イトずつとしている。
FIG. 8 shows an example in which element name IDs and attribute name IDs are assigned corresponding to the element names and attribute names in the DTD shown in FIG. The element name ID and the attribute name ID are shown in hexadecimal display. In this example, the value of the element name ID and the value of the attribute name ID are 4 bytes in hexadecimal, and the upper digit and the lower digit are 2 bytes each.

【0075】[要素ツリーインデックス]要素ツリーイ
ンデックス14は、要素−属性IDテーブル16の要素
名IDを用いて、各文書における構造、すなわち要素の
木構造を表現するデータ構造である。要素ツリーインデ
ックス14は各文書オブジェクトごとに作成して保持さ
せる。
[Element Tree Index] The element tree index 14 is a data structure that expresses the structure in each document, that is, the tree structure of the element, using the element name ID of the element-attribute ID table 16. The element tree index 14 is created and held for each document object.

【0076】要素ツリーインデックス14は、(要素名
ID、要素レベル、要素開始位置)の三つ組のデータ構
造を持つデータエントリのリストである。
The element tree index 14 is a list of data entries having a triple data structure of (element name ID, element level, element start position).

【0077】この三つ組データは、文書中の要素と対応
し、データの各項目には、それぞれ要素の要素名に対応
する要素名ID、要素を木構造としたときのルート要素
からの深さ、文書中の要素の記述(開始タグを含む)の
開始バイト位置の値がそれぞれ格納される。
This triple data corresponds to the element in the document, and each item of the data has an element name ID corresponding to the element name of the element, a depth from the root element when the element has a tree structure, The value of the start byte position of the description (including the start tag) of the element in the document is stored.

【0078】そして、要素ツリーインデックス14にお
けるこれらのエントリの順番は、文書中の要素の開始タ
グの出現順番と等しくなるようにする。この開始タグの
出現順番は換言すれば、要素の木構造を構成したときの
左深さ優先順序となる。
Then, the order of these entries in the element tree index 14 is made equal to the order of appearance of the start tags of the elements in the document. In other words, the appearance order of the start tags is the left depth priority order when the tree structure of the element is formed.

【0079】要素ツリーインデックスの作成手順を示
す。要素ツリーインデックス14の作成は、要素ツリー
インデックス作成部211で行う。
A procedure for creating an element tree index will be described. The element tree index 14 is created by the element tree index creating unit 211.

【0080】図9は、要素ツリーインデックスの作成手
順を示すフローチャートである。要素ツリーインデック
スの三つ組のデータ構造(要素名ID、要素レベル、要
素開始位置)の各項目の値を求め、これをエントリとし
て、要素ツリーインデックス14のリストに追加する。
ただし、ここで扱う文書は、DTDに対する妥当性が保
証され、前記DTD自身の妥当性も保証されていること
を前提とする。また文書中のタグの省略、属性値の省略
等は、構造化文書のパーサによってすべて補完されてい
ることを前提とする。図9に示した要素ツリーインデッ
クスの作成手順は、このような文書の記述を先頭から最
後までを連続的に読み込むものとする。
FIG. 9 is a flowchart showing the procedure for creating the element tree index. The value of each item of the data structure (element name ID, element level, element start position) of the triple of the element tree index is obtained, and this is added to the list of the element tree index 14 as an entry.
However, it is premised that the document handled here is guaranteed to be valid for DTD, and the validity of the DTD itself is also guaranteed. It is also assumed that the omission of tags and omission of attribute values in a document are all complemented by the structured document parser. In the procedure for creating the element tree index shown in FIG. 9, the description of such a document is continuously read from the beginning to the end.

【0081】ステップS131では、変数iを0に初期化
し、ステップS132のループa開始端とステップS143の
終了端間のループ処理を行う。
In step S131, the variable i is initialized to 0, and the loop processing between the loop a start end in step S132 and the end end in step S143 is performed.

【0082】ステップS133では、要素の開始タグか終
了タグのどちらかを探す。
In step S133, either the start tag or the end tag of the element is searched.

【0083】タグが見つかりそれが開始タグの場合(ス
テップS134、S135)、開始タグの最初の文字位置を求
め(ステップS136)、開始タグの要素名を求め(ステ
ップS137)、当該文書オブジェクトと関係するDTD
オブジェクトから要素−属性IDテーブルを取り出し、
要素名に対応する要素IDを求め(ステップS138)、
要素レベルの値を変数iの値とし、要素名ID、要素レ
ベル、要素開始位置の三つ組データを、要素ツリーイン
デックスのエントリに追加し(ステップS140)、つづ
いて変数iを1つインクリメントし(ステップS14
1)。
When the tag is found and it is the start tag (steps S134 and S135), the first character position of the start tag is obtained (step S136), the element name of the start tag is obtained (step S137), and the relation with the document object is obtained. Do DTD
Retrieve the element-attribute ID table from the object,
Obtain the element ID corresponding to the element name (step S138),
The element level value is used as the value of the variable i, and the triplet data of the element name ID, the element level, and the element start position is added to the entry of the element tree index (step S140), and then the variable i is incremented by 1 (step S140). S14
1).

【0084】一方、ステップS135で、終了タグの場
合、変数を1つデクリメントする(ステップS142)。
On the other hand, in step S135, if the tag is the end tag, one variable is decremented (step S142).

【0085】またステップS134でタグが見つらない場
合、ループを飛び出して終了する。
If the tag is not found in step S134, the loop is exited and the process ends.

【0086】要素ツリーインデックスの例を示す。図7
のDTDに従う文書として、図10に示すような文書が
あるものとする。文書の左側の数字は、文書の行番号を
表すのではなく、それぞれ数字の右側に現れる要素の開
始タグや文字列の最初の文字位置、また終了タグの最後
の文字位置をそれぞれ表すものとする。
An example of the element tree index is shown. Figure 7
It is assumed that there is a document as shown in FIG. 10 as a document complying with the DTD. The numbers on the left side of the document do not indicate the line numbers of the document, but the start tag of the element appearing on the right side of the number, the first character position of the string, and the last character position of the end tag. .

【0087】図10に示した文書中のタグ付けによって
識別される要素の関係を木構造で表すと、図11に示す
ようなものとなる。
The relationship between the elements identified by the tagging in the document shown in FIG. 10 is represented by a tree structure as shown in FIG.

【0088】図11の木構造において、ノード上のラベ
ルは要素名を表し、ノードの添字はそのノードのラベル
に対応した要素の開始位置を表している。
In the tree structure of FIG. 11, the label on the node represents the element name, and the subscript of the node represents the start position of the element corresponding to the label of the node.

【0089】図10の文書の要素の開始タグの出現順番
は、図11の木構造の左深さ優先順序となっている。
The appearance order of the start tags of the elements of the document of FIG. 10 is the left depth priority order of the tree structure of FIG.

【0090】この要素の順番に従い、(要素名ID、要
素レベル、要素開始位置)の三つ組データのリストが作
成される。その結果は、図12に示す通りである。
According to the order of the elements, a list of triplet data (element name ID, element level, element start position) is created. The result is as shown in FIG.

【0091】[文書の論理構造に基づく検索]文書の論
理構造に基づく検索には、文書の要素名、属性名、属性
値、要素の中身の文書に関する条件と、要素間の関係に
関する条件を満たすかどうかの判定を含む。
[Search Based on Logical Structure of Document] In order to search based on the logical structure of a document, the conditions regarding the element name, the attribute name, the attribute value of the document, the contents of the document, and the relation between the elements are satisfied. Including whether to determine.

【0092】例えば図10に示す文書に対して、文書の
要素名、属性名、属性値、要素の中身の文書に関する検
索条件「要素名がDであり、その要素の属性a2の値が2
で、その要素の中身に文字列"string1"を含むような要
素を持つ文書」の条件判定は、TRUEとなる。
For example, for the document shown in FIG. 10, the document element name, the attribute name, the attribute value, and the search condition "the element name is D and the attribute a2 value of the element is 2" for the document of the content of the element.
Then, the condition judgment of "a document having an element that contains the character string" string1 "" in the content of the element is TRUE.

【0093】さらに、前記検索条件に要素間の関係に関
する条件「そのような要素Dを子要素に持つ要素の属性a
1の値が1である要素を持つ文書」を加えることも、文
書の論理構造に基づく検索の範囲に入る。この検索要求
を加えた図10の文書の条件判定はTRUEとなる。
Further, in the search condition, the condition “relationship between elements” “attribute a of an element having such an element D as a child element
Adding "a document having an element whose value of 1 is 1" is also within the scope of the search based on the logical structure of the document. The condition determination of the document in FIG. 10 to which this search request is added is TRUE.

【0094】以上の例からも分かるように、要素間の関
係に関する条件を満たすかどうかの判定処理には、ある
要素からの相対的な関係にある要素の取出し、例えばあ
る要素の親要素、祖先要素、子要素、子孫要素、兄要
素、弟要素、前要素、次要素の取出しなどが必要とな
る。
As can be seen from the above example, the process of determining whether or not the condition regarding the relationship between elements is satisfied is the extraction of an element that is in a relative relationship from a certain element, such as the parent element or ancestor of an element. It is necessary to take out elements, child elements, descendant elements, elder brother elements, younger brother elements, previous elements, and next elements.

【0095】これらの相対的な関係の説明については、
文献(XML Pointer Language(XPointer)の相対ロケー
ション項のancestor、child、descendant、psibling、f
sibling、preceding、following)等の記載が参照され
る。
For an explanation of these relative relationships, see
References (ancestor, child, descendant, psibling, f of relative location terms in XML Pointer Language (XPointer)
Descriptions such as sibling, preceding, following) are referred to.

【0096】このような相対関係に関する要素の特定
は、要素ツリーインデックスの任意のエントリを起点と
して計算することができる。
The identification of elements relating to such a relative relationship can be calculated starting from an arbitrary entry of the element tree index.

【0097】前記要素ツリーインデックスを用いて、あ
る要素からの親要素、祖先要素、子要素、子孫要素、兄
要素、弟要素、前要素、次要素を取出す手順を、それぞ
れ図13乃至図18、図21、図22にフローチャート
として示す。
13 to 18, steps for extracting a parent element, an ancestor element, a child element, a descendant element, a brother element, a brother element, a previous element, and a next element from a certain element using the element tree index, respectively. 21 and 22 are shown as a flow chart.

【0098】[親要素の取出し]図13のフロチャート
を参照して、親要素の取出しの処理手順について説明す
る。
[Retrieval of Parent Element] Referring to the flowchart of FIG. 13, the procedure for retrieving the parent element will be described.

【0099】図13を参照すると、ステップS161で
は、変数の初期化を行う。変数parentとelemは、要素ツ
リーインデックスの三つ組のエントリ、要素名ID、要
素レベル、要素開始位置の値を格納するための変数であ
る。
Referring to FIG. 13, in step S161, variables are initialized. The variables parent and elem are variables for storing the values of the triplet entry of the element tree index, the element name ID, the element level, and the element start position.

【0100】それぞれの変数の用途は、parentは、親要
素のエントリを格納するためのものであり、変数elem
は、計算の過程における要素ツリーインデックスの現在
エントリを格納するためのものである。
The purpose of each variable is that parent is used to store the entry of the parent element, and the variable elem
Is for storing the current entry of the element tree index in the process of calculation.

【0101】変数baseは、相対関係の起点となる要素
(起点要素)のエントリの要素レベルの値を格納する。
The variable base is the element that is the starting point of the relative relationship.
Stores the element-level value of the entry (starting element).

【0102】ステップS162の一つ前の要素があるかの
判定は、要素ツリーインデックスにおけるエントリのリ
ストにおいて、起点となるエントリより一つ前のエント
リが存在するかということである。
The determination as to whether or not there is the previous element in step S162 is whether or not there is an entry before the entry serving as the starting point in the list of entries in the element tree index.

【0103】図12に示した要素ツリーインデックス1
4の例に即して説明する。例えば起点となるエントリが
3番目のエントリ(00030000、2、30)であるとすると、
「一つ前の要素」とは、当該エントリよりも一つ前の、
2番目のエントリ(00020000、1、20)となる。
Element tree index 1 shown in FIG.
A description will be given according to the example of No. 4. For example, the entry that is the starting point
Given the third entry (00030000, 2, 30),
"The element one before" means the one before the entry,
This is the second entry (00020000, 1, 20).

【0104】よって、この例の場合、「一つ前の要素が
ある」と判定され、ステップ63へ進む。
Therefore, in the case of this example, it is determined that “the previous element exists”, and the process proceeds to step 63.

【0105】ステップS163では、ステップS162におけ
る「一つ前の要素」に相当するエントリを変数elemに代
入する。
In step S163, the entry corresponding to the "previous element" in step S162 is assigned to the variable elem.

【0106】ステップS164では、ステップS163のelem
の要素レベルが、ステップ61の初期化で設定したbaseの
値より1少ない値であるか否かを判定する。
In step S164, the elem of step S163.
It is determined whether the element level of is less than the value of base set in the initialization of step 61 by one.

【0107】ステップS164の判定の結果YESであれば、
現在のelemが求める親要素のエントリとなり、ステップ
S165でparentにelemの値を代入して処理を終了する。
If the result of the determination in step S164 is YES,
The current elem becomes the entry of the parent element to be obtained, and the value of elem is assigned to parent in step S165, and the process ends.

【0108】ステップS164の判定結果がNOであれば、
ステップS162に戻り、該elemに対する一つ前の要素が
あるか否かを判定して、以降は、前述と同様の処理を繰
り返す。
If the decision result in the step S164 is NO,
Returning to step S162, it is determined whether there is an element immediately preceding the elem, and thereafter, the same processing as described above is repeated.

【0109】[祖先要素の取出し]次に図14のフロー
チャートを参照して、祖先要素の取出しの処理手順につ
いて説明する。
[Retrieval of Ancestor Element] Next, the processing procedure for retrieval of an ancestor element will be described with reference to the flowchart of FIG.

【0110】ステップS171では、必要な変数の初期化
を行う。変数ancestorとelemは、要素ツリーインデック
スのエントリの値を格納するための変数である。それぞ
れの変数の用途は、ancestorは、フローチャートで求め
る、祖先要素のエントリを格納するためのものであり、
変数elemは、計算の過程における要素ツリーインデック
スの現在エントリを格納するためのものである。
In step S171, necessary variables are initialized. The variables ancestor and elem are variables for storing the value of the entry of the element tree index. The purpose of each variable is to store the entry of the ancestor element that ancestor asks for in the flowchart,
The variable elem is for storing the current entry of the element tree index in the process of calculation.

【0111】変数baseは、起点要素のエントリの要素レ
ベルの値を格納する。変数nは、n番目の祖先要素を取出
すために指定された値である。変数iは、繰り返し処理
に関するカウンタとして用いる。
The variable base stores the element level value of the entry of the starting element. The variable n is the value specified to retrieve the nth ancestor element. The variable i is used as a counter for the iterative process.

【0112】ステップS172からステップS174までは、
図13のステップS162からステップS164までと同様で
ある。
From step S172 to step S174,
This is the same as steps S162 to S164 of FIG.

【0113】ステップS174の判定結果がYESであれば、
現在のelemがi番目の祖先要素のエントリとなる。
If the decision result in the step S174 is YES,
The current elem becomes the entry for the i th ancestor element.

【0114】そしてステップS175で、そのi番目の祖先
要素elemが求めるn番目の祖先要素か否かを判定し、YES
であればステップS177でancestorにelemの値を代入し
て処理を終了する。
Then, in step S175, it is determined whether or not the i-th ancestor element elem is the n-th ancestor element to be obtained, and YES.
If so, the value of elem is assigned to ancestor in step S177, and the process ends.

【0115】一方、ステップS175の判定結果がNOであ
れば、該elemに対する親要素を求めるべく、ステップS
176でbeseの値を新たに当該elemの要素レベルに設定し
直し、かつiの値を一つ繰り上げて、ステップS172に戻
ってもう一度処理を繰り返す。
On the other hand, if the decision result in the step S175 is NO, a step S is carried out to find a parent element for the elem.
At 176, the value of bese is newly set to the element level of the elem, and the value of i is incremented by one, and the process returns to step S172 and is repeated.

【0116】[子要素の取出し]次に図15のフローチ
ャートを参照して、子要素の取出しの処理手順について
説明する。
[Retrieval of Child Element] Next, with reference to the flow chart of FIG. 15, the procedure for extracting a child element will be described.

【0117】ステップS181では、必要な変数の初期化
を行う。変数childとelemは、要素ツリーインデックス
のエントリの値を格納するための変数である。それぞれ
の変数の用途は、childは本フローチャートで求める子
要素のエントリを格納するためのものであり、変数elem
は計算の過程における要素ツリーインデックスの現在エ
ントリを格納するためのものである。
In step S181, necessary variables are initialized. The variables child and elem are variables for storing the value of the entry of the element tree index. The purpose of each variable is to store the entry of the child element that child wants in this flowchart.
Is for storing the current entry of the element tree index in the process of calculation.

【0118】変数baseは、起点要素のエントリの要素レ
ベルの値を格納する。変数nは、n番目の子要素を取出す
ために指定された値である。
The variable base stores the element level value of the entry of the starting element. The variable n is the value specified to retrieve the nth child element.

【0119】変数iは繰り返し処理に関するカウンタと
して用いる。
The variable i is used as a counter for the repetitive processing.

【0120】ステップS182の「一つ後の要素がある
か」とは、要素ツリーインデックスにおけるエントリの
リストにおいて、起点となるエントリより一つ後のエン
トリが存在するかということである。
The “whether there is an element after one” in step S182 means whether or not there is an entry after the entry serving as the starting point in the list of entries in the element tree index.

【0121】図12に示した要素ツリーインデックスの
例で説明すると、例えば起点となるエントリが3番目の
エントリ(00030000、2、30)であるとすると、一つ後の
要素とは、そのエントリより一つ後の、4番目のエント
リ(00040000、3、40)となる。よって、この例の場合
は、一つ後の要素がある」と判定され、ステップ83へと
進む。
Explaining with the example of the element tree index shown in FIG. 12, if the entry serving as the starting point is the third entry (00030000, 2, 30), the element after the one is This is the fourth entry (00040000, 3, 40) after the one. Therefore, in the case of this example, it is determined that there is an element after one, ”and the process proceeds to step 83.

【0122】ステップS183では、ステップS182におけ
る一つ後の要素に相当するエントリを変数elemに代入す
る。
At step S183, the entry corresponding to the element immediately after that at step S182 is assigned to the variable elem.

【0123】ステップS184では、ステップS183のelem
の要素レベルが、ステップS181の初期化で設定したbas
eの値よりも大きい値であるか否かを判定する。
In step S184, the elem of step S183
Element level of bas set in the initialization of step S181
It is determined whether the value is larger than the value of e.

【0124】ステップS184の判定の結果YESであれば、
ステップS185へ進む。
If the result of the determination in step S184 is YES,
It proceeds to step S185.

【0125】ステップS184の判定の結果がNOであれ
ば、処理を終了する。ステップS185では、さらにelem
の要素レベルが、baseの値よりも1多い値であるか否か
を判定する。
If the result of the determination in step S184 is NO, the process ends. In step S185, further elem
It is determined whether the element level of is a value one more than the value of base.

【0126】ステップS185の判定結果がYESであれば、
現在のelemがi番目の子要素のエントリとなる。そして
ステップS186で、そのi番目の子要素elemが求めるn番
目の子要素か否かを判定し、YESであればステップS188
でchildにelemの値を代入して処理を終了する。
If the decision result in the step S185 is YES,
The current elem becomes the i-th child element entry. Then, in step S186, it is determined whether or not the i-th child element elem is the n-th child element to be obtained, and if YES, step S188
Substitute the value of elem for child and finish the process.

【0127】ステップS186の判定結果がNOであれば、
次の子要素を求めるべく、ステップS187でiの値を一つ
繰り上げて、ステップS182に戻ってもう一度処理を繰
り返す。
If the decision result in the step S186 is NO,
In order to obtain the next child element, the value of i is incremented by 1 in step S187, the process returns to step S182 and the process is repeated again.

【0128】[子孫要素の取出し]図16のフローチャ
ートを参照して、子孫要素の取出しの処理手順について
説明する。
[Retrieval of Descendant Element] The processing procedure for retrieval of a descendant element will be described with reference to the flowchart of FIG.

【0129】ステップS191では、必要な変数の初期化
を行う。変数descendantとelemは、要素ツリーインデッ
クスのエントリの値を格納するための変数である。それ
ぞれの変数の用途は、descendantは、この処理で求める
子孫要素のエントリを格納するためのものであり、変数
elemは計算の過程における要素ツリーインデックスの現
在エントリを格納するためのものである。
In step S191, necessary variables are initialized. The variables descendant and elem are variables for storing the value of the entry of the element tree index. The purpose of each variable is that the descendant is for storing the entry of the descendant element to be obtained in this process.
elem is for storing the current entry of the element tree index in the process of calculation.

【0130】変数baseは、起点要素のエントリの要素レ
ベルの値を格納する。
The variable base stores the element level value of the entry of the starting element.

【0131】変数nは、n番目の子孫要素を取出すために
指定された値である。
The variable n is a value designated to fetch the n-th descendant element.

【0132】変数iは、繰り返し処理に関するカウンタ
として用いる。
The variable i is used as a counter for the repetitive processing.

【0133】ステップS192からステップS194までは、
図15のステップS182からステップS184までと同様で
ある。
From step S192 to step S194,
This is the same as steps S182 to S184 in FIG.

【0134】ステップS194の判定結果がYESであれば、
現在のelemがi番目の子孫要素のエントリとなる。
If the decision result in the step S194 is YES,
The current elem is the entry for the i th descendant element.

【0135】そしてステップS195で、そのi番目の子孫
要素elemが求めるn番目の子孫要素か否かを判定し、YES
であれば、ステップ97でdescendantにelemの値を代入し
て処理を終了する。
Then, in step S195, it is determined whether or not the i-th descendant element elem is the n-th descendant element to be obtained, and YES.
If so, in step 97, the value of elem is assigned to descendant and the process ends.

【0136】ステップS195の判定結果がNOであれば、
次の子孫要素を求めるべく、ステップS196でiの値を一
つ繰り上げて、ステップS192に戻ってもう一度処理を
繰り返す。
If the decision result in the step S195 is NO,
In order to obtain the next descendant element, the value of i is incremented by 1 in step S196, and the process returns to step S192 to repeat the process.

【0137】[兄要素の取出し]次に図17のフローチ
ャートを参照して、兄要素の取出しの処理手順について
説明する。
[Retrieval of Brother Element] Next, with reference to the flow chart of FIG. 17, the procedure for extracting the brother element will be described.

【0138】ステップS201では、必要な変数の初期化
を行う。変数psiblingとelemは、要素ツリーインデック
スのエントリの値を格納するための変数である。
In step S201, necessary variables are initialized. The variables psibling and elem are variables for storing the value of the entry of the element tree index.

【0139】それぞれの変数の用途は、psiblingは、こ
の処理手順で求める兄要素のエントリを格納するための
ものであり、変数elemは計算の過程における要素ツリー
インデックスの現在エントリを格納するためのものであ
る。
The use of each variable is that psibling is for storing the entry of the sibling element obtained in this processing procedure, and variable elem is for storing the current entry of the element tree index in the process of calculation. Is.

【0140】変数baseは、起点要素のエントリの要素レ
ベルの値を格納する。
The variable base stores the element level value of the entry of the starting element.

【0141】変数nは、n番目の兄要素を取出すために指
定された値である。
The variable n is a value designated to take out the n-th brother element.

【0142】変数iは、繰り返し処理に関するカウンタ
として用いる。
The variable i is used as a counter for repeating processing.

【0143】ステップS202からステップS203までは、
図13のステップS162からステップS163までと同様で
ある。
From step S202 to step S203,
This is the same as steps S162 to S163 in FIG.

【0144】ステップS204では、ステップS203のelem
の要素レベルが、ステップS201の初期化で設定したbas
eの値と同じであるか否かを判定する。
At step S204, the elem of step S203.
Element level of bas set in the initialization of step S201
It is determined whether it is the same as the value of e.

【0145】ステップS204の判定結果がYESであれば、
現在のelemがi番目の兄要素のエントリとなる。
If the decision result in the step S204 is YES,
The current elem is the entry for the i-th sibling element.

【0146】そしてステップS206で、そのi番目の兄要
素elemが求めるn番目の子孫要素か否かを判定し、YESで
あれば、ステップa8でpsiblingにelemの値を代入して、
処理を終了する。
Then, in step S206, it is determined whether or not the i-th brother element elem is the n-th descendant element to be obtained, and if YES, the value of elem is substituted in psibling in step a8,
The process ends.

【0147】ステップS206の判定結果がNOであれば、
次の兄要素を求めるべく、ステップS207でiの値を一つ
繰り上げて、ステップS202に戻って、もう一度処理を
繰り返す。
If the decision result in the step S206 is NO,
In order to obtain the next brother element, the value of i is incremented by 1 in step S207, the process returns to step S202, and the process is repeated again.

【0148】ステップS204の判定結果がNOであれば、
ステップS205に進み、ステップS203のelemの要素レベ
ルが、baseの値よりも大きい値であるか否かを判定す
る。
If the decision result in the step S204 is NO,
In step S205, it is determined whether the element level of elem in step S203 is larger than the value of base.

【0149】ステップS205の判定結果がYESであれば、
ステップS202に戻って、もう一度処理を繰り返す。判
定結果がNOであれば、処理を終了する。
If the decision result in the step S205 is YES,
Returning to step S202, the process is repeated once again. If the determination result is NO, the process ends.

【0150】[弟要素の取出し]次に図18のフローチ
ャートを参照して、弟要素の取出しの処理手順について
説明する。
[Retrieval of younger brother element] Next, with reference to the flow chart of FIG. 18, a processing procedure for retrieving a younger brother element will be described.

【0151】ステップS211では、変数の初期化を行
う。変数fsiblingとelemは、要素ツリーインデックスの
エントリの値を格納するための変数である。
In step S211, variables are initialized. The variables fsibling and elem are variables for storing the value of the entry of the element tree index.

【0152】それぞれの変数の用途は、変数psibling
は、この処理で求める弟要素のエントリを格納するため
のものであり、変数elemは計算の過程における要素ツリ
ーインデックスの現在エントリを格納するためのもので
ある。
The usage of each variable is the variable psibling.
Is for storing the entry of the younger brother element obtained in this process, and the variable elem is for storing the current entry of the element tree index in the process of calculation.

【0153】変数baseは、起点要素のエントリの要素レ
ベルの値を格納する。変数nはn番目の弟要素を取出すた
めに指定された値である。
The variable base stores the element level value of the entry of the starting element. The variable n is the value specified to retrieve the nth sibling element.

【0154】変数iは繰り返し処理に関するカウンタと
して用いる。
The variable i is used as a counter for the repetitive processing.

【0155】ステップS212からステップS213までは、
図15のステップS182からステップS183までと同様で
ある。
From step S212 to step S213,
This is similar to steps S182 to S183 in FIG.

【0156】ステップS214では、ステップS213のelem
の要素レベルが、ステップS211の初期化で設定したbas
eの値と同じであるか否かを判定する。
In step S214, the elem of step S213.
Element level of bas set in the initialization of step S211
It is determined whether it is the same as the value of e.

【0157】ステップS214の判定結果がYESであれば、
現在のelemがi番目の弟要素のエントリとなる。
If the decision result in the step S214 is YES,
The current elem is the entry for the i-th sibling element.

【0158】そしてステップS216で、そのi番目の弟要
素elemが求めるn番目の子孫要素か否かを判定し、YESで
あればステップS218でfsiblingにelemの値を代入して
処理を終了する。
Then, in step S216, it is determined whether or not the i-th younger brother element elem is the n-th descendant element to be obtained, and if YES, the value of elem is assigned to fsibling in step S218, and the processing is terminated.

【0159】ステップS216の判定結果がNOであれば、
次の兄要素を求めるべく、ステップS217でiの値を一つ
繰り上げて、ステップS212に戻ってもう一度処理を繰
り返す。
If the decision result in the step S216 is NO,
In order to obtain the next brother element, the value of i is incremented by 1 in step S217, the process returns to step S212 and the process is repeated again.

【0160】ステップS214の判定結果がNOであれば、
ステップS215に進み、ステップS213のelemの要素レベ
ルが、baseの値よりも大きい値であるか否かを判定す
る。
If the decision result in the step S214 is NO,
In step S215, it is determined whether the element level of elem in step S213 is larger than the value of base.

【0161】ステップS215の判定結果がYESであれば、
ステップS212に戻ってもう一度処理を繰り返す。判定
結果がNOであれば処理を終了する。
If the decision result in the step S215 is YES,
The process returns to step S212 to repeat the process again. If the determination result is NO, the process ends.

【0162】[末弟要素の取出し]次に、ある要素の弟
要素よりもさらに弟の要素が存在しない場合、その弟要
素を末弟要素と呼ぶ。「末弟要素の取出し」プロセス
は、後に示す「右深さ優先順序での子孫要素の取出し」
に必要なサブプロセスである。
[Fetching the youngest younger brother element] Next, when there are no more younger brother elements than a certain younger brother element, the younger brother element is called the younger brother element. The "Retrieve youngest brother element" process is shown in "Retrieving descendant elements in right-depth-first order" shown later.
It is a necessary sub-process.

【0163】図19のフローチャートを参照して、末弟
要素の取出しの処理手順について説明する。
With reference to the flowchart in FIG. 19, the processing procedure for taking out the younger brother element will be described.

【0164】ステップS221では、変数の初期化を行
う。変数fsiblingとelemは、要素ツリーインデックスの
エントリの値を格納するための変数である。それぞれの
変数の用途は、psiblingは、この処理で求める末弟要素
のエントリを格納するためのものであり、変数elemは計
算の過程における要素ツリーインデックスの現在エント
リを格納するためのものである。変数baseは起点要素の
エントリの要素レベルの値を格納する。
In step S221, variables are initialized. The variables fsibling and elem are variables for storing the value of the entry of the element tree index. The use of each variable is to store the entry of the youngest sibling element obtained in this process, psibling, and to store the current entry of the element tree index in the process of calculation, as the variable elem. The variable base stores the element level value of the entry of the starting element.

【0165】ステップS222からステップS224までは、
図18のステップS212からステップS214までと同様で
ある。
From step S222 to step S224,
This is the same as steps S212 to S214 in FIG.

【0166】ステップS224の判定結果がYESであれば、
現在のelemは弟要素のエントリとして、ステップS225
でfsiblingにelemの値を代入する。ただし、このfsibli
ngが末弟であるかどうかはこの時点では分からないの
で、ステップS222に戻ってもう一度処理を繰り返し、f
siblingの値を逐次更新していく。
If the decision result in the step S224 is YES,
The current elem is the entry of the younger brother element, and step S225
Assign the value of elem to fsibling. However, this fsibli
Since it is unknown at this point whether or not ng is the youngest brother, the process returns to step S222 and the process is repeated once again.
The value of sibling is updated sequentially.

【0167】ステップS224の判定結果がNOであれば、
ステップS226に進み、ステップS223のelemの要素レベ
ルが、baseの値よりも大きい値であるか否かを判定す
る。
If the decision result in the step S224 is NO,
In step S226, it is determined whether the element level of elem in step S223 is greater than the value of base.

【0168】ステップS226の判定結果がYESであれば、
ステップS222に戻ってもう一度処理を繰り返す。判定
結果がNOであれば処理を終了する。
If the decision result in the step S226 is YES,
The process returns to step S222 and the process is repeated again. If the determination result is NO, the process ends.

【0169】[右深さ優先順序での子孫要素の取出し]
右深さ優先順序での子孫要素の取出しプロセスは、後述
する前要素の取出しに必要なサブプロセスである。
[Retrieval of descendant elements in right depth priority order]
The process of fetching the descendant elements in the right-depth priority order is a sub-process required for fetching the previous element, which will be described later.

【0170】ここで、右深さ優先順序とは、図11に示
した木構造において、右から左へ深さ優先で要素をたど
るときに得られる順序である。
Here, the right depth priority order is the order obtained when the elements are traced in depth priority from right to left in the tree structure shown in FIG.

【0171】図10に示した文書で要素の開始タグの出
現順番は、図11の木構造では、左から右へ深さ優先で
要素をたどるときに得られる順序と一致する。よって、
右深さ優先順序で取出される要素の順番は、文書の要素
の開始タグの出現順番とは異なる。
In the document shown in FIG. 10, the appearance order of the start tags of the elements matches the order obtained when tracing the elements from the left to the right in the depth priority in the tree structure. Therefore,
The order of the elements fetched in the right depth priority order is different from the order of appearance of the start tags of the elements of the document.

【0172】図20に示したフローチャートを参照し
て、右深さ優先順序での子孫要素の取出しの処理手順に
ついて説明する。
With reference to the flow chart shown in FIG. 20, description will be given of a processing procedure for extracting descendant elements in the right depth priority order.

【0173】ステップS231では、変数の初期化を行
う。変数descendantとelemは、要素ツリーインデックス
のエントリの値を格納するための変数である。それぞれ
の変数の用途は、descendantは、この処理で求める子孫
要素のエントリを格納するためのものであり、変数elem
は計算の過程における要素ツリーインデックスの現在エ
ントリを格納するためのものである。変数nは、n番目の
子孫要素を取出すために指定された値である。変数iは
繰り返し処理に関するカウンタとして用いる。
In step S231, variables are initialized. The variables descendant and elem are variables for storing the value of the entry of the element tree index. The purpose of each variable is that the descendant is for storing the entry of the descendant element to be obtained in this process, and the variable elem
Is for storing the current entry of the element tree index in the process of calculation. The variable n is the value specified to retrieve the nth descendant element. The variable i is used as a counter for the iterative process.

【0174】ステップS232では、サブプロセス「末弟
要素の取出し」を呼び出し、当該要素elemの末弟要素の
エントリを取出す。
In step S232, the subprocess "take out youngest younger brother element" is called, and the entry of the youngest younger brother element of the element elem is taken out.

【0175】ステップS233で、その末弟要素を取出せ
たか否かを判定し、判定結果がYESであれば、その取出
した要素のエントリがi番目の子孫要素のエントリとな
る。
In step S233, it is determined whether or not the youngest younger brother element can be extracted. If the determination result is YES, the entry of the extracted element becomes the entry of the i-th descendant element.

【0176】ステップS234でその取出した要素のエン
トリをelemに代入し、ステップS235でそのi番目の子孫
要素elemが求めるn番目の子孫要素か否かを判定する。
In step S234, the entry of the fetched element is assigned to elem, and in step S235, it is determined whether or not the i-th descendant element elem is the n-th descendant element to be obtained.

【0177】ステップS235の判定結果がYESであればス
テップS242でdescendantにelemの値を代入して処理を
終了する。
If the decision result in the step S235 is YES, a step S242 substitutes the value of elem for the descendant, and the process ends.

【0178】ステップS235の判定結果がNOであればス
テップS236へ進む。またステップS233の判定結果がNO
であれば処理を終了する。
If the decision result in the step S235 is NO, the process advances to a step S236. Further, the determination result of step S233 is NO.
If so, the process ends.

【0179】ステップS236では、iの値を一つ繰り上
げ、また別の繰り返し処理用カウンタjを新たに用意し
て1に初期化する。
In step S236, the value of i is incremented by one and another iteration processing counter j is newly prepared and initialized to 1.

【0180】ステップS237は、この新たな変数値i、j
による「右深さ優先順序での子孫要素の取出し」の再帰
呼び出しとなる。
In step S237, the new variable values i and j are added.
It is a recursive call of "Retrieving descendant elements in right-depth-first order".

【0181】ステップS238で、その子孫要素を取出せ
たか否かを判定し、判定結果がYESであれば、ステップ
S239で取出した要素に相当するエントリをelemに代入
し、elemがi番目の子孫要素のエントリとなる。
In step S238, it is determined whether or not the descendant element has been extracted. If the determination result is YES, the entry corresponding to the element extracted in step S239 is assigned to elem, and elem is the i-th descendant element. Will be the entry.

【0182】そしてステップS240で、そのi番目の子孫
要素elemが求めるn番目の子孫要素か否かを判定し、YES
であれば、ステップS242でdescendantにelemの値を代
入して処理を終了する。
Then, in step S240, it is determined whether or not the i-th descendant element elem is the n-th descendant element to be obtained, and YES.
If so, the value of elem is assigned to descendant in step S242, and the process ends.

【0183】ステップS240の判定結果がNOであれば、
次の子孫要素を求めるべく、ステップS241でiとjの値
を一つ繰り上げて、ステップS237の再帰呼び出しに戻
って同様の処理を繰り返す。
If the decision result in the step S240 is NO,
In order to obtain the next descendant element, the values of i and j are incremented by 1 in step S241, the process returns to the recursive call in step S237, and the same processing is repeated.

【0184】ステップS238の判定結果がNOであれば、
ステップS243に進み、サブプロセス「兄要素の取出
し」を呼び出す。
If the decision result in the step S238 is NO,
The process proceeds to step S243 to call the sub-process "take out brother element".

【0185】ステップS244で当該elemに対する1番目の
兄要素を取出せたか否かを判定し、判定結果がYESであ
れば、ステップS245で取出した要素に相当するエント
リをelemに代入し、elemがi番目の子孫要素のエントリ
となる。
In step S244, it is determined whether or not the first brother element for the elem has been taken out. If the decision result is YES, the entry corresponding to the element taken out in step S245 is assigned to elem, and elem is i It becomes the entry of the th descendant element.

【0186】そしてステップS246で、そのi番目の子孫
要素elemが求めるn番目の子孫要素か否かを判定し、YES
であればステップdgでdescendantにelemの値を代入して
処理を終了する。
Then, in step S246, it is determined whether or not the i-th descendant element elem is the n-th descendant element to be obtained, and YES.
If so, the value of elem is assigned to descendant in step dg, and the process ends.

【0187】ステップS246の判定結果がNOであれば、
次の子孫要素を求めるべく、ステップS236でiの値を一
つ繰り上げ、jの値を再度1に初期化して、ステップS23
7の再帰呼び出しに戻って同様の処理を繰り返す。
If the decision result in the step S246 is NO,
In order to obtain the next descendant element, the value of i is incremented by 1 in step S236, the value of j is initialized to 1 again, and step S23
Return to the recursive call of 7 and repeat the same process.

【0188】[前要素の取出し]次に、図21のフロー
チャートを参照して、前要素の取出しの処理手順につい
て説明する。
[Removal of Previous Element] Next, with reference to the flow chart of FIG. 21, a processing procedure for extracting the previous element will be described.

【0189】ステップS251では、変数の初期化を行
う。変数precedingとelemは、要素ツリーインデックス
のエントリの値を格納するための変数である。
At step S251, variables are initialized. The variables preceding and elem are variables for storing the value of the entry of the element tree index.

【0190】それぞれの変数の用途は、precedingは、
この処理で求める前要素のエントリを格納するためのも
のであり、変数elemは、計算の過程における要素ツリー
インデックスの現在エントリを格納するためのものであ
る。変数nは、n番目の前要素を取出すために指定された
値である。変数iは、繰り返し処理に関するカウンタと
して用いる。
The usage of each variable is that the preceding is
This is for storing the entry of the previous element obtained in this process, and the variable elem is for storing the current entry of the element tree index in the process of calculation. The variable n is the value specified to retrieve the nth previous element. The variable i is used as a counter for the iterative process.

【0191】ステップS252では、サブプロセス「兄要
素の取出し」を呼び出し、当該要素elemの1番目の兄要
素のエントリを取出す。
In step S252, the sub-process "take out older brother element" is called to take out the entry of the first older brother element of the element elem.

【0192】ステップS253でその兄要素を取出せたか
否かを判定し、判定結果がYESであれば、ステップS259
で取出した要素に相当するエントリをelemに代入し、el
emがi番目の前要素のエントリとなる。
In step S253, it is determined whether or not the older brother element has been extracted. If the determination result is YES, step S259
Assign the entry corresponding to the element fetched in step to elem, and enter el
em is the entry of the i-th previous element.

【0193】そして、ステップS260で、そのi番目の前
要素elemが求めるn番目の前要素か否かを判定し、YESで
あればステップS267でprecedingにelemの値を代入して
処理を終了する。
Then, in step S260, it is determined whether or not the i-th previous element elem is the n-th previous element to be obtained, and if YES, the value of elem is substituted into the preceding in step S267, and the processing ends. .

【0194】ステップS260の判定結果がNOであればス
テップS261へ進む。またステップS253の判定結果がNO
であればステップS254へ進む。
If the decision result in the step S260 is NO, the process advances to a step S261. In addition, the determination result of step S253 is NO.
If so, the process proceeds to step S254.

【0195】ステップS261では、iの値を一つ繰り上
げ、また別の繰り返し処理用カウンタjを新たに用意し
て1に初期化する。
In step S261, the value of i is incremented by one and another iteration processing counter j is newly prepared and initialized to 1.

【0196】ステップS262では、この新たな変数値i、
jでサブプロセス「右深さ優先順序での子孫要素の取出
し」を呼び出す。
At step S262, the new variable value i,
Invokes the subprocess "get descendant elements in right-depth-first order" with j.

【0197】ステップS263でその子孫要素を取出せた
か否かを判定し、判定結果がYESであれば、ステップS2
64で取出した要素に相当するエントリをelemに代入し、
elemがi番目の前要素のエントリとなる。
In step S263, it is determined whether or not the descendant element has been extracted. If the determination result is YES, step S2
Assign the entry corresponding to the element fetched in 64 to elem,
elem is the entry of the i-th previous element.

【0198】そしてステップS265で、そのi番目の前要
素elemが求めるn番目の前要素か否かを判定し、YESであ
ればステップS267でprecedingにelemの値を代入して処
理を終了する。
Then, in step S265, it is determined whether or not the i-th previous element elem is the n-th previous element to be obtained, and if YES, the value of elem is substituted for the preceding in step S267, and the processing is terminated.

【0199】ステップS265の判定結果がNOであれば、
次の前要素を求めるべく、ステップS266でiとjの値を
一つ繰り上げて、ステップS262に戻って同様の処理を
繰り返す。
If the decision result in the step S265 is NO,
In order to obtain the next previous element, the values of i and j are incremented by 1 in step S266, and the process returns to step S262 to repeat the same processing.

【0200】ステップS263の判定結果がNOであれば、
ステップS252に戻ってもう一度処理を繰り返す。
If the decision result in the step S263 is NO,
The process returns to step S252 to repeat the process again.

【0201】ステップS254では、サブプロセス「親要
素の取出し」を呼び出し、当該要素elemの親要素のエン
トリを取出す。ステップS255でその親要素を取出せた
か否かを判定し、判定結果がYESであれば、ステップS2
56で取出した要素に相当するエントリをelemに代入し、
elemがi番目の前要素のエントリとなる。
In step S254, the subprocess "take out parent element" is called to take out the entry of the parent element of the element elem. In step S255, it is determined whether or not the parent element has been extracted. If the determination result is YES, step S2
Assign the entry corresponding to the element fetched in 56 to elem,
elem is the entry of the i-th previous element.

【0202】そしてステップS257で、そのi番目の前要
素elemが求めるn番目の前要素か否かを判定し、YESであ
ればステップS267でprecedingにelemの値を代入して処
理を終了する。
Then, in step S257, it is determined whether or not the i-th previous element elem is the n-th previous element to be obtained, and if YES, the value of elem is substituted in the preceding in step S267, and the processing is ended.

【0203】ステップS257判定結果がNOであれば、次
の前要素を求めるべく、ステップS258でiの値を一つ繰
り上げて、ステップS252に戻ってもう一度処理を繰り
返す。
If the decision result in the step S257 is NO, the value of i is incremented by 1 in a step S258 in order to obtain the next preceding element, and the process returns to the step S252 to repeat the process again.

【0204】ステップS255の判定結果がNOであれば処
理を終了する。
If the decision result in the step S255 is NO, the process ends.

【0205】[次要素の取出し]次に図22のフローチ
ャートを参照して、次要素の取出しの処理手順について
説明する。
[Retrieval of Next Element] Next, with reference to the flow chart of FIG. 22, the processing procedure of retrieval of the next element will be described.

【0206】ステップS271では、変数の初期化を行
う。変数followingとelemは、要素ツリーインデックス
のエントリの値を格納するための変数である。それぞれ
の変数の用途について説明すると、followingは、この
処理で求める次要素のエントリを格納するためのもので
あり、変数elemは計算の過程における要素ツリーインデ
ックスの現在エントリを格納するためのものである。変
数nは、n番目の次要素を取出すために指定された値であ
る。変数iは、繰り返し処理に関するカウンタとして用
いる。
In step S271, variables are initialized. The variables following and elem are variables for storing the value of the entry of the element tree index. Describing the usage of each variable, following is for storing the entry of the next element obtained in this process, and variable elem is for storing the current entry of the element tree index in the process of calculation. . The variable n is the value specified to retrieve the nth next element. The variable i is used as a counter for the iterative process.

【0207】ステップS272では、サブプロセス「弟要
素の取出し」を呼び出し、当該要素elemの1番目の弟要
素のエントリを取出す。
In step S272, the subprocess "take out younger brother element" is called to take out the entry of the first younger brother element of the element elem.

【0208】ステップS273でその弟要素を取出せたか
否かを判定し、判定結果がYESであれば、ステップS279
で取出した要素に相当するエントリをelemに代入し、el
emがi番目の次要素のエントリとなる。
[0208] In step S273, it is determined whether or not the younger brother element has been extracted. If the determination result is YES, step S279
Assign the entry corresponding to the element fetched in step to elem, and enter el
em is the entry of the i-th next element.

【0209】そしてステップS280で、そのi番目の次要
素elemが求めるn番目の次要素か否かを判定し、YESであ
れば、ステップS287でfollowingにelemの値を代入して
処理を終了する。
Then, in step S280, it is determined whether or not the i-th next element elem is the n-th next element to be obtained, and if YES, the value of elem is substituted for following in step S287, and the processing ends. .

【0210】ステップS280の判定結果がNOであればス
テップS281へ進む。またステップS273の判定結果がNO
であればステップS274へ進む。
[0210] If the decision result in the step S280 is NO, the process advances to a step S281. In addition, the determination result of step S273 is NO.
If so, the process proceeds to step S274.

【0211】ステップS281では、iの値を一つ繰り上
げ、また別の繰り返し処理用カウンタjを新たに用意し
て1に初期化する。
In step S281, the value of i is incremented by one, and another iteration processing counter j is newly prepared and initialized to 1.

【0212】ステップS282では、この新たな変数値i、
jでサブプロセス「子孫要素の取出し」を呼び出す。ス
テップS283でその子孫要素を取出せたか否かを判定
し、判定結果がYESであれば、ステップS284で取出した
要素に相当するエントリelemに代入し、elemがi番目の
次要素のエントリとなる。
At step S282, the new variable value i,
Invoke the subprocess "Extract descendant elements" with j. In step S283, it is determined whether or not the descendant element has been extracted, and if the determination result is YES, it is substituted into the entry elem corresponding to the element extracted in step S284, and elem becomes the entry of the i-th next element.

【0213】そしてステップS285で、そのi番目の次要
素elemが求めるn番目の次要素か否かを判定し、YESであ
ればステップS287でfollowingにelemの値を代入して処
理を終了する。
Then, in step S285, it is determined whether or not the i-th next element elem is the n-th next element to be obtained, and if YES, the value of elem is substituted for following in step S287, and the processing ends.

【0214】ステップS285の判定結果がNOであれば、
次の次要素を求めるべく、ステップS286でiとjの値を
一つ繰り上げて、ステップS282に戻って同様の処理を
繰り返す。
If the decision result in the step S285 is NO,
In order to obtain the next next element, the values of i and j are incremented by one in step S286, and the process returns to step S282 to repeat the same processing.

【0215】ステップS283の判定結果がNOであれば、
ステップS272に戻ってもう一度処理を繰り返す。
If the decision result in the step S283 is NO,
The process returns to step S272 and the process is repeated again.

【0216】ステップS274では、サブプロセス「親要
素の取出し」を呼び出し、当該要素elemの親要素のエン
トリを取出す。
In step S274, the subprocess "take out parent element" is called, and the entry of the parent element of the element elem is taken out.

【0217】ステップS275でその親要素を取出せたか
否かを判定し、判定結果がYESであれば、ステップS276
で取出した要素に相当するエントリをelemに代入し、el
emがi番目の次要素のエントリとなる。
In step S275, it is determined whether or not the parent element has been extracted. If the determination result is YES, step S276
Assign the entry corresponding to the element fetched in step to elem, and enter el
em is the entry of the i-th next element.

【0218】そしてステップS277で、そのi番目の次要
素elemが求めるn番目の次要素か否かを判定し、YESであ
ればステップS287でfollowingにelemの値を代入して処
理を終了する。
Then, in step S277, it is determined whether or not the i-th next element elem is the n-th next element to be obtained, and if YES, the value of elem is substituted for following in step S287, and the processing ends.

【0219】ステップS277の判定結果がNOであれば、
次の次要素を求めるべく、ステップS278でiの値を一つ
繰り上げて、ステップS272に戻ってもう一度処理を繰
り返す。ステップS275の判定結果がNOであれば処理を
終了する。
If the decision result in the step S277 is NO,
In order to obtain the next next element, the value of i is incremented by one in step S278, and the process returns to step S272 to repeat the process. If the decision result in the step S275 is NO, the process ends.

【0220】[要素−属性インデックス]要素−属性イ
ンデックス15は、文書フォルダオブジェクトごとに作
成して保持するものであり、文書フォルダオブジェクト
が保有する文書集合から、要素名、属性名、属性値を条
件に、文書または要素を検索するために用いる。
[Element-attribute index] The element-attribute index 15 is created and held for each document folder object, and the element name, the attribute name, and the attribute value are selected from the document set held by the document folder object. , Used to search for documents or elements.

【0221】要素−属性インデックスは、(DTDI
D、要素−属性名ID、属性値、文書ID、要素開始位
置)の五つ組みのデータ構造を持つデータエントリのリ
ストとする。
The element-attribute index is (DTDI
D, element-attribute name ID, attribute value, document ID, element start position) is a list of data entries having a five-element data structure.

【0222】要素−属性名IDについて説明する。要素
−属性名IDとは、要素名IDもしくは属性名IDであ
る。要素名IDは前述の通り、DTDオブジェクト内で
唯一なIDである。属性名IDもDTDオブジェクト内
の要素名に対して唯一なIDで、かつ異なる要素名で同
じ属性名が存在してもそれを識別可能なIDである。
The element-attribute name ID will be described. The element-attribute name ID is an element name ID or an attribute name ID. As described above, the element name ID is the only ID in the DTD object. The attribute name ID is also unique to the element name in the DTD object, and is an ID that can identify the same attribute name even if different element names exist.

【0223】要素−属性インデックス15のエントリの
作成では、文書中の要素が一つも属性を持たない場合、
その要素に対応するエントリを一つ作成し、その要素−
属性名IDの値を、その要素の要素名IDとする。
When an element-attribute index 15 entry is created, if no element in the document has an attribute,
Create one entry for that element and
The value of the attribute name ID is used as the element name ID of the element.

【0224】文書中の要素が一つ以上の属性を持つ場合
は、その属性に対応する分のエントリを作成し、各属性
に対応する要素−属性名IDの値を、その属性の属性名
IDとする。属性名IDからどの要素の属性名であるか
を判別できるので、属性名IDを持つエントリからその
エントリに対応する要素を特定することが可能である。
When the element in the document has one or more attributes, the entries corresponding to the attributes are created, and the value of the element-attribute name ID corresponding to each attribute is set to the attribute name ID of the attribute. And Since the element having the attribute name ID can be determined from the attribute name ID, it is possible to specify the element corresponding to the entry from the entry having the attribute name ID.

【0225】[DTDIDと文書ID]DTDIDおよ
び文書IDについて説明する。DTDIDおよび文書I
Dは、それぞれデータベース中のDTDクラス、文書ク
ラスの各インスタンスに割り当てられた、それぞれのク
ラス内で唯一に識別可能なオブジェクトIDである。こ
の番号は、データベース管理システムによって与えられ
るか、もしくは、アプリケーション側で唯一となるよう
に与えるようにしてもよい。
[DTDID and Document ID] The DTDID and document ID will be described. DTDID and Document I
D is an object ID uniquely identifiable in each class, which is assigned to each instance of the DTD class and the document class in the database. This number may be given by the database management system, or may be given uniquely on the application side.

【0226】要素−属性インデックス15のエントリに
おけるDTDID、文書IDの値は、要素−属性名ID
に対応する要素を持つ文書の文書ID、その文書が従う
DTDのDTDIDとなる。
The values of the DTDID and the document ID in the entry of the element-attribute index 15 are the element-attribute name ID.
It is the document ID of the document having the element corresponding to, and the DTD ID of the DTD to which the document complies.

【0227】[属性値]属性値について説明する。属性
値は、文字通り、属性の値である。要素−属性インデッ
クス15のエントリにおける属性値の値は、要素−属性
名IDに対応する属性の属性値となる。
[Attribute Value] The attribute value will be described. The attribute value is literally the value of the attribute. The value of the attribute value in the entry of the element-attribute index 15 becomes the attribute value of the attribute corresponding to the element-attribute name ID.

【0228】[要素開始位置]要素開始位置について説
明する。要素開始位置とは、要素ツリーインデックス1
4における要素開始位置と同じで、文書中の要素の記述
(開始タグを含む)の開始バイト位置の値である。要素−
属性インデックスのエントリにおける要素開始位置の値
は、要素−属性名IDに対応する要素の要素開始位置と
なる。
[Element Start Position] The element start position will be described. The element start position is the element tree index 1
Same as element start position in 4 and description of element in document
The value of the start byte position (including the start tag). Element −
The value of the element start position in the entry of the attribute index becomes the element start position of the element corresponding to the element-attribute name ID.

【0229】要素−属性インデックス15の作成手順を
示す。要素−属性インデックスの作成は、要素−属性イ
ンデックス作成部212で行われる。
A procedure for creating the element-attribute index 15 will be described. The element-attribute index creation unit 212 creates the element-attribute index.

【0230】図23及び図24は、要素−属性インデッ
クス15の作成手順を示すフローチャートであり、要素
−属性インデックス15の前記五つ組みのデータ構造
(DTDID、要素−属性名ID、属性値、文書ID、
要素開始位置)の各項目の値を求め、(DTDID、要素
−属性名ID)の値でソートした順序を保ちながら、前
記要素−属性インデックスのリストに作成したエントリ
を追加する処理手順を示している。
23 and 24 are flowcharts showing the procedure for creating the element-attribute index 15, and the data structure of the five-piece element-attribute index 15 structure.
(DTDID, element-attribute name ID, attribute value, document ID,
The procedure of obtaining the value of each item of (element start position) and adding the created entry to the list of the element-attribute index while maintaining the order sorted by the value of (DTDID, element-attribute name ID) is shown. There is.

【0231】ただし、ここで扱う文書は、DTDに対す
る妥当性が保証され、前記DTD自身の妥当性も保証さ
れていることを前提とする。また文書中のタグの省略、
属性値の省略等は、構造化文書のパーサによってすべて
補完されていることを前提とする。そして、図23及び
図24に示す処理はこのような文書の記述の先頭から最
後までを連続的に読み込むこととする。
However, it is assumed that the document handled here is guaranteed to be valid for DTD, and the validity of the DTD itself is also guaranteed. Also omit tags in the document,
It is assumed that the omission of attribute values, etc. are all complemented by the structured document parser. Then, in the processing shown in FIGS. 23 and 24, it is assumed that the description of such a document is continuously read from the beginning to the end.

【0232】図23を参照すると、ステップS301、S3
02で文書フォルダオブジェクトに文書オブジェクトを追
加すると、ステップS303、ステップS304で、前記文書
オブジェクトと関係するDTDオブジェクトも同時に追
加する。
Referring to FIG. 23, steps S301 and S3
When the document object is added to the document folder object in 02, the DTD object related to the document object is also added in steps S303 and S304.

【0233】そして、DTDオブジェクトと1対1の関
係を持つ要素−属性IDテーブルの情報を基にしなが
ら、以下のステップでは、追加した文書オブジェクトの
各要素に対する要素−属性インデックスのエントリを作
成・追加していく。
Then, based on the information of the element-attribute ID table having a one-to-one relationship with the DTD object, in the following steps, an element-attribute index entry for each element of the added document object is created / added. I will do it.

【0234】ステップS312では、図25に示すサブプ
ロセスを呼び出している。図23のステップS312で与
える(DTDID、要素名ID)を元に、図25のステッ
プS331では、その(DTDID、要素名ID)を持つエ
ントリのリストを探す。
In step S312, the sub process shown in FIG. 25 is called. Based on (DTDID, element name ID) given in step S312 of FIG. 23, in step S331 of FIG. 25, a list of entries having that (DTDID, element name ID) is searched.

【0235】このステップS331では、さらに図26に
フローチャートを示すサブプロセスを呼び出している。
In step S331, a sub process whose flow chart is shown in FIG. 26 is called.

【0236】図25のステップS331で与える要素−属
性インデックスの全エントリのリストに対する開始位置
と終了位置、そしてDTDIDの値を目的のデータとし
て、要素−属性インデックスのリストから同じDTDI
Dの値を持つエントリのリストを探す。
From the element-attribute index list, the same DTDI is set by using the start position and end position for all entries of the element-attribute index and the DTDID value given in step S331 of FIG.
Find the list of entries with a value of D.

【0237】図25のステップS332では、そのエント
リリストが見つかったか否かを判定する。
In step S332 of FIG. 25, it is determined whether the entry list has been found.

【0238】見つかった場合は、図26のステップS35
4とステップS361で、そのエントリリストの開始位置と
終了位置が返却されるため、図25のステップS333で
さらにその開始位置と終了位置のエントリリストを対象
に、同じ要素−属性名IDの値を持つエントリのリスト
を探す。
If found, step S35 in FIG.
Since the start position and end position of the entry list are returned in step 4 and step S361, the same element-attribute name ID value is set for the entry list of the start position and end position in step S333 of FIG. Find the list of entries you have.

【0239】ステップS334でそのエントリリストが見
つかったか否かを判定し、見つかった場合は、図26の
ステップS355でリスト上の挿入位置が返却されるの
で、図25のステップS335でその挿入位置を返却す
る。
In step S334, it is determined whether or not the entry list is found. If found, the insertion position on the list is returned in step S355 of FIG. 26, so that the insertion position is determined in step S335 of FIG. return.

【0240】また図25のステップS332およびステッ
プS334において対象とするエントリリストが見つから
なかった場合も、図26のステップS348でリスト上の
挿入位置が返却されるので、ステップS335でその挿入
位置を返却する。
If the target entry list is not found in steps S332 and S334 of FIG. 25, the insertion position on the list is returned in step S348 of FIG. 26. Therefore, the insertion position is returned in step S335. To do.

【0241】図24のステップS320でも同様に、図2
5のサブプロセスを呼び出している。ただし、与えるデ
ータは(DTDID、属性名ID)であり、以降の処理は
前述の(DTDID、要素名ID)の場合と同様である。
Similarly in step S320 of FIG.
Calling 5 subprocesses. However, the data to be given is (DTDID, attribute name ID), and the subsequent processing is the same as in the case of (DTDID, element name ID) described above.

【0242】以上の処理により、要素−属性インデック
ス15のエントリが作成され、かつそのエントリの順序
は、(DTDID、要素−属性名ID)の値でソート済み
の順序となる。
By the above processing, the entry of the element-attribute index 15 is created, and the order of the entries is sorted by the value of (DTDID, element-attribute name ID).

【0243】要素−属性インデックス15のエントリ
を、(DTDID、要素−属性名ID)の値でソートして
おく目的は、エントリの検索において、(DTDID、
要素−属性名ID)をキーとした二分探索を可能とする
ためである。
The purpose of sorting the entries of the element-attribute index 15 by the value of (DTDID, element-attribute name ID) is to search for the entry (DTDID,
This is because it enables a binary search with the element-attribute name ID) as a key.

【0244】実際の二分探索の手順については、図26
にフローチャートを示したサブプロセスが行う。
FIG. 26 shows the actual binary search procedure.
The sub-process whose flowchart is shown in FIG.

【0245】図27は、要素−属性インデックスにおけ
る、エントリの検索手順を示す図である。ステップS37
1では、図26に示すサブプロセスを呼び出している。
FIG. 27 is a diagram showing an entry search procedure in the element-attribute index. Step S37
In 1, the sub process shown in FIG. 26 is called.

【0246】ステップS371で与える要素−属性インデ
ックスの全エントリのリストに対する開始位置と終了位
置、そしてDTDIDの値を目的のデータとして、要素
−属性インデックスのリストから同じDTDIDの値を
持つエントリのリストを探す。
A list of entries having the same DTDID value is selected from the element-attribute index list by using the start position and end position of all the element-attribute index entries given in step S371, and the DTDID value as the target data. look for.

【0247】ステップS372では、そのエントリリスト
が見つかったか否かを判定する。
In step S372, it is determined whether the entry list has been found.

【0248】見つかった場合は、図26のステップS35
4とステップS361で、そのエントリリストの開始位置と
終了位置が返却されるので、ステップS373でさらにそ
の開始位置と終了位置のエントリリストを対象に、同じ
要素−属性名IDの値を持つエントリのリストを探す。
If found, step S35 in FIG.
Since the start position and the end position of the entry list are returned in step 4 and step S361, the entry list having the same element-attribute name ID is further targeted to the entry list of the start position and the end position in step S373. Find the list.

【0249】ステップS374でそのエントリリストが見
つかったか否かを判定し、見つかった場合は、前述のD
TDIDの場合と同様に、該当するエントリ・リストの
開始位置と終了位置が返却される。
In step S374, it is determined whether or not the entry list is found. If found, the above-mentioned D
Similar to the case of TDID, the start position and end position of the corresponding entry list are returned.

【0250】ステップS375からステップS379までのル
ープ処理では、この返却されたエントリの一つ一つに対
して適用する。
The loop processing from step S375 to step S379 is applied to each of the returned entries.

【0251】各エントリに対して、ステップS376で属
性値に対する条件判定を行い、ステップS377の判定の
結果、YESであったエントリをステップS378で返却す
る。
With respect to each entry, the condition judgment for the attribute value is performed in step S376, and the entry which is YES as a result of the judgment in step S377 is returned in step S378.

【0252】ステップS376の属性値に対する条件には
さまざまな場合が考えられるが、例えば属性値が数値で
あった場合の算術的な判定、属性値が文字列であった場
合の文字列一致やその部分的な一致などが挙げられる。
There are various possible conditions for the attribute value in step S376. For example, arithmetic determination when the attribute value is a numeric value, character string matching when the attribute value is a character string, Partial match and the like.

【0253】なお、本発明に実施の形態において、文書
格納実行部21の配列ツリーインデックス作成部21
1、要素−属性インデックス作成部212、要素−属性
テーブル作成部213の各処理ステップ、及び検索実行
部22は、コンピュータで実行されるプログラムにより
実行される。例えば図5、図6、図9、図12乃至図2
7等に示したフローチャートに従い所望のプログラミン
グ言語でプログラムを作成し実行モジュールを作成し、
該ソースプログラム又は実行モジュールを記録した、コ
ンピュータで読み出し可能な記録媒体、もしくは、コン
ピュータが通信接続可能な通信媒体から、該プログラム
を読み出してコンピュータにインストールして実行する
ことで、本発明を実施することができる。
In the embodiment of the present invention, the array tree index creation unit 21 of the document storage execution unit 21.
1, the processing steps of the element-attribute index creation unit 212, the element-attribute table creation unit 213, and the search execution unit 22 are executed by a program executed by a computer. For example, FIG. 5, FIG. 6, FIG. 9, FIG.
According to the flowchart shown in 7 etc., create a program in the desired programming language and create an execution module,
The present invention is implemented by reading the program from a computer-readable recording medium that records the source program or the execution module or a communication medium that can be communicatively connected to the computer, and installing and executing the program in the computer. be able to.

【0254】[0254]

【実施例】本発明の一実施例として、本発明の文書格納
構造を基にした文書検索例に関して説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS As one embodiment of the present invention, an example of document retrieval based on the document storage structure of the present invention will be described.

【0255】[要素−属性インデックスを用いた文書及
びその要素の検索]図28にインスタンス図として示す
ように、文書フォルダオブジェクトが一つあり、文書フ
ォルダオブジェクトは3つの文書オブジェクトA、B、C
を管理し、さらに文書オブジェクトは、個々に、DTD
オブジェクトX、Yと関係付けられているとする。
[Search for Document and Its Element Using Element-Attribute Index] As shown as an instance diagram in FIG. 28, there is one document folder object, and the document folder object is three document objects A, B, C.
Document objects, and document objects individually
Assume that it is associated with objects X and Y.

【0256】文書オブジェクトA、B、Cの文書IDはそ
れぞれ1、2、3とし、DTDオブジェトX、YのDTDI
Dはそれぞれ1、2とする。
The document IDs of the document objects A, B, and C are 1, 2, and 3, respectively, and the DTDIs of the DTD objects X and Y are set.
D is 1 and 2, respectively.

【0257】文書フォルダオブジェクトは、DTDオブ
ジェクトX、Yも管理する。
The document folder object also manages DTD objects X and Y.

【0258】図29は、文書オブジェクトA、B、Cの内
容の例を示す図である。図28の左側の数字は、文書の
行番号を表しているのではなく、それぞれ前記数字の右
側に現れる要素の開始タグの最初の文字位置、また終了
タグの最後の文字位置をそれぞれ表しているものとす
る。
FIG. 29 is a diagram showing an example of the contents of the document objects A, B, and C. The numbers on the left side of FIG. 28 do not represent the line numbers of the document, but the first character position of the start tag and the last character position of the end tag of the elements appearing on the right side of the numbers, respectively. I shall.

【0259】図30、及び図31は、DTDオブジェク
トX、Yが管理する要素−属性IDテーブルをそれぞれ示
す図である。
FIGS. 30 and 31 are views showing the element-attribute ID tables managed by the DTD objects X and Y, respectively.

【0260】以上の文書オブジェクトA、B、Cを文書フ
ォルダオブジェクトに登録すると、文書フォルダオブジ
ェクトは、図23及び図24で示した手順に従い、図3
2に示す要素−属性インデックスを作成する。
When the above document objects A, B, and C are registered in the document folder object, the document folder object follows the procedure shown in FIGS.
2. Create the element-attribute index shown in 2.

【0261】検索要求の例「要素"疾患記録"の子孫要素
で、属性"pID"が1000以上の要素"患者"を取出せ」に
対する、検索実行部22の検索処理の手順について説明
する。
Example of Search Request The procedure of the search process of the search execution unit 22 for the element “patient”, which is a descendant element of the element “disease record” and the attribute “pID” of which is 1000 or more, will be described.

【0262】ステップ1:属性"pID"の値が1000以上
の要素"患者"の取出し:
Step 1: Retrieval of element "Patient" whose attribute "pID" value is 1000 or more:

【0263】a)文書フォルダオブジェクトは、自分が
管理するDTDオブジェクトX、Yの要素−属性IDテー
ブル、及びX、YのDTDIDをロードする。
A) The document folder object loads the element-attribute ID table of the DTD objects X and Y managed by itself, and the DTD IDs of X and Y.

【0264】b)DTDオブジェクトX、Yの要素−属性
IDテーブルから、検索要求で用いられている要素名("
患者"、"疾患記録")、属性名("pID")の要素名ID、
属性名IDを調べる。
B) From the element-attribute ID table of the DTD objects X and Y, the element name ("" used in the search request)
"Patient", "disease record"), element name ID of attribute name ("pID"),
Check the attribute name ID.

【0265】・DTDオブジェクトX(DTDIDは1)
の場合: −"患者"=00030000、"pID"=00030001、"疾患記録"=00
040000 ・DTDオブジェクトY(DTDIDは2)の場合: −"患者"=00040000、"pID"=00040001、"疾患記録"=00
050000 ・"患者"と"pID"のIDの上位2バイトが同じ値であ
ることから、属性"pID"は、要素"患者"の属性である
ことが分かる。
DTD object X (DTDID is 1)
For:-"Patient" = 00030000, "pID" = 00030001, "Disease Record" = 00
040000-For DTD object Y (DTDID is 2):-"Patient" = 00040000, "pID" = 00040001, "Disease record" = 00
050000-Since the upper 2 bytes of the ID of "patient" and "pID" have the same value, it can be seen that the attribute "pID" is the attribute of the element "patient".

【0266】c)文書フォルダオブジェクトが保有する
要素−属性インデックスにおいて、(DTDID、"pI
D"の属性名ID)と、属性値が1000以上という条件を満
たすデータを、図27に示した検索探索の手順に従って
検索する。
C) In the element-attribute index held by the document folder object, (DTDID, "pI
The data satisfying the condition that the attribute name ID of D ") and the attribute value is 1000 or more are searched according to the search search procedure shown in FIG.

【0267】このときの図27のステップS376の検索
条件は、「属性値が1000以上」となる。結果、以下のエ
ントリが返却される。
At this time, the search condition of step S376 of FIG. 27 is "attribute value is 1000 or more". As a result, the following entries are returned.

【0268】−(1、00030001、1200、1、20) −(1、00030001、1200、1、40) −(2、00040001、1500、3、40)-(1, 00030001, 1200, 1, 20) -(1, 00030001, 1200, 1, 40) -(2,00040001,1500,3,40)

【0269】すなわち、図33において、「○」を付け
た部分の要素が検索結果に該当する。「×」を付けた部
分は、属性値の条件である1000以上を満たさなかった要
素"患者"を表している。
That is, in FIG. 33, the elements marked with "○" correspond to the search results. The part marked with "x" represents the element "patient" that did not satisfy the attribute value condition of 1000 or more.

【0270】ステップ2.要素"患者"が要素"疾患記録"
の子孫要素であるかどうかのチェック: a)各データの文書IDから文書オブジェクトをロード
し、各文書オブジェクトの要素ツリーインデックスをロ
ードする。
Step 2. Element "patient" is element "disease record".
Check if it is a descendant element of: a) Load the document object from the document ID of each data, and load the element tree index of each document object.

【0271】図34は、文書A(文書IDは1)の文書オ
ブジェクトの要素ツリーインデックスを示す、図35
は、文書C(文書IDは3)の文書オブジェクトの要素ツ
リーインデックスを示す図である。
FIG. 34 shows the element tree index of the document object of document A (document ID is 1).
FIG. 9 is a diagram showing an element tree index of a document object of document C (document ID is 3).

【0272】これらの要素ツリーインデックスは、図9
に示した要素ツリーインデックス作成手順によってあら
かじめ作成されたものである。
These element tree indexes are shown in FIG.
It is created in advance by the element tree index creation procedure shown in.

【0273】b)図34、及び図35の要素ツリーイン
デックスを基に、ステップ1のc)で求めた属性"pID"
が1000以上の要素"患者"が、要素"疾患記録"の子孫要素
であるか否かを計算する。この計算処理が、文書の論理
構造に基づく検索に相当する。
B) Based on the element tree indexes of FIGS. 34 and 35, the attribute "pID" obtained in step 1c)
Calculates whether or not the element "patient" with 1000 or more is a descendant element of the element "disease record". This calculation process corresponds to the search based on the logical structure of the document.

【0274】この計算は、図16に示した子孫要素の取
出しによって、要素"疾患記録"の子孫要素にステップ1
のc)で求めた要素"患者"が存在するかチェックする。
This calculation is performed by extracting the descendant elements shown in FIG. 16 to the descendant elements of the element "disease record" in step 1
Check whether the element "patient" obtained in c) exists.

【0275】このチェックの方法は、要素ツリーインデ
ックスにおける三番目のデータ項目「要素開始位置」
と、要素−属性インデックスの五番目のデータ項目「要
素開始位置」の値は、同じ要素であるならば同じ値とな
ることから、要素"疾患記録"の子孫要素の「要素開始位
置」の中に、ステップ1のc)で求めた要素−属性インデ
ックスのエントリの「要素開始位置」の値が含まれてい
るかを調べることによって判定することができる。
This checking method is performed by the third data item "element start position" in the element tree index.
And the value of the fifth data item “element start position” of the element-attribute index is the same value if it is the same element, so in the “element start position” of the descendant element of the element “disease record” Can be determined by checking whether or not the value of the "element start position" of the entry of the element-attribute index obtained in step 1 c) is included.

【0276】以上の結果、以下のエントリが要素"疾患
記録"の子孫要素となる。
As a result of the above, the following entries become descendant elements of the element "disease record".

【0277】−(1、00030001、1200、1、40) −(2、00040001、1500、3、40)-(1, 00030001, 1200, 1, 40) -(2,00040001,1500,3,40)

【0278】すなわち、図36において、印「○」を付
けた部分の要素が最終的な検索結果に該当する。
That is, in FIG. 36, the element of the part marked with "○" corresponds to the final search result.

【0279】c)各文書IDの文書オブジェクトとその
要素開始位置から、検索結果である要素の中身を取出
し、返却する。
C) From the document object of each document ID and its element start position, the content of the element which is the search result is extracted and returned.

【0280】[0280]

【発明の効果】以上説明したように本発明によれば下記
記載の効果を奏する。
As described above, the present invention has the following effects.

【0281】本発明の第1の効果は、DTDが異なるな
どで構造の異なる複数の構造化文書の集合に対する検索
において、各文書の構造に基づく検索を正しく実行可能
としている、ということである。
The first effect of the present invention is that in the search for a set of a plurality of structured documents having different structures such as different DTDs, the search based on the structure of each document can be correctly executed.

【0282】従来より、一つの文書に対する構造に基づ
く検索は可能であり、また複数の文書に対する構造に基
づく検索では、例えば特開平10−240752号公報等に、複
数の文書の構造を代表させる構造インデックスを用いた
検索などが提案されているが、前述したように、上記特
開平10−240752号公報等に記載される方法では、前記構
造インデックスが、各文書の構造を必ずしも正しく代表
しているとは限らない、という問題点を有しており、前
記構造インデックスを用いて検索を行っても、各文書の
論理構造の条件を正しく反映した検索結果が返ってくる
保証は得られなかった。
Conventionally, it is possible to perform a structure-based search for one document, and for a structure-based search for a plurality of documents, for example, Japanese Patent Laid-Open No. 10-240752 discloses a structure that represents the structure of a plurality of documents. Although a search using an index has been proposed, as described above, in the method described in the above-mentioned Japanese Patent Laid-Open No. 10-240752, the structure index does not always correctly represent the structure of each document. However, even if a search is performed using the structure index, there is no guarantee that a search result that correctly reflects the logical structure condition of each document will be returned.

【0283】本発明によれば、文書の構造情報が記述さ
れるDTDを、各文書ごとにリンクして管理し、文書の
構造に基づく検索では、各文書ごとのDTDの情報を参
照することにより、各文書ごとの正しい論理構造に基づ
く検索を実現している。
According to the present invention, the DTD in which the document structure information is described is linked and managed for each document, and in the search based on the document structure, the DTD information for each document is referred to. , Realizes a search based on the correct logical structure of each document.

【0284】本発明の第2の効果は、前記構造に基づく
検索に利用するためのインデックスの作成方法および利
用法を提供することにより、その検索性能を向上する、
ということである。
The second effect of the present invention is to improve the search performance by providing a method of creating and using an index for use in the search based on the structure.
That's what it means.

【0285】文書の論理構造に基づく検索要求では、文
書の要素名や属性名を指定することが多い。要素名や属
性名は通常は文字列で表されるので、上記特開平6−131
340号公報記載の装置では、インデックスとして前記要
素名や属性名の文字列を直接扱っているが、インデック
スとして文字列を扱うことの問題点は、文字列は一般に
可変長であり、文書の要素に対して必要なインデックス
の容量をあらかじめ予測できないこと、そしてその文字
列が長大であった場合、その分だけインデックスの容量
を必要とする。
In a search request based on the logical structure of a document, the element name or attribute name of the document is often designated. Since element names and attribute names are usually represented by character strings, the above-mentioned JP-A-6-131
In the device described in Japanese Patent No. 340, a character string of the element name or the attribute name is directly handled as an index, but the problem of handling a character string as an index is that the character string is generally variable length, and the document element It is impossible to predict in advance the required index capacity, and if the character string is long, the index capacity is required accordingly.

【0286】本発明によれば、第一のインデックスとし
て、DTDクラスに要素−属性IDテーブルを備えてお
り、要素名や属性名はあるDTDの範囲で唯一に定めら
れることに着目し、各要素名、属性名に対応する要素名
ID、属性名IDを与えてその対応関係を要素−属性I
Dテーブルとして保持して管理したものであり、要素名
IDと属性名IDは数値として与えている。例えば32ビ
ット計算器におけるint型(整数型)のデータとして与
えた場合、要素名ID、属性名IDに必要な容量は固定
長で32ビットとなり、32ビットは半角文字に換算すると
4文字分であり、インデックスの省メモリ化を図ること
ができる。
According to the present invention, the DTD class is provided with an element-attribute ID table as the first index, and attention is paid to the fact that element names and attribute names are uniquely determined within a certain DTD range. Element-attribute I by giving the element name ID and the attribute name ID corresponding to the name and the attribute name
It is held and managed as a D table, and element name IDs and attribute name IDs are given as numerical values. For example, when given as int type (integer type) data in a 32-bit calculator, the capacity required for the element name ID and attribute name ID is a fixed length of 32 bits, and if 32 bits are converted to half-width characters
It's 4 characters long, so you can save memory of index.

【0287】インデックスを省メモリ化することは、よ
り多くの文書に関する情報を一度に計算機のメモリ上に
ロード可能にすることを意味し、結果として文書の検索
性能の向上につながる。
The memory saving of the index means that information on more documents can be loaded into the memory of the computer at one time, and as a result, the document search performance is improved.

【0288】第二のインデックスとして、要素ツリーイ
ンデックスを備え、要素ツリーインデックスは、各文書
における要素間の関係を表すインデックスであり、各要
素に対して(要素名ID、要素レベル、要素開始位置)の
三つ組のデータを与えてその文書の構造を管理する。要
素ツリーインデックスの各エントリに必要な容量は、各
項目とも数値で表すこととができるので、例えば32ビッ
ト計算器におけるint型のデータとして与えれば、一エ
ントリに対して96ビット、12バイトとなる。すなわち、
要素ツリーインデックスも省メモリなインデックスとい
える。
An element tree index is provided as a second index, and the element tree index is an index representing the relationship between elements in each document, and for each element (element name ID, element level, element start position). It manages the structure of the document by giving the triplet data of. Since the capacity required for each entry of the element tree index can be expressed numerically for each item, if given as int type data in a 32-bit calculator, 96 bits and 12 bytes are provided for each entry. . That is,
The element tree index is also a memory-saving index.

【0289】また要素ツリーインデックスを用いて、あ
る要素からの親要素、祖先要素、子要素、子孫要素、兄
要素、弟要素、前要素、次要素などの相対的な関係にあ
る要素の取出しを可能にするので、構造に基づく検索要
求に応えるためのインデックスとしては前記12バイト
の構造で必要十分な情報量といえる。
Also, by using the element tree index, extraction of a relative element such as a parent element, an ancestor element, a child element, a descendant element, a brother element, a brother element, a previous element, and a next element from a certain element. Since it is possible, it can be said that the 12-byte structure is a necessary and sufficient amount of information as an index for responding to a search request based on the structure.

【0290】本発明においては、第三のインデックスと
して、要素−属性インデックスを備えている。要素−属
性インデックスは、本発明の文書フォルダクラスのイン
デックスとして、複数の文書に対する要素や属性の情報
を保持するインデックスである。インデックスの構造
は、(DTDID、要素−属性名ID、属性値、文書I
D、要素開始位置)であり、二番目の項目「要素−属性
名ID」で要素名IDまたは属性名IDを用いており、
文字列をそのまま用いるよりはサイズを小さく抑え、ま
た固定長としている。
In the present invention, an element-attribute index is provided as the third index. The element-attribute index is an index that holds element and attribute information for a plurality of documents as an index of the document folder class of the present invention. The structure of the index is (DTDID, element-attribute name ID, attribute value, document I
D, element start position), and the element name ID or attribute name ID is used in the second item "element-attribute name ID",
The size is kept small and the length is fixed rather than using the character string as it is.

【0291】また、一番目の項目「DTDID」からD
TDオブジェクトの要素−属性IDテーブルを参照する
ことにより、各DTDで定義した要素名、属性名に基づ
いた検索条件の判定を可能としている。
Also, from the first item "DTDID" to D
By referring to the element-attribute ID table of the TD object, it is possible to determine the search condition based on the element name and attribute name defined in each DTD.

【0292】このように、DTDに関する情報との関係
をエントリ一つ一つに持たせたので、DTDが異なる複
数の文書を単一のインデックスで扱うことを可能として
いる。
As described above, since each entry has a relationship with the information regarding DTD, it is possible to handle a plurality of documents having different DTDs by a single index.

【0293】要素−属性インデックスの文書IDからは
文書オブジェクトを特定して、要素ツリーインデックス
を用いて構造に基づく条件判定を行ったり、要素開始位
置から即座に該当する要素を取出すことも可能としてい
る。
It is also possible to specify a document object from the document ID of the element-attribute index, perform condition determination based on the structure using the element tree index, and immediately extract the corresponding element from the element start position. .

【0294】要素−属性インデックスの各エントリにつ
いては、(DTDID、要素−属性名ID)でソートした
順序としている。
The entries of the element-attribute index are in the order sorted by (DTDID, element-attribute name ID).

【0295】これにより、(DTDID、要素−属性名
ID)を検索キーとした二分探索によるエントリの検索
を可能とし、より高速な目的の文書や要素の取出しを可
能としている。
As a result, it is possible to search for an entry by a binary search using (DTDID, element-attribute name ID) as a search key, and it is possible to retrieve a target document or element at a higher speed.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の一実施の形態の構成を示す図である。FIG. 1 is a diagram showing a configuration of an embodiment of the present invention.

【図2】本発明の一実施の形態におけるデータベースの
スキーマに関するクラスを示す図である。
FIG. 2 is a diagram showing classes related to a database schema according to the embodiment of the present invention.

【図3】本発明の一実施の形態における文書のインスタ
ンスとDTDのインスタンスの間のリンク関係の例を示
す図である。
FIG. 3 is a diagram showing an example of a link relationship between a document instance and a DTD instance according to an embodiment of the present invention.

【図4】本発明の一実施の形態における文書フォルダオ
ブジェクトの木構造に基づく分類階層の一例を示す図で
ある。
FIG. 4 is a diagram showing an example of a classification hierarchy based on a tree structure of a document folder object according to the embodiment of the present invention.

【図5】本発明の一実施の形態における、単一のDTD
の範囲における要素名IDの一意な割り振り方法の一例
を示す図である。
FIG. 5 is a single DTD according to an embodiment of the present invention.
It is a figure which shows an example of the unique allocation method of element name ID in the range of.

【図6】本発明の一実施の形態における単一のDTDの
範囲における属性名IDの一意な割り振り方法の一例を
示す図である。
FIG. 6 is a diagram showing an example of a unique allocation method of attribute name IDs within a single DTD range according to an embodiment of the present invention.

【図7】本発明の一実施の形態におけるDTDの一例を
示す図である。
FIG. 7 is a diagram showing an example of a DTD according to an embodiment of the present invention.

【図8】図7のDTDに対して割り振った要素名IDと
属性名IDを保持する要素−属性IDテーブルを示す図
である。
8 is a diagram showing an element-attribute ID table holding an element name ID and an attribute name ID assigned to the DTD of FIG. 7. FIG.

【図9】本発明の一実施の形態における要素ツリーイン
デックスの作成手順を示す流れ図である。
FIG. 9 is a flowchart showing a procedure for creating an element tree index according to the embodiment of the present invention.

【図10】本発明の一実施の形態における文書の一例を
示す図である。
FIG. 10 is a diagram showing an example of a document according to the embodiment of the present invention.

【図11】図10の文書の要素に関する木構造表記を示
す図である。
11 is a diagram showing a tree structure notation for elements of the document of FIG.

【図12】図10の文書に対する要素ツリーインデック
スを示す図である。
12 is a diagram showing an element tree index for the document of FIG.

【図13】本発明の一実施の形態における親要素の取出
し手順を示す流れ図である。
FIG. 13 is a flowchart showing a procedure for extracting a parent element according to the embodiment of the present invention.

【図14】本発明の一実施の形態における祖先要素の取
出し手順を示す流れ図である。
FIG. 14 is a flowchart showing a procedure for extracting an ancestor element in the embodiment of the present invention.

【図15】本発明の一実施の形態における子要素の取出
し手順を示す流れ図である。
FIG. 15 is a flowchart showing a procedure for taking out child elements according to the embodiment of the present invention.

【図16】本発明の一実施の形態における子孫要素の取
出し手順を示す流れ図である。
FIG. 16 is a flowchart showing a procedure for extracting a descendant element according to the embodiment of the present invention.

【図17】本発明の一実施の形態における兄要素の取出
し手順を示す流れ図である。
FIG. 17 is a flowchart showing a procedure for taking out a brother element in the embodiment of the present invention.

【図18】本発明の一実施の形態における弟要素の取出
し手順を示す流れ図である。
FIG. 18 is a flowchart showing a procedure for taking out the younger brother element in the embodiment of the present invention.

【図19】本発明の一実施の形態における末弟要素の取
出し手順を示す流れ図である。
FIG. 19 is a flowchart showing a procedure for taking out the youngest brother element in the embodiment of the present invention.

【図20】本発明の一実施の形態における右深さ優先順
序での子孫要素の取出し手順を示す流れ図である。
FIG. 20 is a flowchart showing a procedure for extracting descendant elements in the right depth priority order according to the embodiment of the present invention.

【図21】本発明の一実施の形態における前要素の取出
し手順を示す流れ図である。
FIG. 21 is a flowchart showing a procedure for taking out the front element according to the embodiment of the present invention.

【図22】本発明の一実施の形態における次要素の取出
し手順を示す流れ図である。
FIG. 22 is a flowchart showing a procedure for taking out a next element according to the embodiment of the present invention.

【図23】本発明の一実施の形態における要素−属性イ
ンデックスの作成手順を示す流れ図(その1)である。
FIG. 23 is a flowchart (part 1) showing a procedure for creating an element-attribute index in the embodiment of the present invention.

【図24】本発明の一実施の形態における要素−属性イ
ンデックスの作成手順を示す流れ図(その2)である。
FIG. 24 is a flowchart (part 2) showing the procedure for creating an element-attribute index according to the embodiment of the present invention.

【図25】本発明の一実施の形態における要素−属性イ
ンデックスにおける、エントリの挿入位置を求める手順
を示す流れ図である。
FIG. 25 is a flowchart showing a procedure for obtaining an entry insertion position in the element-attribute index according to the embodiment of the present invention.

【図26】本発明の一実施の形態におけるリスト上のデ
ータに対する目的のデータの取出し手順、およびデータ
の挿入位置の計算手順を示す流れ図である。
FIG. 26 is a flow chart showing a procedure for extracting target data from data on a list and a procedure for calculating a data insertion position according to an embodiment of the present invention.

【図27】本発明の一実施の形態における要素−属性イ
ンデックスにおける、エントリの検索手順を示す流れ図
である。
FIG. 27 is a flowchart showing an entry search procedure in the element-attribute index according to the embodiment of the present invention.

【図28】本発明の一実施例における文書フォルダ、文
書、DTDの各オブジェクトの関係の例を示すインスタ
ンスを示す図である。
FIG. 28 is a diagram showing an instance showing an example of a relationship between each object of a document folder, a document, and a DTD according to an embodiment of the present invention.

【図29】本発明の一実施例における文書オブジェクト
A、B、Cを示す図である。
FIG. 29 is a document object according to an embodiment of the present invention.
It is a figure which shows A, B, and C.

【図30】本発明の一実施例におけるDTDオブジェク
トXの要素−属性IDテーブルを示す図である。
FIG. 30 is a diagram showing an element-attribute ID table of a DTD object X according to an embodiment of the present invention.

【図31】本発明の一実施例におけるDTDオブジェク
トYの要素−属性IDテーブルを示す図である。
FIG. 31 is a diagram showing an element-attribute ID table of a DTD object Y according to an embodiment of the present invention.

【図32】本発明の一実施例における要素−属性インデ
ックスを示す図である。
FIG. 32 is a diagram showing an element-attribute index according to an embodiment of the present invention.

【図33】本発明の一実施例における属性"pID"の値
が1000以上の要素"患者"の検索結果を示す図である。
FIG. 33 is a diagram showing a search result of an element “patient” having an attribute “pID” value of 1000 or more in one embodiment of the present invention.

【図34】本発明の一実施例における文書オブジェクト
Aの要素ツリーインデックスを示す図である。
FIG. 34 is a document object according to an embodiment of the present invention.
It is a figure which shows the element tree index of A.

【図35】本発明の一実施例における文書オブジェクト
Cの要素ツリーインデックスを示す図である。
FIG. 35 is a document object according to an embodiment of the present invention.
It is a figure which shows the element tree index of C.

【図36】本発明の一実施例における要素"疾患記録"の
子孫要素である要素"患者"の検索結果を示す図である。
FIG. 36 is a diagram showing a search result of an element “patient” which is a descendant element of the element “disease record” in one example of the present invention.

【符号の説明】[Explanation of symbols]

1 データベース 11 文書 12 文書フォルダ 13 DTD 14 要素ツリーインデックス 15 要素−属性インデックス 16 要素−属性IDテーブル 21 文書検索実行部 211 要素ツリーインデックス作成部 212 要素−属性インデックス 213 要素−属性IDテーブル作成部 22 検索実行部 111、112、113 文書 131、132 DTD 121〜126 文書フォルダ 1 database 11 documents 12 document folders 13 DTD 14 element tree index 15 element-attribute index 16 elements-attribute ID table 21 Document Search Execution Unit 211 Element tree index creation part 212 element-attribute index 213 element-attribute ID table creation unit 22 Search execution unit 111, 112, 113 documents 131, 132 DTD 121-126 Document Folder

───────────────────────────────────────────────────── フロントページの続き (51)Int.Cl.7 識別記号 FI G06F 12/00 546 G06F 12/00 546T (56)参考文献 北野拓哉,波内みさ,半構造化データ モデルに基づくXML文書の格納と検索 及びその実装方法,情報処理学会研究報 告(99−DBS−117),1999年 1月 23日,Vol.99,No.6,p.31− 38 北野拓哉,波内みさ,半構造化データ モデルを利用したXML文書管理システ ムの試作,情報処理学会第57回(平成10 年後期)全国大会講演論文集(3), 1998年10月 5日,p.283−284 (58)調査した分野(Int.Cl.7,DB名) G06F 17/28 - 17/30 G06F 12/00 ─────────────────────────────────────────────────── ─── Continuation of front page (51) Int.Cl. 7 Identification code FI G06F 12/00 546 G06F 12/00 546T (56) References Takuya Kitano, Misa Namiuchi, XML document based on semi-structured data model Storage and retrieval and its implementation method, IPSJ Research Report (99-DBS-117), January 23, 1999, Vol. 99, No. 6, p. 31- 38 Takuya Kitano, Misa Namiuchi, Prototype of XML document management system using semi-structured data model, Proc. Of the 57th National Conference of Information Processing Society of Japan (Late 1998) (3), 1998 10 5th p.m. 283-284 (58) Fields investigated (Int.Cl. 7 , DB name) G06F 17/28-17/30 G06F 12/00

Claims (11)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】構造化文書を格納するデータベースと、 入力された構造化文書を解析して前記データベースに格
納する文書格納実行手段と、 前記データベースから文書を検索し検索結果を出力手段
に出力する検索手段と、 を備え、 前記データベースが、スキーマのクラスとして、 文書を管理する文書クラスと、 前記文書のDTD(Document Type Definition;文書
型定義)を管理するDTDクラスと、 前記文書とDTDの集合を管理する文書フォルダクラス
と、 を有し、 第1のインデックスとして、前記文書クラスには、文書
の要素の木構造関係を表す要素ツリーインデックスを備
え、 第2のインデックスとして、前記文書フォルダクラスに
は、文書の要素ごと属性ごとにインデックスを管理する
ための要素−属性インデックスを備え、 第3のインデックスとして、前記DTDクラスには、要
素名と属性名をIDとして管理するための要素−属性I
Dテーブルであって、文書における要素の要素名、及び
属性名にそれぞれ対応する、数値よりなる要素名ID、
属性名IDを有する要素−属性IDテーブルを備え、前記文書格納実行手段 が、前記データベースの前記要素−属性IDテーブルの各要
素IDを用いて各文書ごとに 前記要素ツリーインデック
スを作成する手段と、入力した前記構造化文書のDTD内で定義される要素名
と属性名に対してそれぞれ要素名ID及び属性名IDを
与え、 前記要素−属性IDテーブルを作成する手段と、入力した前記構造化文書に対する要素や属性の情報を保
持するインデックスをなす 前記要素−属性インデックス
を作成する手段を備え、 入力した前記構造化文書を、前記要素ツリーインデック
スと、前記要素−属性IDテーブルと、前記要素−属性
インデックスを用いて、論理構造に基づいた形で、前記
データベースに格納し、 前記データベースから文書を検索する前記検索手段が、
入力された検索要求に対して、前記文書の論理構造に基
づき検索を行うにあたり、 前記要素ツリーインデックス、 前記要素−属性IDテーブル、 前記要素−属性インデックスを用いて対象となる構造化
文書を検索し検索結果を前記出力手段に出力する、こと
を特徴とする構造化文書管理装置。
1. A database for storing a structured document, and a structured document that has been input is analyzed and stored in the database.
Document storing and executing means for storing, and means for searching documents from the database and outputting search results
And a search means for outputting to the database, as a class in the schema, the document class that manages a document, the document of DTD; and DTD class that manages the (Document Type Definition document type definition), and the document A document folder class for managing a set of DTDs, and a document tree class representing a tree structure relationship of document elements in the document class as a first index, and the document as a second index. Folder class manages index for each element of document and attribute
Element for - with the attribute index, as a third index, the said DTD class, elements for managing the element and attribute names as ID - attribute I
D table, which is a numerical element name ID corresponding to the element name and the attribute name of the element in the document,
An element-attribute ID table having an attribute name ID is provided, and the document storage executing means is provided for each element-attribute ID table of the database.
A means for creating the element tree index for each document using a prime ID, and an element name defined in the DTD of the input structured document
And element name ID and attribute name ID respectively
And means for creating the element-attribute ID table, and storing the element and attribute information for the input structured document.
A means for creating the element-attribute index forming an index to be held is provided, and the input structured document is stored in the element tree index.
And the element-attribute ID table, and the element-attribute
Using an index, in the form based on the logical structure,
Said retrieval means and stored in the database and retrieves the document from the database,
When performing a search for the input search request based on the logical structure of the document, the target structuring is performed using the element tree index, the element-attribute ID table, and the element-attribute index .
A structured document management device characterized by searching a document and outputting the search result to the output means .
【請求項2】前記検索手段が、文書要素の取出しに際し
て、構造化文書中のある文書要素からの階層的な関係と
して、前記文書要素に対する親要素、祖先要素、子要
素、子孫要素、兄要素、弟要素、前要素、次要素のうち
のいずれか又はこれらの組合せで取出しを行う、ことを
特徴とする請求項記載の構造化文書管理装置。
2. The retrieval unit extracts a document element as a hierarchical relationship from a certain document element in a structured document, and shows a parent element, an ancestor element, a child element, a descendant element, and an older element for the document element. brother element before the element, taken out in either or a combination of the following elements, a structured document management apparatus according to claim 1, wherein a.
【請求項3】前記検索手段が、文書やその要素の検索に
あたり、DTDが異なるなど論理構造が互いに異なる複
数の構造化文書に対する検索を行う、ことを特徴とする
請求項記載の構造化文書管理装置。
Wherein said retrieval means, documents and Upon retrieval of the element, DTD performs a search for a plurality of structured documents logical structure are different from each other, such as different structured document according to claim 1, wherein the Management device.
【請求項4】前記要素ツリーインデックスを作成する手
段は、各文書における要素間の関係を表すインデックス
をなし、前記インデックスの構造が、前記各要素に対し
て、(要素名ID、前記要素を木構造で表したときのル
ート要素からの深さを表す要素レベル、要素の開始位
置)の三つ組の項目データを備えている前記要素ツリー
インデックスを作成し、前記データベースに格納する、
ことを特徴とする請求項記載の構造化文書管理装置。
4. A method for creating the element tree index.
The column is an index representing the relationship between elements in each document , and the structure of the index is such that for each element (element name ID, depth from the root element when the element is represented by a tree structure). The element tree having three sets of item data (element level indicating the
Create an index and store it in the database,
The structured document management device according to claim 1, wherein
【請求項5】前記要素−属性インデックスを作成する手
段は、複数の文書に対する要素や属性の情報を保持する
インデックスをなし、(DTDID、要素−属性名I
D、属性値、文書ID、要素開始位置)の五つ組よりな
前記要素−属性インデックスを作成し、前記データベ
ースに格納する、ことを特徴とする請求項記載の構造
化文書管理装置。
5. A method for creating the element-attribute index.
A column is an index that holds information on elements and attributes for a plurality of documents, and includes (DTDID, element-attribute name I
D, attribute value, the document ID, said element consisting of five sets of elements starting position) - Creates an attribute index, the database
The structured document management apparatus according to claim 1 , wherein the structured document management apparatus stores the structured document management apparatus.
【請求項6】前記要素−属性IDテーブルを作成する手
段は、要素名IDと要素名の対応、属性名IDと属性名
の対応を備えた要素−属性IDテーブルを作成するにあ
たり、 前記DTD内で定義される各要素名に対して唯一となる
ような要素名IDが数値として与えられ、前記要素名と
要素名IDとの対応関係をテーブルとして作成し、前記
テーブルが、前記DTDクラスのインスタンスであるオ
ブジェクトと一対一の関係で、前記要素−属性IDテー
ブルのインスタンスとして前記データベースに格納、 属性名についても、DTDオブジェクト内の要素に対し
て唯一であり、かつ互いに異なる要素名の間で同じ属性
名が存在する場合でもこれらを識別できるような属性名
IDが数値として与えられ、前記属性名と属性名IDと
の対応関係をテーブルとして作成し前記テーブルが前記
要素−属性IDテーブルのインスタンスとして前記デー
タベースに格納する、ことを特徴とする請求項記載の
構造化文書管理装置。
6. A procedure for creating the element-attribute ID table.
The stage is for creating an element-attribute ID table having correspondence between element name ID and element name and correspondence between attribute name ID and attribute name.
Or, wherein only become such element name ID for each element name defined in the DTD is given as a number, to create a correspondence between the element name and the element name ID as a table, the table, It is stored in the database as an instance of the element-attribute ID table in a one-to-one relationship with an object that is an instance of the DTD class, and the attribute name is unique to the element in the DTD object and different from each other. Even if the same attribute name exists between element names, an attribute name ID that can identify them is given as a numerical value, and the correspondence relationship between the attribute name and the attribute name ID is created as a table, and the table stores the element- The structured document according to claim 1 , wherein the structured document is stored in the database as an instance of an attribute ID table. Management device.
【請求項7】データベースのスキーマとして、文書を管
理する文書クラスと、 前記文書のDTD(Document Type Definition;文書
型定義)を管理するDTDクラスと、 前記文書とDTDの集合を管理する文書フォルダクラス
と、 を有し、 第1のインデックスとして、前記文書クラスには、文書
の要素の木構造関係を表す要素ツリーインデックスを備
え、 第2のインデックスとして、前記文書フォルダクラスに
は、複数の文書に対する要素や属性の情報を保持するイ
ンデックスをなし、(DTDID、要素−属性名ID、
属性値、文書ID、要素開始位置)の五つ組よりなる要
素−属性インデックスを備え、 第3のインデックスとして、前記DTDクラスには、要
素名と属性名をIDとして管理するための要素−属性I
Dテーブルであって、文書における要素の要素名、及び
属性名にそれぞれ対応する、数値よりなる要素名ID、
属性名IDを有する要素−属性IDテーブルを有するデ
ータベースを備えた構造化文書管理装置が、入力された
文書を前記データベース格納する際、 (a)前記要素−属性IDテーブルを作成するにあた
り、入力された前記文書の前記DTDで定義される各要
素名に対して唯一となるような要素名IDを数値として
与え、前記要素名と要素名IDとの対応関係をテーブル
として作成し、前記作成した前記テーブルを、前記DT
Dクラスのインスタンスであるオブジェクトと一対一の
関係で要素−属性IDテーブルのインスタンスとして前
記データベースに格納し、属性名についても、DTDオ
ブジェクト内の要素に対して唯一であり、かつ互いに異
なる要素名の間で同じ属性名が存在する場合でもこれら
を識別できるような属性名IDに数値を与え、前記属性
名と属性名IDとの対応関係をテーブルとして作成し、
前記作成したテーブルを前記要素−属性IDテーブルの
インスタンスとして、前記データベースに格納するステ
ップと、 (b)前記要素ツリーインデックスを作成するにあた
り、入力された前記文書の要素の開始タグの最初の文字
位置、終了タグの最後の文字位置を求め、要素開始位置
として開始タグの中の要素名を求め、前記文書の文書オ
ブジェクトと関係するDTDオブジェクトから要素−属
性IDテーブルを取り出して、前記要素の要素名IDを
求め、つづいて、前記要素を木構造で表したときのルー
ト要素からの深さを表す要素レベルを求め、(要素名I
D、要素レベル、要素開始位置)の三つ組よりなるエン
トリを追加し、作成した前記要素 ツリーインデックスを
前記データベースに格納するステップと、 (c)前記要素−属性インデックスを作成するにあた
り、前記五つ組みのデータ構造(DTDID、要素−属
性名ID、属性値、文書ID、要素開始位置)の各項目
の値を求め、DTDID、要素−属性名ID値でソート
した順序を保ちながら、前記要素−属性インデックスの
リストに作成したエントリを追加し、作成した前記要素
−属性インデックスを前記データベースに格納するステ
ップと、を含み、入力された検索要求に対して、 前記データベースから前
記文書の論理構造に基づき検索を行うに際して、前記要
素ツリーインデックス、前記要素−属性IDテーブル、
前記要素−属性インデックスを用いて対象となる構造化
文書を検索し、検索結果を出力手段から出力するステッ
プを含む、ことを特徴とする構造化文書管理方法。
7. A schema of a database, a document class for managing documents, a DTD class for managing DTD (Document Type Definition) of the documents, and a document folder class for managing a set of the documents and DTDs. And, as a first index, the document class is provided with an element tree index representing a tree structure relationship of elements of the document, and as a second index, the document folder class is provided for a plurality of documents. It is an index that holds information on elements and attributes, (DTDID, element-attribute name ID,
Attribute value, document ID, ing than five sets of elements starting position) is needed
An element-attribute I for managing element names and attribute names as IDs is provided in the DTD class as a third index.
D table, which is a numerical element name ID corresponding to the element name and the attribute name of the element in the document,
Element having an attribute name ID - structured document management apparatus comprises a database having the attribute ID table, when storing the input <br/> documents in the database, said element (a) - Create an attribute ID table In doing so, an element name ID that is unique to each element name defined in the DTD of the input document is given as a numerical value, and a correspondence relationship between the element name and the element name ID is created as a table. , The created table, the DT
It is stored in the database as an instance of an element-attribute ID table in a one-to-one relationship with an object that is an instance of D class, and the attribute names are unique to the elements in the DTD object and different from each other. Numerical values are given to the attribute name IDs so that they can be identified even if the same attribute name exists between them, and the correspondence relationship between the attribute name and the attribute name ID is created as a table,
Storing the created table in the database as an instance of the element-attribute ID table, and (b) in creating the element tree index, the first character position of the start tag of the element of the input document. , The last character position of the end tag, the element name in the start tag as the element start position, the element-attribute ID table is retrieved from the DTD object related to the document object of the document, and the element name of the element Next, the ID is calculated, and then the element level indicating the depth from the root element when the element is represented by a tree structure is calculated.
D, element level, element start position) is added, and the created element tree index is added.
(C) Each item of the data structure (DTDID, element-attribute name ID, attribute value, document ID, element start position) of the quintuplet for storing the element-attribute index Value is calculated, the created entry is added to the list of the element-attribute index while maintaining the order sorted by DTDID and the element-attribute name ID value, and the created element is added.
A step of storing an attribute index in the database, the element tree index for performing a search based on the logical structure of the document from the database in response to an input search request , The element-attribute ID table,
Targeted structuring using the element-attribute index
A structured document management method comprising the steps of searching a document and outputting the search result from an output means .
【請求項8】前記データベースから前記文書の論理構造
に基づき検索を行うに際して、前記要素ツリーインデッ
クスを用いて、ある要素から相対的な関係にある要素と
して、親要素、祖先要素、子要素、子孫要素、兄要素、
弟要素、前要素、次要素のうちいずれか又はこれらの組
合せで取出す、ことを特徴とする請求項記載の構造化
文書管理方法。
8. A parent element, an ancestor element, a child element, or a descendant as an element having a relative relationship with a certain element using the element tree index when performing a search from the database based on the logical structure of the document. Element, brother element,
The structured document management method according to claim 7 , wherein any one of a younger brother element, a previous element, a next element, or a combination thereof is taken out.
【請求項9】前記要素−属性インデックスを作成するに
あたり、文書フォルダクラスのインスタンスをなすオブ
ジェクトに、文書オブジェクトを追加した際に、前記文
書オブジェクトと関係するDTDオブジェクトも同時に
追加し、前記追加した文書オブジェクトの各要素に対す
る要素−属性インデックスのエントリを作成して追加
し、文書の要素の開始タグを探し、開始タグの最初の文
字位置と開始タグの要素名を求め、前記文書オブジェク
トと関係するDTDオブジェクトと1対1の関係を持つ
要素−属性IDテーブルから前記要素名に対応する要素
IDを求め、 前記開始タグの中の属性を求め属性がない場合、 (DTDID、要素名ID)で要素−属性インデックス
に対する挿入位置を求め、該挿入位置に、(DTDI
D、要素−属性名ID、ヌル、文書ID、要素開始位
置)のエントリを追加し、 前記開始タグの中に属性がある場合、前記属性の属性値
について要素−属性IDテーブルから前記属性名に対応
する属性IDを求め、 (DTDID、属性名ID)で要素−属性インデックス
に対する挿入位置を求め、該挿入位置に、(DTDI
D、要素−属性名ID、ヌル、文書ID、要素開始位
置)のエントリを追加することを特徴とする請求項
載の構造化文書管理方法。
9. When creating the element-attribute index, when a document object is added to an object that is an instance of a document folder class, a DTD object related to the document object is also added at the same time, and the added document is added. Create and add an entry for the element-attribute index for each element of the object, find the start tag of the element of the document, find the first character position of the start tag and the element name of the start tag, DTD associated with the document object An element having a one-to-one relationship with an object-an element ID corresponding to the element name is obtained from an attribute ID table, an attribute in the start tag is obtained, and if there is no attribute, the element is (DTDID, element name ID)- The insertion position for the attribute index is obtained, and (DTDI
D, element-attribute name ID, null, document ID, element start position) is added, and if there is an attribute in the start tag, the attribute value of the attribute is changed from the element-attribute ID table to the attribute name. The corresponding attribute ID is obtained, the insertion position with respect to the element-attribute index is obtained by (DTDID, attribute name ID), and the (DTDI
8. The structured document management method according to claim 7 , wherein an entry of D, element-attribute name ID, null, document ID, element start position) is added.
【請求項10】文書やその要素の検索にあたり、DTD
が異なるなど論理構造が互いに異なる複数の構造化文書
に対する検索を行う、ことを特徴とする請求項記載の
構造化文書管理方法。
10. A DTD is used for searching a document and its elements.
8. The structured document management method according to claim 7 , wherein a search is performed for a plurality of structured documents having different logical structures such as different.
【請求項11】データベースのスキーマとして、文書を
管理する文書クラスと、 前記文書のDTD(Document Type Definition;文書
型定義)を管理するDTDクラスと、 前記文書とDTDの集合を管理する文書フォルダクラス
と、 を有し、 第1のインデックスとして、前記文書クラスには、文書
の要素の木構造関係を表す要素ツリーインデックスを備
え、 第2のインデックスとして、前記文書フォルダクラスに
は、前記要素−属性インデックスが、複数の文書に対す
る要素や属性の情報を保持するインデックスをなし、
(DTDID、要素−属性名ID、属性値、文書ID、
要素開始位置)の五つ組よりなる要素−属性インデック
スを備え、 第3のインデックスとして、前記DTDクラスには、要
素名と属性名をIDとして管理するための要素−属性I
Dテーブルであって、文書における要素の要素名、及び
属性名にそれぞれ対応する、数値よりなる要素名ID、
属性名IDを有する要素−属性IDテーブルを有するデ
ータベースを備えた構造化文書管理装置において、入力された 文書を前記データベース格納するにあた
り、 (a)前記DTDで定義される各要素名に対して唯一と
なるような要素名IDを数値として与え、前記要素名と
要素名IDとの対応関係をテーブルとして作成し、前記
作成した前記テーブルを、前記DTDクラスのインスタ
ンスであるオブジェクトと一対一の関係で要素−属性I
Dテーブルのインスタンスとして前記データベースに格
納し、属性名についても、DTDオブジェクト内の要素
に対して唯一であり、かつ互いに異なる要素名の間で同
じ属性名が存在する場合でもこれらを識別できるような
属性名IDに数値を与え、前記属性名と属性名IDとの
対応関係をテーブルとして作成し、前記作成したテーブ
ルを前記要素−属性IDテーブルのインスタンスとし
て、前記データベースに格納する、要素−属性インデッ
クスの作成処理と、 (b)文書の要素の開始タグの最初の文字位置、終了タ
グの最後の文字位置を求め、要素開始位置として開始タ
グの中の要素名を求め、前記文書の文書オブジェクトと
関係するDTDオブジェクトから要素−属性IDテーブ
ルを取り出して、前記要素の要素名IDを求め、つづい
て、前記要素を木構造で表したときのルート要素からの
深さを表す要素レベルを求め、(要素名ID、要素レベ
ル、要素開始位置)の三つ組よりなるエントリを追
る、要素ツリーインデックスの作成処理と、 (c)文書フォルダクラスのインスタンスをなすオブジ
ェクトに、文書オブジェクトを追加した際に、前記文書
オブジェクトと関係するDTDオブジェクトも同時に追
加し、前記追加した文書オブジェクトの各要素に対する
要素−属性インデックスのエントリを作成して追加し、
文書の要素の開始タグを探し、開始タグの最初の文字位
置と開始タグの要素名を求め、前記文書オブジェクトと
関係するDTDオブジェクトと1対1の関係を持つ要素
−属性IDテーブルから前記要素名に対応する要素ID
を求め、 前記開始タグの中の属性を求め属性がない場合、 (DTDID、要素名ID)で要素−属性インデックス
に対する挿入位置を求め、該挿入位置に、(DTDI
D、要素−属性名ID、ヌル、文書ID、要素開始位
置)のエントリを追加し、 前記開始タグの中に属性がある場合、前記属性の属性値
について要素−属性IDテーブルから前記属性名に対応
する属性IDを求め、 (DTDID、属性名ID)で要素−属性インデックス
に対する挿入位置を求め、該挿入位置に、(DTDI
D、要素−属性名ID、ヌル、文書ID、要素開始位
置)のエントリを追加する、要素−属性インデックス作
成処理、及び、 (d)入力された検索要求に対して、前記データベース
から前記文書の論理構造に基づき検索を行うにあたり、
前記要素ツリーインデックス、前記要素−属性IDテー
ブル、前記要素−属性インデックスを用いて対象となる
構造化文書を検索し、その際、前記要素ツリーインデッ
クスを用いてある要素から相対的な関係にある要素とし
て、親要素、祖先要素、子要素、子孫要素、兄要素、弟
要素、前要素、次要素のうちいずれか又はこれらの組合
せで取出し、検索結果を出力手段に出力する処理、 の前記(a)乃至(d)の処理を前記構造化文書管理装
置を構成するコンピュータで実行させるためのプログラ
ムを記録したコンピュータで読み出し可能な記録媒体。
11. A schema of a database, a document class for managing a document, a DTD class for managing a DTD (Document Type Definition) of the document, and a document folder class for managing a set of the document and the DTD. And, as the first index, the document class is provided with an element tree index representing the tree structure relationship of the elements of the document, and as the second index, the document folder class is provided with the element-attribute. The index is an index that holds information on elements and attributes for multiple documents,
(DTDID, element-attribute name ID, attribute value, document ID,
Five sets than ing elements of the element starting position) - attribute index
As a third index, the DTD class has an element-attribute I for managing element names and attribute names as IDs.
D table, which is a numerical element name ID corresponding to the element name and the attribute name of the element in the document,
Element having attribute name ID-In a structured document management device provided with a database having an attribute ID table, in storing an input document in the database, (a) for each element name defined in the DTD A unique element name ID is given as a numerical value, a correspondence relationship between the element name and the element name ID is created as a table, and the created table is in a one-to-one relationship with an object that is an instance of the DTD class. And element-attribute I
Stored in the database as an instance of the D table, the attribute names are unique to the elements in the DTD object, and even if the same attribute name exists between different element names, these can be identified. An element-attribute index in which a numerical value is given to the attribute name ID, a correspondence relationship between the attribute name and the attribute name ID is created as a table, and the created table is stored in the database as an instance of the element-attribute ID table. (B) The first character position of the start tag and the last character position of the end tag of the document element are obtained, the element name in the start tag is obtained as the element start position, and the document object of the document is obtained. The element-attribute ID table is taken out from the related DTD object, the element name ID of the element is obtained, and then continued. Te, the element obtains a element level which represents the depth from the root element when expressed in a tree structure, (element name ID, element level, element start position) add to <br/> entries consisting triples (C) When a document object is added to an object that is an instance of the document folder class, a DTD object related to the document object is also added at the same time, and the element tree index is created. Create and add an element-attribute index entry for each element,
The start tag of the document element is searched for, the first character position of the start tag and the element name of the start tag are obtained, and the element name is obtained from the element-attribute ID table having a one-to-one relationship with the DTD object related to the document object. Element ID corresponding to
If there is no attribute in the start tag, the insertion position for the element-attribute index is calculated by (DTDID, element name ID), and the insertion position is set to (DTDI
D, element-attribute name ID, null, document ID, element start position) is added, and if there is an attribute in the start tag, the attribute value of the attribute is changed from the element-attribute ID table to the attribute name. The corresponding attribute ID is obtained, the insertion position with respect to the element-attribute index is obtained by (DTDID, attribute name ID), and the (DTDI
D, element-attribute name ID, null, document ID, element start position), element-attribute index creation processing, and (d) in response to the input search request When conducting a search based on the logical structure,
Target using the element tree index, the element-attribute ID table, and the element-attribute index
A structured document is searched, and at that time, as elements having a relative relationship from a certain element using the element tree index, a parent element, an ancestor element, a child element, a descendant element, an older brother element, a younger brother element, a previous element, A process for extracting any one of the following elements or a combination thereof and outputting the search result to the output means; and causing the computer constituting the structured document management device to execute the processes (a) to (d) above. A computer-readable recording medium in which a program is recorded.
JP14115399A 1999-05-21 1999-05-21 Structured document management system and method, and recording medium Expired - Fee Related JP3508623B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP14115399A JP3508623B2 (en) 1999-05-21 1999-05-21 Structured document management system and method, and recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP14115399A JP3508623B2 (en) 1999-05-21 1999-05-21 Structured document management system and method, and recording medium

Publications (2)

Publication Number Publication Date
JP2000331021A JP2000331021A (en) 2000-11-30
JP3508623B2 true JP3508623B2 (en) 2004-03-22

Family

ID=15285376

Family Applications (1)

Application Number Title Priority Date Filing Date
JP14115399A Expired - Fee Related JP3508623B2 (en) 1999-05-21 1999-05-21 Structured document management system and method, and recording medium

Country Status (1)

Country Link
JP (1) JP3508623B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3560043B2 (en) * 2002-11-25 2004-09-02 株式会社セック XML data storage method and storage device, program and recording medium storing program
EP1645961A4 (en) * 2003-07-10 2006-09-27 Fujitsu Ltd Structured document processing method, device, and storage medium
US20050138542A1 (en) * 2003-12-18 2005-06-23 Roe Bryan Y. Efficient small footprint XML parsing

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
北野拓哉,波内みさ,半構造化データモデルに基づくXML文書の格納と検索及びその実装方法,情報処理学会研究報告(99−DBS−117),1999年 1月23日,Vol.99,No.6,p.31−38
北野拓哉,波内みさ,半構造化データモデルを利用したXML文書管理システムの試作,情報処理学会第57回(平成10年後期)全国大会講演論文集(3),1998年10月 5日,p.283−284

Also Published As

Publication number Publication date
JP2000331021A (en) 2000-11-30

Similar Documents

Publication Publication Date Title
US6442566B1 (en) Frame-based knowledge representation system and methods
US6510425B1 (en) Document search method for registering documents, generating a structure index with elements having position of occurrence in documents represented by meta-nodes
JP3842573B2 (en) Structured document search method, structured document management apparatus and program
US7072896B2 (en) System and method for automatic loading of an XML document defined by a document-type definition into a relational database including the generation of a relational schema therefor
US6105022A (en) Structured-text cataloging method, structured-text searching method, and portable medium used in the methods
US6738759B1 (en) System and method for performing similarity searching using pointer optimization
EP1764710A1 (en) Layout generation method, information processing device, and program
CA2385570A1 (en) System and method for performing similarity searching
US20020002566A1 (en) Transfromation of marked up documents using a base architecture
US7159171B2 (en) Structured document management system, structured document management method, search device and search method
JP3508623B2 (en) Structured document management system and method, and recording medium
Liu et al. A general multi-source data fusion framework
JP2003281149A (en) Method of setting access right and system of structured document management
Barbosa et al. Efficient incremental validation of XML documents after composite updates
JP3842576B2 (en) Structured document editing method and structured document editing system
JP3842572B2 (en) Structured document management method, structured document management apparatus and program
JP2002202973A (en) Structured document management device
Zhang et al. Odaies: ontology-driven adaptive Web information extraction system
JP2001331490A (en) Structured document storage device, structured document retrieval device, structured document storage and retrieval device and program and program recording medium
Koch et al. Representation of CityGML instance models in BaseX
JP3842574B2 (en) Information extraction method, structured document management apparatus and program
JP3842575B2 (en) Structured document search method, structured document management apparatus and program
Wang et al. Deriving relation keys from XML keys
Škrbić et al. Bibliographic records editor in XML native environment
Schilling et al. Standard-oriented ontology export of domain catalogues from data dictionaries

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20031202

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20031215

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

Free format text: PAYMENT UNTIL: 20080109

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090109

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100109

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110109

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20110109

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20120109

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20130109

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20130109

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees