JP5235545B2 - Schema conversion device, program, and schema generation method - Google Patents

Schema conversion device, program, and schema generation method Download PDF

Info

Publication number
JP5235545B2
JP5235545B2 JP2008188552A JP2008188552A JP5235545B2 JP 5235545 B2 JP5235545 B2 JP 5235545B2 JP 2008188552 A JP2008188552 A JP 2008188552A JP 2008188552 A JP2008188552 A JP 2008188552A JP 5235545 B2 JP5235545 B2 JP 5235545B2
Authority
JP
Japan
Prior art keywords
schema
constraint condition
restriction
sample data
declaration
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
JP2008188552A
Other languages
Japanese (ja)
Other versions
JP2010026857A (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.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2008188552A priority Critical patent/JP5235545B2/en
Publication of JP2010026857A publication Critical patent/JP2010026857A/en
Application granted granted Critical
Publication of JP5235545B2 publication Critical patent/JP5235545B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、スキーマ文書を生成する技術に関する。   The present invention relates to a technique for generating a schema document.

構造化文書を記述するための代表的な言語にXML(Extensible Markup Language)があり、XMLで記述された構造化文書をXML文書という。   XML (Extensible Markup Language) is a typical language for describing structured documents, and a structured document described in XML is called an XML document.

XML文書が満たすべき制約条件は、通常、スキーマ文書によって定義される。そして、XML文書がスキーマ文書で定義された制約条件を満たしていることを確認する処理を、スキーマ検証という。スキーマ検証において、XML文書が、スキーマ文書の持つ制約条件を満たしている場合に、XML文書はスキーマ文書に対して妥当である、と判断される。   The constraints that an XML document should satisfy are usually defined by a schema document. The process of confirming that the XML document satisfies the constraint conditions defined in the schema document is called schema verification. In the schema verification, if the XML document satisfies the constraint condition of the schema document, it is determined that the XML document is valid for the schema document.

一般的にスキーマ文書を設計する際には、複数のシステムで共通的に利用するために汎用性を持たせたり、将来の変更に耐えられるように拡張性を持たせたりすることが多い。このように汎用性や拡張性を考慮して設計されたスキーマ文書は、特定のシステムにとっては制約条件が緩すぎることがある。   In general, when designing a schema document, in many cases, the schema document is provided with generality for common use in a plurality of systems, or is provided with extensibility so that it can withstand future changes. A schema document designed in consideration of versatility and extensibility in this way may have too loose constraints for a specific system.

そこで、汎用性や拡張性を持つスキーマ文書を、特定のシステムに適した形に変更してから使用することがある。このようなスキーマ文書の変更を支援するための技術として、例えば特許文献1がある。特許文献1では、スキーマ文書を解析し、スキーマ文書の持つ制約条件をより厳しいものに変更できる場合、ユーザに変更の候補を提示する技術が開示されている。   Therefore, a schema document having versatility and extensibility may be used after being changed into a form suitable for a specific system. As a technique for supporting such a change of the schema document, there is, for example, Patent Document 1. Patent Document 1 discloses a technique for analyzing a schema document and presenting candidates for the change to the user when the constraint condition of the schema document can be changed to a stricter one.

特開2007−265335号公報JP 2007-265335 A

特許文献1に記載の技術は、スキーマ文書に含まれる情報を基に制約条件の変更候補を決定するため、スキーマ文書に含まれる情報だけでは情報量が少なく、的確な変更候補を提示できない場合がある。   Since the technique described in Patent Document 1 determines constraint condition change candidates based on information included in a schema document, the amount of information is small only with information included in the schema document, and an accurate change candidate may not be presented. is there.

従って、特許文献1に記載の技術では、提示された変更候補をユーザが確認し、変更するかどうかを判断しなければならない場面が多くなり、ユーザに大きな負担がかかる。   Therefore, in the technique described in Patent Document 1, there are many scenes in which the user has to check the presented change candidates and determine whether to change them, which places a heavy burden on the user.

そこで、本発明は、制約条件の厳しいスキーマを効率よく生成することを目的とする。   Therefore, an object of the present invention is to efficiently generate a schema with severe constraints.

以上の課題を解決するため、本発明は、オリジナルスキーマに含まれる制約条件を、サンプルデータを妥当と判断することのできる最も厳しい制約条件に変換することで、より制約の厳しいスキーマ文書を生成する。   In order to solve the above problems, the present invention generates a more restrictive schema document by converting the constraint conditions included in the original schema into the most stringent constraint conditions for which the sample data can be judged valid. .

例えば、本発明は、スキーマ文書を生成するスキーマ変換装置であって、サンプルデータに含まれる要素を妥当と判断可能な最も厳しい制約条件を変換候補として、当該要素毎に取得する処理と、前記要素に対応する要素宣言をオリジナルスキーマより特定し、特定した要素宣言の要素内容における前記要素に対する制約条件を、前記変換候補として取得した制約条件に変換することで、前記スキーマ文書を生成する処理と、を行う制御部と、前記オリジナルスキーマ内の要素宣言と、サンプルデータに含まれる要素を妥当と判断可能な最も厳しい制約条件と、を変換候補情報として記憶する記憶部と、を備え、前記制御部は、前記サンプルデータに含まれる要素を、深さ優先で探索し、帰りがけ順で探索された要素を妥当と判断可能な最も厳しい制約条件を変換候補として取得し、前記変換候補情報において、前記サンプルデータに含まれる要素に対応する要素宣言に対応付けられている制約条件と、取得した制約条件と、を満たす最も厳しい制約条件を特定し、前記変換候補情報における制約条件を、特定した制約条件に変更すること、を特徴とする。 For example, the present invention is a schema conversion apparatus that generates a schema document, and obtains, for each element, the strictest constraint that can determine that an element included in sample data is valid as a conversion candidate; A process for generating the schema document by identifying the element declaration corresponding to the original schema from the original schema, and converting the constraint condition for the element in the element content of the identified element declaration into the constraint condition acquired as the conversion candidate; And a storage unit that stores, as conversion candidate information, an element declaration in the original schema, and the strictest constraint that can determine that the element included in the sample data is valid, the control unit Searches for the elements included in the sample data with depth priority, and the elements searched for in the order of return are considered to be valid. Newest constraint condition is obtained as a conversion candidate, and in the conversion candidate information, the strictest constraint condition that satisfies the constraint condition associated with the element declaration corresponding to the element included in the sample data and the acquired constraint condition And the constraint condition in the conversion candidate information is changed to the identified constraint condition .

以上のように、本発明によれば、制約条件の厳しいスキーマを効率よく生成することができる。   As described above, according to the present invention, a schema with severe constraints can be generated efficiently.

図1は、本発明の第一の実施形態であるスキーマ変換装置100の概略図である。   FIG. 1 is a schematic diagram of a schema conversion apparatus 100 according to the first embodiment of the present invention.

スキーマ変換装置100は、記憶部110と、制御部120と、入力部130と、出力部140と、通信部150と、を備える。   The schema conversion apparatus 100 includes a storage unit 110, a control unit 120, an input unit 130, an output unit 140, and a communication unit 150.

記憶部110は、スキーマリポジトリ記憶領域111と、設定情報記憶領域112と、オリジナルスキーマ記憶領域113と、サンプルデータ記憶領域114と、制限候補情報記憶領域115と、変換後スキーマ記憶領域116と、を備える。   The storage unit 110 includes a schema repository storage area 111, a setting information storage area 112, an original schema storage area 113, a sample data storage area 114, a restriction candidate information storage area 115, and a converted schema storage area 116. Prepare.

スキーマリポジトリ記憶領域111には、スキーマ変換装置100で使用するスキーマ文書を管理する情報と、当該スキーマ文書と、が記憶される。   The schema repository storage area 111 stores information for managing a schema document used in the schema conversion apparatus 100 and the schema document.

例えば、本実施形態においては、図2(スキーマ文書管理テーブル111aの概略図)に示すようなスキーマ文書管理テーブル111aと、当該スキーマ文書管理テーブル111aで管理されているスキーマ文書(図示せず)と、がスキーマリポジトリ記憶領域111に記憶される。   For example, in the present embodiment, a schema document management table 111a as shown in FIG. 2 (schematic diagram of the schema document management table 111a), and a schema document (not shown) managed by the schema document management table 111a Are stored in the schema repository storage area 111.

図2に示すように、スキーマ文書管理テーブル111aは、ID欄111bと、対象名前空間URI欄111cと、ロケーション欄111dと、を備える。   As shown in FIG. 2, the schema document management table 111a includes an ID column 111b, a target namespace URI column 111c, and a location column 111d.

ID欄111bには、各々のレコードで管理される各々のスキーマ文書を一意に識別するための識別情報(ID)が格納される。   The ID column 111b stores identification information (ID) for uniquely identifying each schema document managed by each record.

対象名前空間URI欄111cには、スキーマリポジトリ記憶領域111に記憶されているスキーマ文書の対象名前空間URI(Uniform Resource Identifiers)を特定する情報が格納される。   The target namespace URI column 111c stores information for specifying the target namespace URI (Uniform Resource Identifiers) of the schema document stored in the schema repository storage area 111.

ロケーション欄111dには、スキーマリポジトリ記憶領域111に記憶されているスキーマ文書の所在を特定する情報が格納される。このような所在については、例えば、ファイルシステムにおけるパスやURL(Uniform Resource Locator)を用いて記述することができる。   The location column 111d stores information for specifying the location of the schema document stored in the schema repository storage area 111. Such a location can be described using, for example, a path or URL (Uniform Resource Locator) in the file system.

図1に戻り、設定情報記憶領域112には、オリジナルスキーマに対して、制約条件の変更を許可する項目を特定する情報が記憶される。   Returning to FIG. 1, the setting information storage area 112 stores information that identifies items for which the change of the constraint condition is permitted for the original schema.

例えば、本実施形態においては、図3(設定情報テーブル112aの概略図)に示すような設定情報テーブル112aが設定情報記憶領域112に記憶される。   For example, in the present embodiment, a setting information table 112a as shown in FIG. 3 (schematic diagram of the setting information table 112a) is stored in the setting information storage area 112.

設定情報テーブル112aは、ID欄112bと、要素宣言ID欄112cと、制約条件の種別欄112dと、を有する。   The setting information table 112a includes an ID column 112b, an element declaration ID column 112c, and a constraint type column 112d.

ID欄112bには、各々のレコードで特定される項目を一意に識別するための識別情報(ID)が格納される。   The ID column 112b stores identification information (ID) for uniquely identifying items specified in each record.

要素宣言ID欄112cには、要素宣言を一意に識別するための識別情報である要素宣言IDが格納される。ここで、後述のように、本実施形態におけるオリジナルスキーマ113aでは、全ての要素宣言が異なるname属性の値を持つため、name属性の値を要素宣言IDとして用いているが、このような態様に限定されるわけではなく、例えば、XPath等により特定することも可能である。   The element declaration ID column 112c stores an element declaration ID that is identification information for uniquely identifying an element declaration. Here, as described later, in the original schema 113a in the present embodiment, since all element declarations have different name attribute values, the value of the name attribute is used as the element declaration ID. For example, it is possible to specify by XPath or the like.

制約条件の種別欄112dには、制限しようとする制約条件の種別を特定する情報が格納される。   The restriction condition type column 112d stores information for specifying the restriction condition type to be restricted.

図1に戻り、オリジナルスキーマ記憶領域113には、スキーマ変換装置100で変換の対象となるスキーマであるオリジナルスキーマが記憶される。   Returning to FIG. 1, the original schema storage area 113 stores an original schema that is a schema to be converted by the schema conversion apparatus 100.

例えば、本実施形態においては、図4(オリジナルスキーマ113aの概略図)に示すようなオリジナルスキーマ113aがオリジナルスキーマ記憶領域113に記憶される。   For example, in the present embodiment, an original schema 113 a as shown in FIG. 4 (schematic diagram of the original schema 113 a) is stored in the original schema storage area 113.

なお、図4の向かって左端の数字は、行数を示すためのメモリであり、オリジナルスキーマ113aを構成するものではない。   The number at the left end in FIG. 4 is a memory for indicating the number of rows and does not constitute the original schema 113a.

ここで、オリジナルスキーマ113aは、スキーマ変換装置100のオペレータが作成したものを、入力部130等を介して入力を受け付けてもよいし、業界標準などで定められたスキーマ文書を取得して利用してもよい。   Here, the original schema 113a may be received by the operator of the schema conversion apparatus 100 via the input unit 130 or the like, or a schema document defined by an industry standard or the like is acquired and used. May be.

また、オリジナルスキーマは、Webサービスのインターフェースを記述したWSDL(Web Services Description Language)の内部に記述されていたり、WSDLから参照されたりしていることもある。   In addition, the original schema may be described in WSDL (Web Services Description Language) that describes the interface of the Web service, or may be referenced from WSDL.

さらに、オリジナルスキーマはスキーマリポジトリ記憶領域111から取得してもよい。   Further, the original schema may be acquired from the schema repository storage area 111.

サンプルデータ記憶領域114には、オリジナルスキーマを変換する際に使用するサンプルデータが記憶される。   The sample data storage area 114 stores sample data used when converting the original schema.

例えば、本実施形態においては、図5(サンプルデータ114aの概略図)に示すようなサンプルデータ114aがサンプルデータ記憶領域114に記憶される。   For example, in this embodiment, sample data 114 a as shown in FIG. 5 (schematic diagram of sample data 114 a) is stored in the sample data storage area 114.

なお、図5の向かって左端の数字は、行数を示すためのメモリであり、サンプルデータ114aを構成するものではない。   The number at the left end in FIG. 5 is a memory for indicating the number of rows and does not constitute the sample data 114a.

ここで、サンプルデータ114aは、例えば、開発時のテストデータなどを利用してもよい。   Here, for example, test data at the time of development may be used as the sample data 114a.

なお、サンプルデータの数については、任意に設定可能である。   Note that the number of sample data can be arbitrarily set.

図1に戻り、制限候補情報記憶領域115には、各々のオリジナルスキーマに対して、サンプルデータから取得された、より厳しい制限を課す項目と、制約条件と、を特定する情報が記憶される。   Returning to FIG. 1, in the restriction candidate information storage area 115, information specifying the items that impose a stricter restriction and the constraint conditions acquired from the sample data for each original schema is stored.

例えば、本実施形態においては、図6(第一制限候補テーブル115aの概略図)に示すような第一制限候補テーブル115aと、図7(第二制限候補テーブル115gの概略図)に示すような第二制限候補テーブル115gと、がオリジナルスキーマ毎に制限候補情報記憶領域115に記憶される。   For example, in the present embodiment, the first restriction candidate table 115a as shown in FIG. 6 (schematic diagram of the first restriction candidate table 115a) and the one shown in FIG. 7 (schematic diagram of the second restriction candidate table 115g). The second restriction candidate table 115g is stored in the restriction candidate information storage area 115 for each original schema.

ここで、第一制限候補テーブル115aには、要素のテキストデータを制限するための制約条件を特定する情報が格納され、第二制限候補テーブル115gには、要素の子要素を制限するための制約条件を特定するための情報が格納される。   Here, the first restriction candidate table 115a stores information for specifying the restriction condition for restricting the text data of the element, and the second restriction candidate table 115g contains the restriction for restricting the child element of the element. Stores information for specifying the condition.

なお、第一制限候補テーブル115a及び第二制限候補テーブル115gは、初期状態においては、情報は格納されておらず、後述する制限候補情報更新部124がサンプルデータ及びオリジナルスキーマの解析を行うことにより情報が格納される。   The first restriction candidate table 115a and the second restriction candidate table 115g do not store information in the initial state, and the restriction candidate information update unit 124 described later analyzes sample data and the original schema. Information is stored.

図6に示すように、第一制限候補テーブル115aは、ID欄115bと、要素宣言ID欄115cと、制約条件の種別欄115dと、制約条件の候補欄115eと、を有する。   As shown in FIG. 6, the first restriction candidate table 115a includes an ID field 115b, an element declaration ID field 115c, a restriction condition type field 115d, and a restriction condition candidate field 115e.

ID欄115bには、各々のレコードで特定される項目及び制約条件を識別するための識別情報(ID)が格納される。   The ID column 115b stores identification information (ID) for identifying items specified in each record and constraint conditions.

要素宣言ID欄115cには、要素宣言を一意に識別するための識別情報である要素宣言IDが格納される。   The element declaration ID column 115c stores an element declaration ID that is identification information for uniquely identifying an element declaration.

制約条件の種別欄115dには、制限しようとする制約条件の種別を特定する情報が格納される。   The restriction condition type column 115d stores information for specifying the restriction condition type to be restricted.

制約条件の候補欄115eには、制限しようとする制約条件の候補を特定する情報が格納される。   The restriction condition candidate column 115e stores information for specifying restriction candidate candidates to be restricted.

図7に示すように、第二制限候補テーブル115gは、ID欄115hと、要素宣言ID欄115iと、制約条件の種別欄115kと、制約条件の候補欄115lと、を有する。   As shown in FIG. 7, the second restriction candidate table 115g includes an ID field 115h, an element declaration ID field 115i, a restriction condition type field 115k, and a restriction condition candidate field 115l.

ID欄115hには、各々のレコードで特定される項目及び制約条件を識別するための識別情報(ID)が格納される。   The ID column 115h stores identification information (ID) for identifying items specified in each record and constraint conditions.

要素宣言ID欄115iには、要素宣言を一意に識別するための識別情報である要素宣言IDが格納される。   The element declaration ID column 115i stores an element declaration ID that is identification information for uniquely identifying an element declaration.

パーティクルID欄115jには、要素宣言ID欄115iで特定される要素宣言内のパーティクルであって、制限しようとするパーティクルを一意に識別するための識別情報であるパーティクルIDが格納される。   The particle ID column 115j stores a particle ID that is identification information for uniquely identifying a particle in the element declaration specified in the element declaration ID column 115i and to be restricted.

ここで、パーティクルとは、要素宣言の内容モデルの構成要素のことであり、具体的にはsequence要素、choice要素、element要素、any要素等がパーティクルに含まれる。   Here, the particle is a component of the content declaration content model, and specifically includes a sequence element, a choice element, an element element, an any element, and the like.

制約条件の種別欄115kには、制限しようとする制約条件の種別を特定する情報が格納される。   The restriction condition type column 115k stores information for specifying the restriction condition type to be restricted.

制約条件の候補欄115lには、制限しようとする制約条件の候補を特定する情報が格納される。   The constraint condition candidate column 115l stores information for specifying a constraint condition candidate to be restricted.

図1に戻り、変換後スキーマ記憶領域116には、オリジナルスキーマ113aを後述したスキーマ変換部125で変換した変換後スキーマが記憶される。   Returning to FIG. 1, the post-conversion schema storage area 116 stores a post-conversion schema obtained by converting the original schema 113a by the schema conversion unit 125 described later.

例えば、本実施形態においては、図8(変換後スキーマ116aの概略図)に示すような変換後スキーマ116aが変換後スキーマ記憶領域116に記憶される。   For example, in the present embodiment, a post-conversion schema 116a as shown in FIG. 8 (schematic diagram of the post-conversion schema 116a) is stored in the post-conversion schema storage area 116.

なお、図8の向かって左端の数字は、行数を示すためのメモリであり、変換後スキーマ116aを構成するものではない。   The number at the left end in FIG. 8 is a memory for indicating the number of rows and does not constitute the post-conversion schema 116a.

図1に戻り、制御部120は、全体制御部121と、スキーマ検証部122と、探索部123と、制限候補情報更新部124と、スキーマ変換部125と、を備える。   Returning to FIG. 1, the control unit 120 includes an overall control unit 121, a schema verification unit 122, a search unit 123, a restriction candidate information update unit 124, and a schema conversion unit 125.

全体制御部121は、スキーマ変換装置100における処理の全体を制御する。   The overall control unit 121 controls the overall processing in the schema conversion apparatus 100.

特に、本実施形態においては、全体制御部121は、スキーマリポジトリ記憶領域111、設定情報記憶領域112、オリジナルスキーマ記憶領域113、サンプルデータ記憶領域114に記憶する情報の管理を行う。例えば、入力部130や通信部150を介して、これらの記憶領域に記憶する情報を取得し、取得した情報を各々の対応する記憶領域に記憶等する処理を行う。   In particular, in the present embodiment, the overall control unit 121 manages information stored in the schema repository storage area 111, the setting information storage area 112, the original schema storage area 113, and the sample data storage area 114. For example, the information stored in these storage areas is acquired via the input unit 130 or the communication unit 150, and the acquired information is stored in the corresponding storage areas.

スキーマ検証部122は、検証対象となっているXML文書が、スキーマ文書に対して妥当か否かを検証する。   The schema verification unit 122 verifies whether the XML document to be verified is valid with respect to the schema document.

特に、本実施形態においては、スキーマ検証部122は、サンプルデータ記憶領域114に記憶されているサンプルデータ114aが、オリジナルスキーマ記憶領域113に記憶されているオリジナルスキーマ113aに対して妥当か否かの検証を行う。   In particular, in this embodiment, the schema verification unit 122 determines whether the sample data 114a stored in the sample data storage area 114 is valid with respect to the original schema 113a stored in the original schema storage area 113. Perform verification.

探索部123は、探索の対象となるXML文書(サンプルデータ114a)を探索し、当該XML文書(サンプルデータ114a)に記述されている各々の要素を特定する。   The search unit 123 searches for an XML document (sample data 114a) to be searched, and specifies each element described in the XML document (sample data 114a).

ここで、本実施形態においては、探索部123は、探索の対象となるXML文書(サンプルデータ114a)を深さ優先で探索し、帰りがけ順で要素を特定して、当該帰りがけ順で特定した要素に含まれる情報を制限候補情報更新部124に出力する。   Here, in the present embodiment, the search unit 123 searches the XML document (sample data 114a) to be searched with depth priority, specifies elements in the order of return, and specifies the elements in the order of return. Is output to the restriction candidate information update unit 124.

制限候補情報更新部124は、探索部123より取得した要素より、当該要素に対応する要素宣言に含まれる情報をオリジナルスキーマ113aから抽出して、当該要素に含まれる情報が妥当と判断されるように、より厳しい制約条件があるか否かを判断して、より厳しい制約条件のうち最も厳しい制約条件を制限候補として制限候補情報記憶領域115に記憶する処理を行う。   The restriction candidate information update unit 124 extracts information included in the element declaration corresponding to the element from the element acquired from the search unit 123 from the original schema 113a so that the information included in the element is determined to be valid. In addition, it is determined whether or not there is a stricter constraint condition, and a process of storing the strictest constraint condition among the stricter constraint conditions in the limit candidate information storage area 115 as a limit candidate is performed.

スキーマ変換部125は、制限候補情報記憶領域115に記憶されている制限候補が、設定情報記憶領域112に記憶されている設定情報で制限が許可されているものか否かを判断し、制限が許可されている制限候補をオリジナルスキーマ113aに適用することで、スキーマの変換を行い、変換後スキーマを生成する。   The schema conversion unit 125 determines whether or not the restriction candidates stored in the restriction candidate information storage area 115 are permitted by the setting information stored in the setting information storage area 112, and the restriction is determined. By applying the permitted restriction candidates to the original schema 113a, the schema is converted, and the converted schema is generated.

なお、このようにして生成された変換後スキーマは、変換後スキーマ記憶領域116に記憶される。   The converted schema generated in this way is stored in the converted schema storage area 116.

入力部130は、情報の入力を受け付ける。   The input unit 130 receives input of information.

出力部140は、情報を出力する。   The output unit 140 outputs information.

通信部150は、ネットワーク(図示せず)を介して情報を送受信する。   The communication unit 150 transmits and receives information via a network (not shown).

以上に記載したスキーマ変換装置100は、例えば、図9(コンピュータ200の概略図)に示すような、CPU(Central Processing Unit)901と、メモリ902と、HDD(Hard Disk Drive)等の外部記憶装置903と、CD−ROM(Compact Disk Read Only Memory)やDVD−ROM(Digital Versatile Disk Read Only Memory)等の可搬性を有する記憶媒体904に対して情報を読み書きする読書装置905と、キーボードやマウスなどの入力装置906と、ディスプレイなどの出力装置907と、通信ネットワークに接続するためのNIC(Network Interface Card)等の通信装置908と、を備えた一般的なコンピュータ900で実現できる。   The schema conversion apparatus 100 described above includes, for example, an external storage device such as a CPU (Central Processing Unit) 901, a memory 902, and an HDD (Hard Disk Drive) as shown in FIG. 9 (schematic diagram of the computer 200). 903, a reading device 905 for reading / writing information from / to a portable storage medium 904 such as a CD-ROM (Compact Disk Read Only Memory) and a DVD-ROM (Digital Versatile Disk Read Only Memory), a keyboard, a mouse, and the like This can be realized by a general computer 900 including an input device 906, an output device 907 such as a display, and a communication device 908 such as a NIC (Network Interface Card) for connecting to a communication network.

例えば、記憶部110は、CPU901がメモリ902又は外部記憶装置903を利用することにより実現可能であり、制御部120は、外部記憶装置903に記憶されている所定のプログラムをメモリ902にロードしてCPU901で実行することで実現可能であり、入力部130は、CPU901が入力装置906を利用することで実現可能であり、出力部140は、CPU901が出力装置907を利用することで実現可能であり、通信部150は、CPU901が通信装置908を利用することで実現可能である。   For example, the storage unit 110 can be realized by the CPU 901 using the memory 902 or the external storage device 903, and the control unit 120 loads a predetermined program stored in the external storage device 903 into the memory 902. The input unit 130 can be realized by the CPU 901 using the input device 906, and the output unit 140 can be realized by the CPU 901 using the output device 907. The communication unit 150 can be realized by the CPU 901 using the communication device 908.

この所定のプログラムは、読書装置905を介して記憶媒体904から、あるいは、通信装置908を介してネットワークから、外部記憶装置903にダウンロードされ、それから、メモリ902上にロードされてCPU901により実行されるようにしてもよい。また、読書装置905を介して記憶媒体904から、あるいは、通信装置908を介してネットワークから、メモリ902上に直接ロードされ、CPU901により実行されるようにしてもよい。   The predetermined program is downloaded from the storage medium 904 via the reading device 905 or from the network via the communication device 908 to the external storage device 903, and then loaded onto the memory 902 and executed by the CPU 901. You may do it. Alternatively, the program may be directly loaded on the memory 902 from the storage medium 904 via the reading device 905 or from the network via the communication device 908 and executed by the CPU 901.

図10は、スキーマ変換装置100における全体の処理を示すフローチャートである。   FIG. 10 is a flowchart showing overall processing in the schema conversion apparatus 100.

まず、全体制御部121は、オリジナルスキーマ記憶領域113に記憶されているオリジナルスキーマ及びサンプルデータ記憶領域114に記憶されているサンプルデータを取得する(S10)。ここで、オリジナルスキーマに使用するサンプルデータが複数ある場合には、ステップS10において複数のサンプルデータを取得する。   First, the overall control unit 121 acquires the original schema stored in the original schema storage area 113 and the sample data stored in the sample data storage area 114 (S10). Here, when there are a plurality of sample data used for the original schema, a plurality of sample data are acquired in step S10.

次に、全体制御部121は、ステップS10で取得したサンプルデータからステップS14の制限候補の探索を未だ行っていないサンプルデータを一つ抽出して、スキーマ検証部122に入力するとともに(S11)、ステップS10で取得したオリジナルスキーマをスキーマ検証部122に入力する。   Next, the overall control unit 121 extracts one sample data that has not yet been searched for restriction candidates in step S14 from the sample data acquired in step S10, and inputs the sample data to the schema verification unit 122 (S11). The original schema acquired in step S10 is input to the schema verification unit 122.

次に、スキーマ検証部122は、ステップS11で入力されたサンプルデータが、入力されたスキーマに対して妥当か否かを判断する(S12)。ここで、スキーマ検証部122での処理は、一般的なXMLパーサなどで実現されているものと同様である。   Next, the schema verification unit 122 determines whether the sample data input in step S11 is valid for the input schema (S12). Here, the processing in the schema verification unit 122 is the same as that realized by a general XML parser or the like.

そして、サンプルデータがスキーマに対して妥当ではない場合には(ステップS12でNo)ステップS13に進み、サンプルデータがスキーマに対して妥当である場合には(ステップS12でYes)ステップS14に進む。   If the sample data is not valid for the schema (No in step S12), the process proceeds to step S13. If the sample data is valid for the schema (Yes in step S12), the process proceeds to step S14.

ステップS13では、スキーマ検証部122は、予め定められたエラーメッセージを出力部140に表示し、処理を終了する。   In step S13, the schema verification unit 122 displays a predetermined error message on the output unit 140 and ends the process.

一方、ステップS14では、スキーマ検証部122は、全体制御部121より入力されたサンプルデータとオリジナルスキーマとを探索部123及び制限候補情報更新部124に入力して、探索部123及び制限候補情報更新部124は、制限候補情報を更新する処理を行う。なお、ステップS14での処理の詳細は、後述する。   On the other hand, in step S14, the schema verification unit 122 inputs the sample data and the original schema input from the overall control unit 121 to the search unit 123 and the restriction candidate information update unit 124, and updates the search unit 123 and the restriction candidate information update. The unit 124 performs processing for updating the restriction candidate information. Details of the processing in step S14 will be described later.

次に、全体制御部121は、ステップS10で取得したサンプルデータのうち、ステップS14の制限候補の探索を未だ行っていないサンプルデータがあるか否かを判断し(S15)、ある場合には(ステップS15でYes)ステップS11に戻り処理を繰り返し、ない場合には(ステップS15でNo)ステップS16に進む。   Next, the overall control unit 121 determines whether there is sample data that has not yet been searched for restriction candidates in step S14 among the sample data acquired in step S10 (S15). In step S15, the process returns to step S11 to repeat the process. If not (No in step S15), the process proceeds to step S16.

ステップS16では、制限候補情報更新部124は、設定情報記憶領域112に記憶されている設定情報を取得して、制限候補情報記憶領域115に記憶されている制限候補のうち、設定情報において制限が許可されていないものを削除することで、制限候補の更新を行う。   In step S <b> 16, the restriction candidate information update unit 124 acquires the setting information stored in the setting information storage area 112, and among the restriction candidates stored in the restriction candidate information storage area 115, there is a restriction in the setting information. The restriction candidates are updated by deleting the unauthorized ones.

具体的には、制限候補情報更新部124は、設定情報記憶領域112に記憶されている設定情報テーブル112aを取得して、制限候補情報記憶領域115に記憶されている第一制限候補テーブル115a及び第二制限候補テーブル115gの各々のレコードのうち、制限候補テーブル112aで制限が許可されていないものを削除する。   Specifically, the restriction candidate information update unit 124 acquires the setting information table 112a stored in the setting information storage area 112, and stores the first restriction candidate table 115a stored in the restriction candidate information storage area 115 and Of the records in the second restriction candidate table 115g, those that are not permitted to be restricted in the restriction candidate table 112a are deleted.

ここで、制限候補テーブル112aでは、ID欄112bが「1」のレコードにおいて、要素宣言ID欄112cが「Telephone」で、制約条件の種別欄112dが「基底型」のレコードについては、制約条件の制限を許可していることを示している。   Here, in the restriction candidate table 112a, in the record in which the ID column 112b is “1”, the element declaration ID column 112c is “Telephone” and the constraint type column 112d is “basic”, Indicates that the restriction is permitted.

また、制限候補テーブル112aでは、ID欄112bが「2」のレコードにおいて、要素宣言ID欄112cが「Telephone」で、制約条件の種別欄112dが「値の長さ」のレコードについては、制約条件の制限を許可していることを示している。   Further, in the restriction candidate table 112a, the record in which the ID column 112b is “2”, the element declaration ID column 112c is “Telephone”, and the constraint type column 112d is “value length” Indicates that the restriction is allowed.

また、制限候補テーブル112aでは、ID欄112bが「3」のレコードにおいて、要素宣言ID欄112cが「*」で、これは、任意の要素であることを示しており、制約条件の種別欄112dが「出現パーティクル」のレコードについては、制約条件の制限を許可していることを示している。   Further, in the restriction candidate table 112a, in the record in which the ID column 112b is “3”, the element declaration ID column 112c is “*”, which indicates an arbitrary element, and the restriction type column 112d. Indicates that the restriction of the restriction condition is permitted for the record of “appearing particle”.

また、制限候補テーブル112aでは、ID欄112bが「4」のレコードにおいて、要素宣言ID欄112cが任意の要素であり、制約条件の種別欄112dが「出現回数」のレコードについては、制約条件の制限を許可していることを示している。   In the restriction candidate table 112a, in the record whose ID column 112b is “4”, the element declaration ID column 112c is an arbitrary element, and the record whose constraint condition type column 112d is “appearance count” Indicates that the restriction is permitted.

また、制限候補テーブル112aでは、ID欄112bが「5」のレコードにおいて、要素宣言ID欄112cが任意の要素であり、制約条件の種別欄112dが「出現要素」のレコードについては、制約条件の制限を許可していることを示している。   In the restriction candidate table 112a, in the record whose ID column 112b is “5”, the element declaration ID column 112c is an arbitrary element, and the record whose constraint condition type column 112d is “appearance element” Indicates that the restriction is permitted.

従って、第一制限候補テーブル115aのID欄115bが「1,2,5〜10」のレコードは削除され、第二制限候補テーブル115gのレコードは削除しないことで、これらの制限候補情報を更新する。   Therefore, the record of “1, 2, 5-10” in the ID field 115b of the first restriction candidate table 115a is deleted, and the restriction candidate information is updated by not deleting the record of the second restriction candidate table 115g. .

そして、スキーマ変換部125は、ステップS16で更新された制限候補を用いてオリジナルスキーマを変換して、変換後スキーマを生成する(S17)。   Then, the schema conversion unit 125 converts the original schema using the restriction candidates updated in step S16, and generates a converted schema (S17).

まず、図6の第一制限候補テーブル115aのID欄115bが「3」及び「4」で識別されるレコードの制限について説明する。   First, the limitation on records identified by “3” and “4” in the ID column 115b of the first limitation candidate table 115a in FIG. 6 will be described.

この制限により、図4に示すオリジナルスキーマ113aの32行目のelement要素が、図8に示す変換後スキーマ116aの31行目〜37行目のelement要素に変換される。   Due to this restriction, the element element on the 32nd line of the original schema 113a shown in FIG. 4 is converted into the element element on the 31st to 37th lines of the converted schema 116a shown in FIG.

ここで、変換後スキーマ116aの33行目のrestriction要素は、base属性の値で指定したデータ型を基底として制限することを表す。base属性の値には、第一制限候補テーブル115aの制約条件の候補欄115eに登録されている「NCName」を格納する。   Here, the restriction element on the 33rd line of the post-conversion schema 116a represents that the data type specified by the value of the base attribute is limited as a base. As the value of the base attribute, “NCName” registered in the restriction condition candidate column 115e of the first restriction candidate table 115a is stored.

また、変換後スキーマ116aの34行目のlength要素は、このデータ型がvalue属性の値で指定した長さの値のみを許すことを表す。value属性の値には、第一制限候補テーブル115aの制約条件の候補欄115eに登録されている「12」を格納する。   Further, the length element on the 34th line of the post-conversion schema 116a represents that this data type allows only a value having a length specified by the value of the value attribute. As the value of the value attribute, “12” registered in the restriction condition candidate column 115e of the first restriction candidate table 115a is stored.

これらの変換により、オリジナルスキーマ113aのTelephone要素の要素宣言は、stringのデータ型であったが、変換後スキーマではNCName基底型とするデータ型になるため、制約条件が厳しくなる。また、オリジナルスキーマ113aでは値の長さの制限がなかったが、変換後スキーマ116aでは値の長さが「12」に限定されるため、制約条件が厳しくなる。   With these conversions, the element declaration of the Telephone element of the original schema 113a has the string data type, but the converted schema becomes the data type of the NCName base type, so that the constraint condition becomes strict. In the original schema 113a, the length of the value is not limited. However, in the post-conversion schema 116a, the length of the value is limited to “12”, so that the constraint condition becomes strict.

次に、図7に示した第二制限候補テーブル115gのID欄115hが「1」で識別されるレコードの制限について説明する。   Next, the limitation on records identified by “1” in the ID column 115h of the second limitation candidate table 115g shown in FIG. 7 will be described.

この変換により、オリジナルスキーマ113aの15〜18行目のchoice要素が、変換後スキーマ116aの17行目のelement要素に変換される。   By this conversion, the choice element on the 15th to 18th lines of the original schema 113a is converted to the element element on the 17th line of the converted schema 116a.

これにより、オリジナルスキーマ113aでは、Telephone要素とEmail要素のどちらの要素の出現も許可していたが、変換後スキーマ116aではTelephone要素の出現だけを許しEmail要素の出現を禁止することができるため、制約条件が厳しくなる。   As a result, in the original schema 113a, the occurrence of both the Telephone element and the Email element was permitted, but in the post-conversion schema 116a, only the occurrence of the Telephone element can be allowed and the appearance of the Email element can be prohibited. Constraints become stricter.

次に、図7に示した第二制限候補テーブル115gのID欄115hが「2」及び「3」で識別されるレコードの制限について説明する。   Next, a description will be given of the restriction of records identified by “2” and “3” in the ID column 115h of the second restriction candidate table 115g shown in FIG.

この変換により、オリジナルスキーマ113aの27行目のany要素が、変換後スキーマ116aの26行目のelement要素に変換される。   By this conversion, the any element on the 27th line of the original schema 113a is converted into an element element on the 26th line of the converted schema 116a.

これにより、オリジナルスキーマ113aでは任意の要素の出現が許可されていたが、変換後スキーマ116aではDiscount要素の出現だけを許すようになる。また、オリジナルスキーマ113aでは最大の出現回数の制限がなかったが、変換後スキーマでは最大出現回数を1回に制限することができるようになり、制約条件が厳しくなる。   As a result, although the appearance of an arbitrary element is permitted in the original schema 113a, only the appearance of a Disco element is allowed in the post-conversion schema 116a. Further, although the maximum number of appearances was not limited in the original schema 113a, the maximum number of appearances can be limited to one in the post-conversion schema, and the constraint condition becomes strict.

次に、図7に示した第二制限候補テーブル115gのID欄115hが「4」で識別されるレコードの制限について説明する。   Next, the limitation on records identified by “4” in the ID column 115h of the second limitation candidate table 115g shown in FIG. 7 will be described.

この変換により、オリジナルスキーマ113aの07行目のelement要素が、変換後スキーマ116aの09行目のelement要素に変換される。   By this conversion, the element element on the 07th line of the original schema 113a is converted to the element element on the 09th line of the converted schema 116a.

これにより、オリジナルスキーマ113aでは最大の出現回数の制限がなかったが、変換後スキーマでは最大出現回数を2回に制限することができるようになり、制約条件が厳しくなる。   As a result, the maximum number of appearances was not limited in the original schema 113a, but the maximum number of appearances can be limited to two in the converted schema, and the constraint condition becomes strict.

図11は、図10のステップS14に示す制限候補情報を更新する処理を示すフローチャートである。   FIG. 11 is a flowchart showing a process for updating the restriction candidate information shown in step S14 of FIG.

まず、スキーマ変換装置100の探索部123は、探索の対象となっているサンプルデータから、要素を探索し、後述するステップS21〜ステップS24の調査を未だ行っていない要素Eを一つ抽出する(S20)。   First, the search unit 123 of the schema conversion device 100 searches for an element from sample data that is a search target, and extracts one element E that has not yet been investigated in steps S21 to S24 described later ( S20).

ここで、本実施形態においては、探索部123は、深さ優先でサンプルデータの探索を行い、帰りがけ順に要素Eを抽出して後述する処理を行う。   Here, in the present embodiment, the search unit 123 searches the sample data with depth priority, extracts the element E in the order of return, and performs the process described later.

例えば、探索の対象となっているサンプルデータが、図5に示すサンプルデータ114aである場合には、探索部123は、深さ優先でサンプルデータ114aの探索を行い、サンプルデータ114aに含まれる各要素を以下のような順番で要素Eとして抽出する。   For example, when the sample data to be searched is the sample data 114a shown in FIG. 5, the search unit 123 searches the sample data 114a with depth priority, and includes each of the sample data 114a. Elements are extracted as element E in the following order.

(1)CustomerName要素(04行目)、(2)Telephone要素(05行目)、(3)CustomerInfo要素(03〜06行目)、(4)ProductName要素(08行目)、(5)Quantity要素(09行目)、(6)PurchaseInfo要素(07〜10行目)、(7)ProductName要素(12行目)、(8)Quantity要素(13行目)、(9)Discount要素(14行目)、(10)PurchaseInfo要素(11〜15行目)、(11)PurchaseOrder要素(01〜16行目)。   (1) CustomerName element (line 04), (2) Telephone element (line 05), (3) CustomerInfo element (line 03-06), (4) ProductName element (line 08), (5) Quantity Element (line 09), (6) PurchaseInfo element (line 07-10), (7) ProductName element (line 12), (8) Quantity element (line 13), (9) Disco element (line 14) Eye), (10) PurchaseInfo element (11th to 15th lines), (11) PurchaseOrder element (01th to 16th lines).

次に、制限候補情報更新部124は、要素Eに対応する要素宣言Dをオリジナルスキーマより取得する(S21)。ここで、要素宣言Dを取得する処理については、図12を用いて詳細に説明する。   Next, the restriction candidate information update unit 124 acquires an element declaration D corresponding to the element E from the original schema (S21). Here, the process of acquiring the element declaration D will be described in detail with reference to FIG.

次に、制限候補情報更新部124は、ステップS21で取得した要素宣言Dに、子要素の定義が含まれるか否かを判定する(S22)。ここで、要素宣言Dに子要素の定義が含まれるか否かは、要素宣言Dが「element」要素を子要素内に有するか否かにより判断する。   Next, the restriction candidate information update unit 124 determines whether or not the element declaration D acquired in step S21 includes a child element definition (S22). Here, whether or not the element declaration D includes the definition of the child element is determined by whether or not the element declaration D has an “element” element in the child element.

そして、子要素の定義がない場合には(ステップS22でNo)ステップS23に進み、子要素の定義がある場合には(ステップS22でYes)ステップS24に進む。   If no child element is defined (No in step S22), the process proceeds to step S23. If a child element is defined (Yes in step S22), the process proceeds to step S24.

ステップS23では、制限候補情報更新部124は、テキストデータの制約条件の制限候補情報を更新する。なお、この処理の詳細については、図15を用いて詳細に説明する。   In step S <b> 23, the restriction candidate information update unit 124 updates restriction candidate information on the constraint condition of the text data. Details of this processing will be described in detail with reference to FIG.

一方、ステップS24では、制限候補情報更新部124は、子要素の制約条件の制限候補情報を更新する。なお、この処理の詳細については、図16を用いて詳細に説明する。   On the other hand, in step S <b> 24, the restriction candidate information update unit 124 updates the restriction candidate information of the constraint condition of the child element. Details of this processing will be described in detail with reference to FIG.

そして、制限候補情報更新部124は、ステップS21〜ステップS24に示す調査を行っていない要素があるか否かを判断して(S25)、このような要素がある場合には(ステップS25でYes)ステップS20に戻り処理を繰り返し、このような要素がない場合には(ステップS25でNo)処理を終了する。   Then, the restriction candidate information update unit 124 determines whether there is an element that has not been investigated in steps S21 to S24 (S25), and if there is such an element (Yes in step S25). ) Return to step S20 and repeat the process. If there is no such element (No in step S25), the process ends.

図12は、図11におけるステップS21の要素Eに対応する要素宣言Dのデータを取得する処理を示すフローチャートである。   FIG. 12 is a flowchart showing processing for acquiring data of the element declaration D corresponding to the element E in step S21 in FIG.

まず、スキーマ変換装置100の制限候補情報更新部124は、要素Eの名前空間と、オリジナルスキーマの対象名前空間と、が同じか否かを判断する(S30)。   First, the restriction candidate information update unit 124 of the schema conversion apparatus 100 determines whether or not the name space of the element E is the same as the target namespace of the original schema (S30).

例えば、サンプルデータが図5に示すサンプルデータ114aであり、オリジナルスキーマが図4に示すオリジナルスキーマ113aである場合には、CustomerName要素(04行目)、Telephone要素(05行目)、CustomerInfo要素(03〜06行目)、ProductName要素(08行目)、Quantity要素(09行目)、PurchaseInfo要素(07〜10行目)、ProductName要素(12行目)、Quantity要素(13行目)、PurchaseInfo要素(11〜15行目)、および、PurchaseOrder要素(01〜16行目)の名前空間URI「http://example.org/order」であり、オリジナルスキーマ113aの対象名前空間URIは「http://example.org/order」であり、これらは一致するため、ステップS31に進む。一方、Discount要素(14行目)の名前空間URIは、「http://example.com/ext」であり、オリジナルスキーマ113aの対象名前空間URIは「http://example.org/order」であり、これらは一致しないため、ステップS36に進む。   For example, when the sample data is the sample data 114a shown in FIG. 5 and the original schema is the original schema 113a shown in FIG. 4, a CustomerName element (04th line), a Telephone element (05th line), a CustomerInfo element ( 03 to 06), ProductName element (line 08), Quantity element (line 09), PurchaseInfo element (line 07 to 10), ProductName element (line 12), Quantity element (line 13), PurchaseInfo It is the namespace URI “http://example.org/order” of the element (line 11 to 15) and the PurchaseOrder element (line 01 to 16), and the original schema 113a The elephant is the namespace URI is "http://example.org/order", these are for the match, the processing proceeds to step S31. On the other hand, the namespace URI of the Disco element (line 14) is “http://example.com/ext”, and the target namespace URI of the original schema 113a is “http://example.org/order”. Since they do not match, the process proceeds to step S36.

ステップS31では、制限候補情報更新部124は、要素Eに対応した要素宣言が、オリジナルスキーマ内に存在するか否かを判断する(S31)。そして、このような要素宣言がオリジナルスキーマ内に存在する場合には(ステップS31でYes)ステップS33に進み、このような要素宣言がオリジナルスキーマ内に存在しない場合には(ステップS31でNo)ステップS32に進む。   In step S31, the restriction candidate information update unit 124 determines whether an element declaration corresponding to the element E exists in the original schema (S31). If such an element declaration exists in the original schema (Yes in step S31), the process proceeds to step S33, and if such an element declaration does not exist in the original schema (No in step S31), step. Proceed to S32.

ステップS32では、制限候補情報更新部124は、要素Eに対応した要素宣言が、インクルード先のスキーマ内に存在するか否かを判断する。そして、このような要素宣言がインクルード先のスキーマ内に存在する場合には(ステップS32でYes)ステップS33に進み、このような要素宣言がインクルード先のスキーマ内に存在しない場合には(ステップS32でNo)ステップS34に進む。   In step S32, the restriction candidate information update unit 124 determines whether an element declaration corresponding to the element E exists in the include destination schema. If such an element declaration exists in the include schema (Yes in step S32), the process proceeds to step S33. If such an element declaration does not exist in the include schema (step S32). No) Proceed to step S34.

ステップS33では、オリジナルスキーマ内又はインクルード先のスキーマ内に存在する要素宣言を、要素Eに対応した要素宣言Dとして取得して、処理を終了する。   In step S33, an element declaration existing in the original schema or in the include destination schema is acquired as an element declaration D corresponding to the element E, and the process ends.

例えば、サンプルデータが図5に示すサンプルデータ114aであり、オリジナルスキーマが図4に示すオリジナルスキーマ113aである場合には、サンプルデータ114aのCustomerName要素(04行目)に対してはオリジナルスキーマ113aの31行目を、サンプルデータ114aのTelephone要素(05行目)に対してはオリジナルスキーマ113aの32行目を、サンプルデータ114aのCustomerInfo要素(03〜06行目)に対してはオリジナルスキーマ113aの11行目から21行目までを、サンプルデータ114aのProductName要素(08行目)に対してはオリジナルスキーマ113aの34行目を、サンプルデータ114aのQuantity要素(09行目)に対してはオリジナルスキーマ113aの35行目を、サンプルデータ114aのPurchaseInfo要素(07〜10行目)に対してはオリジナルスキーマ113aの22行目から30行目までを、サンプルデータ114aのProductName要素(12行目)に対してはオリジナルスキーマ113aの34行目を、サンプルデータ114aのQuantity要素(13行目)に対してはオリジナルスキーマ113aの35行目を、サンプルデータ114aのPurchaseInfo要素(11〜15行目)に対してはオリジナルスキーマ113aの22行目から30行目までを、および、サンプルデータ114aのPurchaseOrder要素(01〜16行目)に対してはオリジナルスキーマ113aの03行目から10行目までを、要素宣言Dとして取得する。   For example, when the sample data is the sample data 114a shown in FIG. 5 and the original schema is the original schema 113a shown in FIG. 4, the CustomerName element (the 04th line) of the sample data 114a has the original schema 113a. The 31st line, the 32nd line of the original schema 113a for the Telephone element (05th line) of the sample data 114a, and the original schema 113a for the CustomerInfo element (03rd to 06th line) of the sample data 114a. The 11th to 21st lines correspond to the ProductName element (line 08) of the sample data 114a with respect to the 34th line of the original schema 113a and the Quantity element (line 09) of the sample data 114a. The 35th line of the original schema 113a, the PurchaseInfo element (07th to 10th lines) of the sample data 114a, the 22nd to 30th lines of the original schema 113a, and the ProductName element (12 of the sample data 114a) Line 34) of the original schema 113a, the 35th line of the original schema 113a for the Quantity element (line 13) of the sample data 114a, and the PurchaseInfo element (11-15 of the sample data 114a). Line 22) from the 22nd line to the 30th line of the original schema 113a, and from the line 03 of the original schema 113a to the PurchaseOrder element (lines 01 to 16) of the sample data 114a. To 0 row, to get as element declaration D.

一方、ステップS34では、制限候補情報更新部124は、要素Eに対応した要素宣言が、スキーマリポジトリ記憶領域111に記憶されているスキーマ文書内に存在するか否かを判断する。   On the other hand, in step S <b> 34, the restriction candidate information update unit 124 determines whether an element declaration corresponding to the element E exists in the schema document stored in the schema repository storage area 111.

具体的には、制限候補情報更新部124は、要素Eの名前空間URIと一致する対象名前空間URIを有するスキーマ文書が格納されているレコードをスキーマリポジトリテーブル111aの対象名前空間URI欄111cより特定し、特定したレコードのロケーション欄111dに格納されているロケーションで示されるスキーマ文書内を検索することで、要素Eに対応した要素宣言があるかないかを判断する。   Specifically, the restriction candidate information update unit 124 identifies, from the target namespace URI column 111c of the schema repository table 111a, a record in which a schema document having a target namespace URI that matches the namespace E of the element E is stored. Then, it is determined whether or not there is an element declaration corresponding to the element E by searching the schema document indicated by the location stored in the location column 111d of the specified record.

そして、このような要素宣言がある場合には(ステップS34でYes)ステップS35に進み、このような要素宣言がない場合には(ステップS34でNo)ステップS36に進む。   If there is such an element declaration (Yes in step S34), the process proceeds to step S35, and if there is no such element declaration (No in step S34), the process proceeds to step S36.

ステップS35では、制限候補情報更新部124は、発見した要素宣言を要素宣言Dとして取得するとともに、発見した要素宣言が含まれるスキーマ文書をオリジナルスキーマにインクルードする。   In step S35, the restriction candidate information update unit 124 acquires the found element declaration as an element declaration D, and includes a schema document including the found element declaration in the original schema.

一方、ステップS36では、制限候補情報更新部124は、予め定められたエラーメッセージを出力部140に出力して、処理を終了する。なお、ステップS36で出力するエラーメッセージには、対応する要素宣言を有しない要素Eを特定する情報が含まれていることが望ましい。   On the other hand, in step S36, the restriction candidate information update unit 124 outputs a predetermined error message to the output unit 140 and ends the process. Note that the error message output in step S36 preferably includes information for specifying the element E that does not have a corresponding element declaration.

次に、ステップS37では、オリジナルスキーマにインポートされているスキーマ文書内に、要素Eに対応する要素宣言があるか否かを判断する。このような要素宣言がある場合には(ステップS37でYes)ステップS38に進み、ない場合には(ステップS37でNo)ステップS39に進む。   Next, in step S37, it is determined whether or not there is an element declaration corresponding to the element E in the schema document imported into the original schema. If there is such an element declaration (Yes in step S37), the process proceeds to step S38, and if not (No in step S37), the process proceeds to step S39.

なお、インポートとは名前空間の異なるスキーマ文書を取り込むことを言い、XML Schemaではimport要素を用いてインポートを実現することができる。   Note that import refers to importing schema documents having different namespaces, and XML Schema can implement import using an import element.

例えば、サンプルデータ114aのDiscount要素は、オリジナルスキーマ113aと名前空間が異なるため、当該Discount要素が要素Eとなっている場合には、ステップS37での処理となるが、オリジナルスキーマ113aでは、インポートを行っていないため、ステップS39に進むこととなる。   For example, since the Disc element of the sample data 114a has a different name space from the original schema 113a, when the Disc element is the element E, the processing is performed in step S37. However, in the original schema 113a, import is performed. Since it has not performed, it will progress to step S39.

ステップS39では、制限候補情報更新部124は、要素Eに対応した要素宣言が、スキーマリポジトリ記憶領域111に記憶されているスキーマ文書内に存在するか否かを判断する。   In step S39, the restriction candidate information update unit 124 determines whether or not an element declaration corresponding to the element E exists in the schema document stored in the schema repository storage area 111.

具体的には、制限候補情報更新部124は、要素Eの名前空間URIと一致する対象名前空間URIを有するスキーマ文書が格納されているレコードをスキーマリポジトリテーブル111aの対象名前空間URI欄111cより特定し、特定したレコードのロケーション欄111dに格納されているロケーションで示されるスキーマ文書内を検索することで、要素Eに対応した要素宣言があるかないかを判断する。   Specifically, the restriction candidate information update unit 124 identifies, from the target namespace URI column 111c of the schema repository table 111a, a record in which a schema document having a target namespace URI that matches the namespace E of the element E is stored. Then, it is determined whether or not there is an element declaration corresponding to the element E by searching the schema document indicated by the location stored in the location column 111d of the specified record.

例えば、サンプルデータ114aのDiscount要素の名前空間URIである「http://example.com/ext」は、図2に示すスキーマリポジトリテーブル111aのID欄11bが「3」のレコードの対象名前空間URI欄111cと一致するため、このレコードのロケーション111dで特定されるロケーションに記憶されているスキーマ文書を検索する。   For example, “http://example.com/ext”, which is the namespace URI of the Disco element of the sample data 114a, is the target namespace URI of the record whose ID column 11b of the schema repository table 111a shown in FIG. 2 is “3”. Since it matches the field 111c, the schema document stored in the location specified by the location 111d of this record is searched.

そして、このような要素宣言がある場合には(ステップS39でYes)ステップS40に進み、このような要素宣言がない場合には(ステップS39でNo)ステップS41に進む。   If there is such an element declaration (Yes in step S39), the process proceeds to step S40. If there is no such element declaration (No in step S39), the process proceeds to step S41.

ステップS40では、制限候補情報更新部124は、発見した要素宣言を要素宣言Dとして取得するとともに、発見した要素宣言が含まれるスキーマ文書をオリジナルスキーマにインポートする。   In step S40, the restriction candidate information update unit 124 acquires the found element declaration as an element declaration D, and imports a schema document including the found element declaration into the original schema.

例えば、サンプルデータ114aのDiscount要素が要素Eである場合であって、ステップS39で発見されたスキーマ文書が、図13(スキーマ160の概略図)に示すスキーマ160であるときには、スキーマ160の04行目に対応する要素宣言があるため、この04行目の要素宣言を要素宣言Dとして取得するとともに、スキーマ160をオリジナルスキーマ113aにインポートする。例えば、図14(import要素161の概略図)に示すようなimport要素161をオリジナルスキーマ113aに追加する。   For example, when the Disc count element of the sample data 114a is the element E and the schema document found in step S39 is the schema 160 shown in FIG. 13 (schematic diagram of the schema 160), the 04th line of the schema 160 is displayed. Since there is an element declaration corresponding to the eye, the element declaration on the 04th line is acquired as an element declaration D, and the schema 160 is imported into the original schema 113a. For example, an import element 161 as shown in FIG. 14 (schematic diagram of the import element 161) is added to the original schema 113a.

また、オリジナルスキーマ113aの02行目のnamespace属性の値には、図2に示すスキーマリポジトリテーブル111aのID欄11bが「3」のレコードの対象名前空間URI欄111cに格納されている値を追加し、03行目のschemaLocation属性の値には、図2に示すスキーマリポジトリテーブル111aのID欄111bが「3」のレコードのロケーション欄111dに格納されている値を追加する。   Further, the value stored in the target namespace URI column 111c of the record whose ID column 11b of the schema repository table 111a shown in FIG. 2 is “3” is added to the value of the namespace attribute on the 02nd line of the original schema 113a. Then, the value stored in the location field 111d of the record whose ID column 111b of the schema repository table 111a shown in FIG. 2 is “3” is added to the value of the SchemaLocation attribute on the 03rd line.

一方、ステップS41では、制限候補情報更新部124は、予め定められたエラーメッセージを出力部140に出力して、処理を終了する。なお、ステップS41で出力するエラーメッセージには、対応する要素宣言を有しない要素Eを特定する情報が含まれていることが望ましい。   On the other hand, in step S41, the restriction candidate information update unit 124 outputs a predetermined error message to the output unit 140 and ends the process. Note that the error message output in step S41 preferably includes information for identifying an element E that does not have a corresponding element declaration.

図15は、図11のステップS23のテキストデータの制限候補情報を更新する処理を示すフローチャートである。   FIG. 15 is a flowchart showing the process of updating the restriction candidate information of the text data in step S23 of FIG.

まず、制限候補情報更新部124は、要素Eの要素内容をサンプルデータより取得する(S50)。   First, the restriction candidate information update unit 124 acquires the element content of the element E from the sample data (S50).

次に、制限候補情報更新部124は、制限候補情報記憶領域115に記憶されている第一制限候補テーブル115aに要素宣言Dの情報があるか否かを判断する(S51)。このような情報がない場合には(ステップS51でNo)ステップS52に進み、このような情報がある場合には(ステップS51でYes)ステップS55に進む。   Next, the restriction candidate information update unit 124 determines whether there is information on the element declaration D in the first restriction candidate table 115a stored in the restriction candidate information storage area 115 (S51). If there is no such information (No in Step S51), the process proceeds to Step S52. If such information is present (Yes in Step S51), the process proceeds to Step S55.

ステップS52では、制限候補情報更新部124は、ステップS50で取得した要素内容Cを妥当と判断することのできる制約条件のうち、最も厳しいデータ型を求める(S52)。   In step S52, the restriction candidate information update unit 124 obtains the strictest data type among the constraint conditions that can determine that the element content C acquired in step S50 is valid (S52).

例えば、XML Schemaでは、ビルトイン型と呼ばれる様々なデータ型を規定している。これらのデータ型には、例えば文字列を表すStringや、復帰文字、改行、タブを含まない文字列を表すnormalizedStringなどがある。これらのデータ型には包含関係がある。例えば、normalizedStringはStringを制限することで定義されたデータ型であり、Stringに比べnormalizedStringの方が、制約条件がより厳しい。このようにして、データの包含関係から制約条件の厳しさを比較することができる。   For example, XML Schema defines various data types called built-in types. These data types include, for example, a string that represents a character string and a normalized string that represents a character string that does not include a carriage return, a line feed, or a tab. These data types have an inclusive relationship. For example, normalizedString is a data type defined by restricting String, and normalizedString has stricter constraints than String. In this way, the severity of the constraint condition can be compared from the data inclusion relationship.

従って、スキーマ変換装置100のオペレータは、このようなデータ型の包含関係を考慮して、データ型における制約条件の厳しさの序列を予め定めておき、制限候補情報更新部124に設定しておくことで、ステップS52での判定が可能となる。   Therefore, the operator of the schema conversion apparatus 100 considers such an inclusion relation of the data type, determines in advance the order of the strictness of the constraint condition in the data type, and sets it in the restriction candidate information update unit 124. Thus, the determination in step S52 becomes possible.

なお、本実施形態では、XML Schemaで規定しているビルトイン型の中から制約条件の厳しいデータ型を求める処理を説明したが、他の方法により制約条件の厳しいデータ型を求めてもよい。例えば、本発明の利用者が独自に定義したデータ型の中から制約条件の厳しいデータ型を求めてもよい。例えば、A〜Zの文字と数字から構成される文字列のデータ型などを定義してもよい。また、データ型の派生により包含関係を判断するのではなく、独自の判断方法を定義して使用してもよい。   In the present embodiment, the processing for obtaining a data type with strict constraints from the built-in types defined by XML Schema has been described. However, a data type with strict constraints may be obtained by other methods. For example, a data type with strict constraints may be obtained from data types uniquely defined by the user of the present invention. For example, a data type of a character string composed of letters A to Z and numbers may be defined. Further, instead of determining the inclusion relationship by derivation of the data type, an original determination method may be defined and used.

次に、制限候補情報更新部124は、第一制限候補テーブル115aに新たなレコードを追加して、ステップS52で求めたデータ型の他、必要な情報を格納する(S53)。   Next, the restriction candidate information update unit 124 adds a new record to the first restriction candidate table 115a, and stores necessary information in addition to the data type obtained in step S52 (S53).

具体的には、制限候補情報更新部124は、追加したレコードにおいて、ID欄115bには、上方のレコードから連番となるようにIDの値を格納し、要素宣言ID欄115cには、要素宣言Dを識別することのできる識別情報(本実施形態では、要素宣言Dのname属性の値)を格納し、制約条件の種別欄115dには、「基底型」を示す情報を格納し、制約条件の候補欄115eには、ステップS52で求めたデータ型を示す情報を格納する。   Specifically, in the added record, the restriction candidate information update unit 124 stores the ID value in the ID column 115b so as to be a sequential number from the upper record, and the element declaration ID column 115c stores the element value. The identification information that can identify the declaration D (in this embodiment, the value of the name attribute of the element declaration D) is stored, and the constraint type column 115d stores information indicating “basic type”. Information indicating the data type obtained in step S52 is stored in the condition candidate field 115e.

次に、制限候補情報更新部124は、ステップS50で取得した要素内容Cの値の長さを求め、第一制限候補テーブル115aに新たなレコードを追加して、求めた値の長さの他、必要な情報を格納する(S54)。   Next, the restriction candidate information update unit 124 obtains the length of the value of the element content C acquired in step S50, adds a new record to the first restriction candidate table 115a, and adds the length of the obtained value. The necessary information is stored (S54).

具体的には、制限候補情報更新部124は、追加したレコードにおいて、ID欄115bには、上方のレコードから連番となるようにIDの値を格納し、要素宣言ID欄115cには、要素宣言Dを識別することのできる識別情報(本実施形態では、要素宣言Dのname属性の値)を格納し、制約条件の種別欄115dには、「値の長さ」を示す情報を格納し、制約条件の候補欄115eには、求めた値の長さを示す情報を格納する。   Specifically, in the added record, the restriction candidate information update unit 124 stores the ID value in the ID column 115b so as to be a sequential number from the upper record, and the element declaration ID column 115c stores the element value. Identification information that can identify the declaration D (in this embodiment, the value of the name attribute of the element declaration D) is stored, and information indicating “value length” is stored in the constraint condition type column 115d. The constraint condition candidate field 115e stores information indicating the length of the obtained value.

一方、ステップS55では、制限候補情報更新部124は、ステップS50で取得した要素内容Cを妥当と判断することのできる制約条件のうち、最も厳しいデータ型を求め、第一制限候補テーブル115aの要素宣言Dに対応するレコードであって、制約条件の種別欄115dが「基底型」のレコードの制約条件の候補欄115eに格納されているデータ型と、求めたデータ型と、の両方を包含することのできる最も厳しいデータ型を求め、当該レコードの制約条件の候補欄115eの値と入れ替えることで、第一制限候補テーブル115aを更新する(S55)。   On the other hand, in step S55, the restriction candidate information update unit 124 obtains the strictest data type among the constraints that can determine that the element content C acquired in step S50 is valid, and the element of the first restriction candidate table 115a. The record corresponding to the declaration D includes both the data type stored in the constraint condition candidate field 115e of the record whose constraint condition type field 115d is “basic type” and the obtained data type. The first restriction candidate table 115a is updated by obtaining the strictest data type that can be used and replacing the value in the candidate field 115e of the constraint condition of the record (S55).

次に、制限候補情報更新部124は、ステップS50で取得した要素内容Cの値の長さを求め、第一制限候補テーブル115aの要素宣言Dに対応するレコードであって、制約条件の種別欄115dが「値の長さ」のレコードの制約条件の候補欄115eに格納されている値の長さと、求めた値の長さと、の両方を含む値の長さの範囲を求め、当該レコードの制約条件の候補欄115eの値と入れ替えることで、第一制限候補テーブル115aを更新する(S56)。   Next, the restriction candidate information updating unit 124 obtains the length of the value of the element content C acquired in step S50, is a record corresponding to the element declaration D of the first restriction candidate table 115a, and includes a restriction condition type field. The range of the value length including both the length of the value stored in the candidate field 115e of the constraint condition of the record whose 115d is “value length” and the length of the obtained value is obtained. The first restriction candidate table 115a is updated by replacing the value in the restriction condition candidate field 115e (S56).

以上に記載した図15のフローチャートにおける処理を、図4に示すオリジナルスキーマ113a及び図5に示すサンプルデータ114aに基づいて、具体的に説明する。ここで、第一制限候補テーブル115aは初期状態であって、制限候補情報を格納するレコードは設けられていないものとして説明する。   The processing in the flowchart of FIG. 15 described above will be specifically described based on the original schema 113a shown in FIG. 4 and the sample data 114a shown in FIG. Here, it is assumed that the first restriction candidate table 115a is in an initial state, and no record for storing restriction candidate information is provided.

まず、制限候補情報更新部124は、要素Eがサンプルデータ114aの04行目のCustomerName要素である場合には、当該CustomerName要素の要素内容である「john」を取得する(S50)。   First, if the element E is the CustomerName element on the 04th line of the sample data 114a, the restriction candidate information updating unit 124 acquires “john” that is the element content of the CustomerName element (S50).

次に、制限候補情報更新部124は、第一制限候補テーブル115aの要素宣言ID欄115cにCustomerName要素宣言の情報があるか判定する(S51)。第一制限候補テーブル115aは、初期状態ではレコードを持たないためCustomerName要素宣言の情報はないものとする。   Next, the restriction candidate information update unit 124 determines whether there is information on the CustomerName element declaration in the element declaration ID column 115c of the first restriction candidate table 115a (S51). Since the first restriction candidate table 115a has no record in the initial state, it is assumed that there is no information on the CustomerName element declaration.

次に、制限候補情報更新部124は、ステップS50で取得した要素内容である「john」が含まれるなるべく制約条件の厳しいデータ型を求める。本実施形態では、制限候補情報更新部124は、XML Schemaのビルトイン型からなるべく制約条件の厳しいデータ型を求めることでNCNameのデータ型が求まる。ここで、NCNameのデータ型は、normalizedStringのデータ型を、さらに複数回派生させたデータ型あり、コロン「:」を含まないという特徴を持つ。   Next, the restriction candidate information update unit 124 obtains a data type with the most restrictive conditions as much as possible, including the element content “john” acquired in step S50. In the present embodiment, the restriction candidate information update unit 124 obtains the data type of NCName by obtaining a data type that is as restrictive as possible from the built-in type of XML Schema. Here, the data type of NCName is a data type derived from the normalizedString data type a plurality of times, and does not include a colon “:”.

次に、制限候補情報更新部124は、第一制限候補テーブル115aに新たなレコードを追加して、ID欄115bには「1」の値を、要素宣言IDにはCustomerName要素の要素宣言IDである「CustomerName」を格納し、制約条件の種別欄115dには、「基底型」を格納し、制約条件の候補欄115eには、ステップS52で求めた「NCName」を格納する(S53)。   Next, the restriction candidate information update unit 124 adds a new record to the first restriction candidate table 115a, the value “1” in the ID column 115b, and the element declaration ID of the CustomerName element as the element declaration ID. “CustomerName” is stored, “basic type” is stored in the constraint type column 115d, and “NCName” obtained in step S52 is stored in the constraint candidate column 115e (S53).

次に、制限候補情報更新部124は、要素内容であるjohnの値の長さである4を求め、第一制限候補テーブル115aに新たなレコードを追加して、ID欄115bには「2」の値を、要素宣言IDにはCustomerName要素の要素宣言IDである「CustomerName」を格納し、制約条件の種別欄115dには、「基底型」を格納し、制約条件の候補欄115eには、求めた「2」の値を格納する(S54)。   Next, the restriction candidate information updating unit 124 obtains 4 which is the length of the value of the element element John, adds a new record to the first restriction candidate table 115a, and sets “2” in the ID column 115b. The element declaration ID stores “CustomerName” which is the element declaration ID of the CustomerName element, the constraint type column 115d stores “base type”, and the constraint condition candidate column 115e includes The obtained value of “2” is stored (S54).

以上の処理を行うことで、第一制限候補テーブル115aにID欄115bが「1」及び「2」で識別されるレコードが追加される。   By performing the above processing, a record in which the ID column 115b is identified by “1” and “2” is added to the first restriction candidate table 115a.

次に、制限候補情報更新部124は、要素Eがサンプルデータ114aの05行目のTelephone要素である場合には、上述の04行目のCustomerName要素の場合と同様の処理を行い、第一制限候補テーブル115aにID「3」及び「4」で識別されるレコードが追加される。   Next, when the element E is the Telephone element on the 05th line of the sample data 114a, the restriction candidate information updating unit 124 performs the same process as that of the CustomerName element on the 04th line, and performs the first restriction. Records identified by IDs “3” and “4” are added to the candidate table 115a.

サンプルデータ114aにおける次の要素はCustomerInfo要素であるが、この要素に対する処理は図16で説明する。   The next element in the sample data 114a is a CustomerInfo element. Processing for this element will be described with reference to FIG.

次に、制限候補情報更新部124は、要素Eがサンプルデータ114aの08行目のProductName要素である場合、および、Quantity要素である場合には、上述のCustomerName要素の場合と同様の処理を行い、第一制限候補テーブル115aにID「5」〜「8」で識別されるレコードが追加される。但し、図6に示した第一制限候補テーブル115aでは、ID「6」に示すレコードの制約条件の候補欄115eには「8〜9」の値が格納されているが、要素Eがサンプルデータ114aの08行目のProductName要素である場合は、要素内容「LaptopPC」の値の長さに対応する「8」の値が格納され、また、ID「8」に示すレコードの制約条件の候補欄115eには「1〜2」の値が格納されているが、要素Eがサンプルデータ114aの09行目のQuantity要素である場合は、要素内容「1」の値の長さに対応する「1」の値が格納される。   Next, when the element E is the ProductName element on the 08th line of the sample data 114a and the Quantity element, the restriction candidate information update unit 124 performs the same processing as in the case of the CustomerName element described above. The records identified by the IDs “5” to “8” are added to the first restriction candidate table 115a. However, in the first restriction candidate table 115a shown in FIG. 6, the value “8 to 9” is stored in the candidate field 115e of the constraint condition of the record indicated by the ID “6”, but the element E is sample data. In the case of the ProductName element on line 08 of 114a, the value of “8” corresponding to the length of the value of the element content “LaptopPC” is stored, and the candidate field for the constraint condition of the record indicated by ID “8” 115e stores a value of “1-2”, but if the element E is a Quantity element on the 09th line of the sample data 114a, “1” corresponding to the length of the value of the element content “1” is stored. "Is stored.

サンプルデータ114aにおける次の要素はPurchaseInfo要素であるが、この要素に対する処理は図16で説明する。   The next element in the sample data 114a is a PurchaseInfo element. The processing for this element will be described with reference to FIG.

次に、制限候補情報更新部124は、要素Eがサンプルデータ114aの12行目のProductName要素である場合には、当該ProductName要素の要素内容である「USBMemory」を取得する(S50)。   Next, when the element E is the ProductName element on the 12th line of the sample data 114a, the restriction candidate information update unit 124 acquires “USBMemory” that is the element content of the ProductName element (S50).

次に、制限候補情報更新部124は、第一制限候補テーブル115aの要素宣言ID欄115cにProductName要素宣言の情報があるか判定する(S51)。ここで、上述の処理により、第一制限候補テーブル115aには、ID欄115bが「5」及び「6」のレコードにおける要素宣言ID欄115cに「ProductName」が格納されているため、ステップS55に進む。   Next, the restriction candidate information update unit 124 determines whether or not there is information on the ProductName element declaration in the element declaration ID column 115c of the first restriction candidate table 115a (S51). Here, since “ProductName” is stored in the element declaration ID column 115c in the record whose ID column 115b is “5” and “6” in the first restriction candidate table 115a by the above-described processing, the process proceeds to step S55. move on.

ステップS55では、制限候補情報更新部124は、処理中の要素の要素内容を含む制約条件の厳しいデータ型と、既に第一制限候補テーブル115aに格納されているデータ型の両方を含むデータ型のうち最も厳しい制限となるものを求める。   In step S55, the restriction candidate information update unit 124 has a data type including both a strict data type including the element contents of the element being processed and a data type already stored in the first restriction candidate table 115a. Find the most restrictive one.

ここでは、処理中のProductName要素の要素内容であるUSBMemoryを含む制約条件の厳しいデータ型はNCNameであり、既に第一制限候補テーブル115aに登録されているProductName要素宣言のデータ型はNCNameであるため、両方のデータ型を含むデータ型もNCNameとなる。   In this example, the data type with severe restrictions including the USBMemory that is the element content of the ProductName element being processed is NCName, and the data type of the ProductName element declaration already registered in the first restriction candidate table 115a is NCName. The data type including both data types is also NCName.

次に、制限候補情報更新部124は、処理中の要素の要素内容「USBMemory」の値の長さ「9」を取得し、既に第一制限候補テーブル115aに格納されている値の長さ「8」の両方を満たす値の長さの範囲「8〜9」を求め、第一制限候補テーブル115aの要素宣言ID欄115cに「ProductName」、制約条件の種別115dに「値の長さ」、が格納されているレコードの制約条件の候補欄115eの値を「8〜9」に更新する(S56)。   Next, the restriction candidate information update unit 124 acquires the value length “9” of the element content “USBMemory” of the element being processed, and the length of the value already stored in the first restriction candidate table 115a “ 8 ”is obtained,“ ProductName ”is stored in the element declaration ID field 115c of the first restriction candidate table 115a,“ Value length ”is stored in the constraint type 115d, Is updated to “8 to 9” (S56).

以上の処理を行うことで、第一制限候補テーブル115aのID欄115bが「5」及び「6」で識別されるレコードの更新が行われる。   By performing the above processing, the record identified by “5” and “6” in the ID column 115b of the first restriction candidate table 115a is updated.

次に、制約候補情報更新部124は、要素Eがサンプルデータ114aの13行目のQuantity要素である場合の処理を行うが、この処理は、要素Eがサンプルデータ114aの12行目のProductName要素である場合の処理と同様であるため、説明を省略する。   Next, the constraint candidate information update unit 124 performs processing when the element E is the Quantity element on the 13th row of the sample data 114a. This processing is performed in the ProductName element on the 12th row of the sample data 114a. Since this is the same as the processing in the case of

次に、制限候補情報更新部124は、要素Eがサンプルデータ114aの14行目のDiscount要素である場合には、上述の04行目のCustomerName要素の場合と同様の処理を行い、第一制限候補テーブル115aにID「9」及び「10」で識別されるレコードが追加される。   Next, when the element E is the Discont element on the 14th line of the sample data 114a, the restriction candidate information update unit 124 performs the same process as the case of the CustomerName element on the 04th line, and performs the first restriction. Records identified by IDs “9” and “10” are added to the candidate table 115a.

サンプルデータ114aにおける次の要素はPurchaseInfo要素であり、その次は、PurchaseOrder要素であるが、これらの要素に対する処理は図16で説明する。   The next element in the sample data 114a is a PurchaseInfo element, and the next element is a PurchaseOrder element. Processing for these elements will be described with reference to FIG.

図16は、図11のステップS24の子要素の制限候補情報を更新する処理を示すフローチャートである。   FIG. 16 is a flowchart showing the process of updating the candidate restriction information of the child element in step S24 of FIG.

まず、制限候補情報更新部124は、サンプルデータ114aより、要素Eの子要素のリストLを取得する(S60)。例えば、制限候補情報更新部124は、要素Eの子要素の要素名をカンマ(,)で区切って羅列することにより、リストLを取得する。   First, the restriction candidate information update unit 124 acquires a list L of child elements of the element E from the sample data 114a (S60). For example, the restriction candidate information update unit 124 acquires the list L by listing the element names of the child elements of the element E by separating them with commas (,).

次に、制限候補情報更新部124は、制限候補情報記憶領域115に記憶されている第二制限候補テーブル115gに、要素宣言Dの情報があるか否かを判断する(S61)。このような情報がない場合には(ステップS61でNo)ステップS62に進み、このような情報がある場合には(ステップS61でYes)ステップS70に進む。   Next, the restriction candidate information update unit 124 determines whether or not there is information on the element declaration D in the second restriction candidate table 115g stored in the restriction candidate information storage area 115 (S61). If there is no such information (No in step S61), the process proceeds to step S62. If such information is present (Yes in step S61), the process proceeds to step S70.

ステップS62では、制限候補情報更新部124は、オリジナルスキーマ113aにおける要素宣言Dの子要素内に、choice要素があるか否かを判断する。そして、このようなchoice要素がある場合には(ステップS62でYes)ステップS63に進み、ない場合には(ステップS62でNo)ステップS65に進む。   In step S62, the restriction candidate information update unit 124 determines whether there is a choice element in the child element of the element declaration D in the original schema 113a. If such a choice element is present (Yes in step S62), the process proceeds to step S63, and if not (No in step S62), the process proceeds to step S65.

ステップS63では、制限候補情報更新部124は、オリジナルスキーマ113aより、要素宣言Dにおけるchoice要素の子要素のパーティクルを取得する。   In step S63, the restriction candidate information update unit 124 acquires particles of child elements of the choice element in the element declaration D from the original schema 113a.

次に、制限候補情報更新部124は、ステップS63で取得したパーティクルのうち、サンプルデータ114aの要素Eの子要素として選択されているものを特定し、第二制限候補テーブル115gに新たなレコードを追加して、特定した子要素を示す情報とともに、必要な情報を追加したレコードに格納する(S64)。   Next, the restriction candidate information update unit 124 identifies the particles selected as the child element of the element E of the sample data 114a among the particles acquired in step S63, and adds a new record to the second restriction candidate table 115g. In addition to the information indicating the specified child element, necessary information is stored in the added record (S64).

具体的には、制限候補情報更新部124は、追加したレコードにおいて、ID欄115hには、上方のレコードから連番となるようにIDの値を格納し、要素宣言ID欄115iには、要素宣言Dのname属性の値を示す情報を格納し、パーティクルID欄115jには、「choice」を示す情報を格納し、制約条件の種別欄115kには、「出現パーティクル」を示す情報を格納し、制約条件の候補欄115eには、ステップS64で特定した子要素を示す情報を格納する。   Specifically, in the added record, the restriction candidate information update unit 124 stores the ID value in the ID column 115h so as to be a sequential number from the upper record, and the element declaration ID column 115i stores the element value. Information indicating the value of the name attribute of the declaration D is stored, information indicating “choice” is stored in the particle ID column 115j, and information indicating “appearing particle” is stored in the type column 115k of the constraint condition. In the constraint condition candidate field 115e, information indicating the child element specified in step S64 is stored.

次に、制限候補情報更新部124は、オリジナルスキーマ113aにおける要素宣言Dの子要素内に、出現回数が固定でないパーティクルがあるか否かを判断する(S65)。そして、このようなパーティクルがある場合には(ステップS65でYes)ステップS66に進み、ない場合には(ステップS65でNo)ステップS68に進む。   Next, the restriction candidate information updating unit 124 determines whether or not there is a particle whose appearance count is not fixed in the child element of the element declaration D in the original schema 113a (S65). If such a particle is present (Yes in step S65), the process proceeds to step S66. If not (No in step S65), the process proceeds to step S68.

ここで、XML Schemaでは、各パーティクルはminOccurs属性とmaxOccurs属性を持つことができる。minOccurs属性はパーティクルの最小出現回数を表し、maxOccurs属性はパーティクルの最大出現回数を表す。   Here, in the XML Schema, each particle can have a minOccurs attribute and a maxOccurs attribute. The minOccurs attribute represents the minimum number of appearances of particles, and the maxOccurs attribute represents the maximum number of appearances of particles.

また、minOccurs属性を省略した場合は、パーティクルの最小出現回数が1回であることを表す。maxOccurs属性を省略した場合は、パーティクルの最大出現回数が1回であることを表す。   When the minOccurs attribute is omitted, it represents that the minimum number of appearances of the particle is one. When the maxOccurs attribute is omitted, it indicates that the maximum number of appearances of the particle is one.

さらに、maxOccurs属性の値がunboundedの場合、最大出現回数の制限がないことを表す。   Furthermore, when the value of the maxOccurs attribute is unbounded, it indicates that there is no limit on the maximum number of appearances.

従って、要素宣言Dにおけるパーティクルにおいて、minOccurs属性で特定される値よりもmaxOccurs属性で特定される値が大きい場合、minOccurs属性が省略されており、maxOccurs属性で特定される値が「2」以上である場合、または、maxOccurs属性の値がunboundedの場合は、出現回数が固定でないパーティクルであると判断できる。   Therefore, in the particle in the element declaration D, when the value specified by the maxOccurs attribute is larger than the value specified by the minOccurs attribute, the minOccurs attribute is omitted, and the value specified by the maxOccurs attribute is “2” or more. In some cases, or when the value of the maxOccurs attribute is unbounded, it can be determined that the number of appearances is not fixed.

ステップS66では、制限候補情報更新部124は、オリジナルスキーマ113aより、要素宣言Dにおける出現回数が固定でないパーティクルを取得する。   In step S66, the restriction candidate information update unit 124 acquires particles whose number of appearances in the element declaration D is not fixed from the original schema 113a.

次に、制限候補情報更新部124は、ステップS66で取得したパーティクルの出現回数を、サンプルデータ114aの要素Eの子要素から特定し、第二制限候補テーブル115gに新たなレコードを追加して、特定した出現回数を示す情報とともに、必要な情報を追加したレコードに格納する(S67)。   Next, the restriction candidate information update unit 124 specifies the number of appearances of the particle acquired in step S66 from the child element of the element E of the sample data 114a, adds a new record to the second restriction candidate table 115g, Along with the information indicating the identified number of appearances, the necessary information is stored in the added record (S67).

具体的には、制限候補情報更新部124は、追加したレコードにおいて、ID欄115hには、上方のレコードから連番となるようにIDの値を格納し、要素宣言ID欄115iには、要素宣言Dのname属性の値を示す情報を格納し、パーティクルID欄115jには、出現回数が固定でないパーティクルを示す情報(ここでは、当該パーティクルの要素名)を格納し、制約条件の種別欄115kには、「出現回数」を示す情報を格納し、制約条件の候補欄115eには、ステップS67で特定した出現回数を示す情報を格納する。   Specifically, in the added record, the restriction candidate information update unit 124 stores the ID value in the ID column 115h so as to be a sequential number from the upper record, and the element declaration ID column 115i stores the element value. Information indicating the value of the name attribute of the declaration D is stored, information indicating a particle whose number of appearances is not fixed (here, the element name of the particle) is stored in the particle ID column 115j, and the constraint type column 115k. Stores information indicating “number of appearances”, and information indicating the number of appearances specified in step S67 is stored in the constraint condition candidate field 115e.

次に、制限候補情報更新部124は、オリジナルスキーマ113aにおける要素宣言Dの子要素内に、any要素があるか否かを判断する(S68)。そして、any要素がある場合には(ステップS68でYes)ステップS69に進み、ない場合には(ステップS68でNo)処理を終了する。   Next, the restriction candidate information update unit 124 determines whether there is an any element in the child elements of the element declaration D in the original schema 113a (S68). If there is an any element (Yes in step S68), the process proceeds to step S69. If there is no any element (No in step S68), the process ends.

ステップS69では、制限候補情報更新部124は、ステップS60で取得したリストLにおいて、any要素に対応する子要素の出現回数と、当該子要素を示す情報と、を特定し、第二制限候補テーブル115gに新たなレコードを二つ追加して、特定した出現回数を示す情報と、特定した子要素を示す情報と、を必要な情報とともに追加したレコードの各々に格納する。   In step S69, the restriction candidate information update unit 124 identifies the number of appearances of the child element corresponding to the any element and information indicating the child element in the list L acquired in step S60, and the second restriction candidate table. Two new records are added to 115g, and information indicating the specified number of appearances and information indicating the specified child element are stored in each of the added records together with necessary information.

具体的には、制限候補情報更新部124は、追加したレコードにおいて、ID欄115hには、上方のレコードから連番となるようにIDの値を格納し、パーティクルID欄115jには、「any」を示す情報を格納し、制約条件の種別欄115kには、「出現回数」を示す情報を格納し、制約条件の候補欄115eには、ステップS69で特定した出現回数を特定する情報を格納する。   Specifically, in the added record, the restriction candidate information update unit 124 stores the ID value in the ID column 115h so as to be a sequential number from the upper record, and “any” in the particle ID column 115j. Is stored in the constraint condition type column 115k, and information indicating the number of appearances specified in step S69 is stored in the constraint condition candidate column 115e. To do.

また、制限候補情報更新部124は、追加したレコードにおいて、ID欄115hには、上方のレコードから連番となるようにIDの値を格納し、要素宣言ID欄115iには、要素宣言Dのname属性の値を示す情報を格納し、パーティクルID欄115jには、「any」を示す情報を格納し、制約条件の種別欄115kには、「出現要素」を示す情報を格納し、制約条件の候補欄115eには、ステップS69で特定した子要素を示す情報(ここでは、子要素名)を格納する。ここで、出現する子要素が複数ある場合には、子要素の要素名をカンマ(,)で区切る等により、各々の子要素を識別可能に格納する。   Further, in the added record, the restriction candidate information update unit 124 stores the ID value in the ID column 115h so as to be a sequential number from the upper record, and the element declaration ID column 115i stores the element declaration D. The information indicating the value of the name attribute is stored, the information indicating “any” is stored in the particle ID column 115j, the information indicating “appearing element” is stored in the constraint type column 115k, and the constraint condition In the candidate column 115e, information (here, the child element name) indicating the child element specified in step S69 is stored. Here, when there are a plurality of appearing child elements, each child element is stored so as to be identifiable, for example, by separating the element names of the child elements with commas (,).

一方、ステップS70では、制限候補情報更新部124は、オリジナルスキーマ113aにおける要素宣言Dの子要素内に、choice要素があるか否かを判断する。そして、このようなchoice要素がある場合には(ステップS70でYes)ステップS71に進み、ない場合には(ステップS70でNo)ステップS73に進む。   On the other hand, in step S70, the restriction candidate information update unit 124 determines whether there is a choice element in the child elements of the element declaration D in the original schema 113a. If such a choice element is present (Yes in step S70), the process proceeds to step S71. If not (No in step S70), the process proceeds to step S73.

ステップS71では、制限候補情報更新部124は、オリジナルスキーマ113aより、要素宣言Dにおけるchoice要素の子要素のパーティクルを取得する。   In step S71, the restriction candidate information update unit 124 acquires particles of child elements of the choice element in the element declaration D from the original schema 113a.

次に、制限候補情報更新部124は、ステップS71で取得したパーティクルのうち、サンプルデータ114aの要素Eの子要素として選択されているものを特定し、第二制限候補テーブル115gの対応するレコードに、特定した子要素を示す情報を追加等する(S72)。   Next, the restriction candidate information update unit 124 identifies the particles selected as the child element of the element E of the sample data 114a among the particles acquired in step S71, and sets the corresponding records in the second restriction candidate table 115g. Then, information indicating the specified child element is added (S72).

具体的には、制限候補情報更新部124は、第二制限候補テーブル115gの要素宣言ID欄に要素宣言Dのname属性の値を示す情報が格納され、パーティクルID欄115jにchoiceを示す情報が格納されているレコードにおいて、制約条件の候補欄115eに、ステップS72で特定した子要素を示す情報が未だ格納されていない場合には、当該子要素を示す情報を格納する。   Specifically, the restriction candidate information update unit 124 stores information indicating the value of the name attribute of the element declaration D in the element declaration ID field of the second restriction candidate table 115g, and information indicating the choice in the particle ID field 115j. In the stored record, when the information indicating the child element specified in step S72 is not yet stored in the restriction condition candidate field 115e, the information indicating the child element is stored.

次に、制限候補情報更新部124は、オリジナルスキーマ113aにおける要素宣言Dの子要素内に、出現回数が固定でないパーティクルがあるか否かを判断する(S73)。そして、このようなパーティクルがある場合には(ステップS73でYes)ステップS74に進み、ない場合には(ステップS73でNo)ステップS76に進む。   Next, the restriction candidate information update unit 124 determines whether or not there is a particle whose appearance count is not fixed in the child element of the element declaration D in the original schema 113a (S73). If such a particle is present (Yes in step S73), the process proceeds to step S74. If not (No in step S73), the process proceeds to step S76.

ステップS74では、制限候補情報更新部124は、オリジナルスキーマ113aより、要素宣言Dにおける出現回数が固定でないパーティクルを取得する。   In step S74, the restriction candidate information update unit 124 acquires particles whose number of appearances in the element declaration D is not fixed from the original schema 113a.

次に、制限候補情報更新部124は、ステップS74で取得したパーティクルの出現回数を、サンプルデータ114aの要素Eの子要素から特定し、第二制限候補テーブル115gの対応するレコードに、特定した出現回数を示す情報を追加等する(S75)。   Next, the restriction candidate information update unit 124 identifies the number of appearances of the particle acquired in step S74 from the child element of the element E of the sample data 114a, and identifies the occurrence in the corresponding record of the second restriction candidate table 115g. Information indicating the number of times is added (S75).

具体的には、制限候補情報更新部124は、第二制限候補テーブル115gにおいて、要素宣言ID欄115iに要素宣言Dのname属性の値を示す情報が格納され、パーティクルID欄115jに出現回数が固定でないパーティクルを示す情報が格納されているレコードの制約条件の候補欄115eに格納されている数値に、ステップS74で特定した数値を加算する。   Specifically, the restriction candidate information update unit 124 stores information indicating the value of the name attribute of the element declaration D in the element declaration ID field 115i and the number of appearances in the particle ID field 115j in the second restriction candidate table 115g. The numerical value specified in step S74 is added to the numerical value stored in the constraint condition candidate field 115e of the record in which information indicating particles that are not fixed is stored.

次に、制限候補情報更新部124は、オリジナルスキーマ113aにおける要素宣言Dの子要素内に、any要素があるか否かを判断する(S76)。そして、any要素がある場合には(ステップS76でYes)ステップS77に進み、ない場合には(ステップS76でNo)処理を終了する。   Next, the restriction candidate information update unit 124 determines whether there is an any element in the child element of the element declaration D in the original schema 113a (S76). If there is an any element (Yes in step S76), the process proceeds to step S77. If there is no any element (No in step S76), the process ends.

ステップS76では、制限候補情報更新部124は、ステップS60で取得したリストLにおいて、any要素に対応する子要素の出現回数と、当該子要素を示す情報と、を特定し、第二制限候補テーブル115gの対応する二つのレコードを選択して、特定した出現回数を示す情報と、特定した子要素を示す情報と、を追加等する。   In step S76, the restriction candidate information update unit 124 identifies the number of appearances of the child element corresponding to the any element and information indicating the child element in the list L acquired in step S60, and sets the second restriction candidate table. Two corresponding records of 115g are selected, and information indicating the specified number of appearances and information indicating the specified child element are added.

具体的には、制限候補情報更新部124は、第二制限候補テーブル115gにおいて、要素宣言ID欄115iに要素宣言Dのname属性の値を示す情報が格納され、パーティクルID欄115jに「any」を示す情報が格納され、制約条件の種別欄115kに「出現回数」を示す情報が格納されているレコードを選択し、制約条件の候補欄115eに格納されている数値に、ステップS76で特定した出現回数を加算する。   Specifically, the restriction candidate information update unit 124 stores information indicating the value of the name attribute of the element declaration D in the element declaration ID field 115i and “any” in the particle ID field 115j in the second restriction candidate table 115g. Is selected, the record in which the information indicating “number of occurrences” is stored in the restriction condition type column 115k, and the numerical value stored in the restriction condition candidate column 115e is specified in step S76. Add the number of appearances.

また、制限候補情報更新部124は、第二制限候補テーブル115gにおいて、要素宣言ID欄115iに要素宣言Dのname属性の値を示す情報が格納され、パーティクルID欄115jに「any」を示す情報が格納され、制約条件の種別欄115kに「出現要素」を示す情報が格納されているレコードを選択し、制約条件の候補欄115eに、ステップS77で特定した子要素を示す情報が格納されていない場合には、当該子要素を示す情報を追加する。   In addition, in the second restriction candidate table 115g, the restriction candidate information update unit 124 stores information indicating the value of the name attribute of the element declaration D in the element declaration ID field 115i, and information indicating “any” in the particle ID field 115j. Is selected, a record in which information indicating “appearing element” is stored in the constraint condition type column 115k, and information indicating the child element specified in step S77 is stored in the constraint condition candidate column 115e. If not, information indicating the child element is added.

以上に記載した図16のフローチャートにおける処理を、図4に示すオリジナルスキーマ113a及び図5に示すサンプルデータ114aに基づいて、具体的に説明する。ここで、第二制限候補テーブル115gは初期状態であって、制限候補情報を格納するレコードは設けられていないものとして説明する。   The processing in the flowchart of FIG. 16 described above will be specifically described based on the original schema 113a shown in FIG. 4 and the sample data 114a shown in FIG. Here, it is assumed that the second restriction candidate table 115g is in an initial state, and no record for storing restriction candidate information is provided.

まず、要素Eがサンプルデータ114aの03行目から06行目までのCustomerInfo要素である場合には、制限候補情報更新部124は、CustomerInfo要素の子要素を特定し、リストLを取得する(S60)。ここで、CustomerInfo要素は04行目のCustomerName要素と、05行目のTelephone要素と、の2つの子要素を持つため、リストLとして、[CustomerName,Telephone]を取得する。子要素のリストLは、子要素の要素名をカンマ(,)で区切ることで各々の子要素を識別している。   First, when the element E is a CustomerInfo element from the 03rd line to the 06th line of the sample data 114a, the restriction candidate information update unit 124 specifies a child element of the CustomerInfo element and acquires the list L (S60). ). Here, since the CustomerInfo element has two child elements, a CustomerName element on the 04th line and a Telephone element on the 05th line, [CustomerName, Telephone] is acquired as the list L. The child element list L identifies each child element by separating the element names of the child elements with a comma (,).

次に、制限候補情報更新部124は、第二制限候補テーブル115gにCustomerInfo要素宣言のレコードがあるか判定する(S61)。第二制限候補テーブル115gは、初期状態ではレコードを持たないためCustomerInfo要素のレコードはない。そのため、ステップS62に進む。   Next, the restriction candidate information update unit 124 determines whether there is a record of a CustomerInfo element declaration in the second restriction candidate table 115g (S61). Since the second restriction candidate table 115g has no record in the initial state, there is no record of the CustomerInfo element. Therefore, it progresses to step S62.

次に、制限候補情報更新部124は、CustomerInfo要素宣言内にchoice要素があるか否かを判定する(S62)。   Next, the restriction candidate information update unit 124 determines whether there is a choice element in the CustomerInfo element declaration (S62).

ここで、オリジナルスキーマ113aには、15行目から18行目までにchoice要素があるため、ステップS63に進む。   Here, since the original schema 113a has a choice element from the 15th line to the 18th line, the process proceeds to step S63.

ステップS63では、制限候補情報更新部124は、オリジナルスキーマ113aよりchoice要素(15行目から18行目)を取得する。   In step S63, the restriction candidate information update unit 124 acquires a choice element (from the 15th line to the 18th line) from the original schema 113a.

ここで、取得したchoice要素の子要素には、16行目のelement要素(<element ref=“Telephone”>)と17行目のelement要素(<element ref=“Email”>)の2つのパーティクルが存在する。これは、XML文書の対応する箇所にTelephone要素かEmail要素のどちらかが出現しなくてはならないという制約条件を表す。   Here, the child element of the acquired choice element includes two particles of an element element on the 16th line (<element ref = “Telephone”>) and an element element on the 17th line (<element ref = “Email”>). Exists. This represents a constraint condition that either a Telephone element or an Email element must appear at a corresponding location in the XML document.

次に、制限候補情報更新部124は、ステップS71で取得したchoice要素の子要素のパーティクルのうち、サンプルデータ114aにおいて選択されたものを特定し、第二制限候補テーブル115gに格納する(S72)。   Next, the restriction candidate information update unit 124 identifies the particles selected in the sample data 114a among the child elements of the choice element acquired in step S71, and stores them in the second restriction candidate table 115g (S72). .

具体的には、制限候補情報更新部124は、ステップS60で取得したCustomerInfo要素の子要素のリストL[CustomerName,Telephone]から、choice要素の子要素のパーティクルであるTelephone要素とEmail要素のうち、Telephone要素の方が出現していることが分かる。よって、サンプルデータ114aにおいて選択されたのは16行目のelement要素(<element ref=“Telephone”>)であることが分かる。ここで、本element要素のパーティクルIDを「Telephone」とする。   Specifically, the restriction candidate information update unit 124 selects, from among the Telephone element and Email element, which are the child element particles of the choice element, from the child element list L [CustomerName, Telephone] of the CustomerInfo element acquired in step S60. It can be seen that the Telephone element appears. Therefore, it is understood that the element element (<element ref = “Telephone”>) on the 16th row is selected in the sample data 114a. Here, the particle ID of the element element is “Telephone”.

そして、制限候補情報更新部124は、第二制限候補テーブル115gに新たなレコードを追加して、ID欄115hには、上方のレコードから連番となるようにIDの値を格納し、要素宣言ID欄115iには、処理対象となっているCustomerInfo要素の要素宣言IDである「CustomerInfo」を格納し、パーティクルID欄115jには、処理対象となっているchoice要素のパーティクルIDである「choice」を格納し、制約条件の種別欄115kには「出現パーティクル」を格納し、制約条件の候補欄115lには、サンプルデータ114aにおいて選択されたパーティクルのパーティクルIDである「Telephone」を格納する。   Then, the restriction candidate information update unit 124 adds a new record to the second restriction candidate table 115g, and stores the ID value in the ID column 115h so that the sequential number starts from the upper record. The ID column 115i stores “CustomerInfo” that is the element declaration ID of the CustomerInfo element that is the processing target, and the particle ID column 115j stores “choice” that is the particle ID of the choice element that is the processing target. “Appearing particle” is stored in the constraint type column 115k, and “Telephone” that is the particle ID of the particle selected in the sample data 114a is stored in the constraint candidate column 115l.

次に、制限候補情報更新部124は、CustomerInfo要素宣言内に、出現回数が固定でないパーティクルがあるか否かを判定する(S65)。   Next, the restriction candidate information update unit 124 determines whether or not there is a particle whose appearance count is not fixed in the CustomerInfo element declaration (S65).

ここで、CustomerInfo要素宣言内に含まれるパーティクルは、全てminOccurs属性及びmaxOccurs属性を省略しているため、出現回数が1回に固定されており、出現回数が固定でないパーティクルは存在しない。従って、ステップS68に進む。   Here, since all the particles included in the CustomerInfo element declaration omit the minOccurs attribute and the maxOccurs attribute, the number of appearances is fixed to one, and there is no particle whose appearance number is not fixed. Accordingly, the process proceeds to step S68.

次に、制限候補情報更新部124は、CustomerInfo要素宣言内に、any要素があるか否かを判定する(S68)。ここで、CustomerInfo要素宣言内にany要素は存在しないため、制限候補情報更新部124は、CustomerInfo要素に対する制限候補情報の更新処理を終了する。   Next, the restriction candidate information update unit 124 determines whether there is an any element in the CustomerInfo element declaration (S68). Here, since there is no any element in the CustomerInfo element declaration, the restriction candidate information update unit 124 ends the restriction candidate information update process for the CustomerInfo element.

次に、要素Eがサンプルデータ114aの07行目から10行目までのPurchaseInfo要素である場合には、制限候補情報更新部124は、PurchaseInfo要素の子要素を特定し、リストLを取得する(S60)。ここで、PurchaseInfo要素の子要素のリストLは、[ProductName,Quantity]となる。   Next, when the element E is a PurchaseInfo element from the 07th line to the 10th line of the sample data 114a, the restriction candidate information update unit 124 specifies a child element of the PurchaseInfo element and acquires the list L ( S60). Here, the list L of child elements of the PurchaseInfo element is [ProductName, Quantity].

次に、制限候補情報更新部124は、第二制限候補テーブル115gにPurchaseInfo要素宣言に対応する情報があるか判定する(S61)。ここでは、第二制限候補テーブル115gには、PurchaseInfo要素宣言の情報はないものとする。そのため、ステップS62に進む。   Next, the restriction candidate information update unit 124 determines whether there is information corresponding to the PurchaseInfo element declaration in the second restriction candidate table 115g (S61). Here, it is assumed that there is no information on the PurchaseInfo element declaration in the second restriction candidate table 115g. Therefore, it progresses to step S62.

次に、制限候補情報更新部124は、PurchaseInfo要素宣言内に、choice要素があるか否かを判定する(S62)。ここで、オリジナルスキーマ113aのPurchaseInfo要素宣言(22行目から30行目)には、choice要素は存在しないため、ステップS65に進む。   Next, the restriction candidate information update unit 124 determines whether there is a choice element in the PurchaseInfo element declaration (S62). Here, since the choice element does not exist in the PurchaseInfo element declaration (from the 22nd line to the 30th line) of the original schema 113a, the process proceeds to step S65.

次に、制限候補情報更新部124は、PurchaseInfo要素宣言内に、出現回数が固定でないパーティクルがあるか否かを判定する(S65)。ここで、PurchaseInfo要素宣言内に含まれるパーティクルのうち27行目のany要素は、minOccurs属性が0であり、maxOccurs属性がunboundedであることから、出現回数が固定ではないことがわかり、ステップS66に進む。   Next, the restriction candidate information update unit 124 determines whether there is a particle whose number of appearances is not fixed in the PurchaseInfo element declaration (S65). Here, it can be seen that the any element on the 27th line among the particles included in the PurchaseInfo element declaration has a minOccurs attribute of 0 and a maxOccurs attribute of unbounded, so the number of appearances is not fixed. move on.

ステップS66では、制限候補情報更新部124は、このany要素の情報(27行目)を取得する。ここで、このany要素のパーティクルIDは簡単のため「any」とする。   In step S66, the restriction candidate information update unit 124 acquires information on the any element (27th line). Here, the particle ID of this any element is “any” for simplicity.

次に、制限候補情報更新部124は、ステップS67の処理として、以下の処理を行う。   Next, the restriction candidate information update unit 124 performs the following process as the process of step S67.

まず、制限候補情報更新部124は、ステップS66で取得したany要素の出現回数を、ステップS60で取得した子要素のリストL[ProductName,Quantity]から特定する。ここで、子要素のリストL[ProductName,Quantity]には、any要素に対応した要素は出現しておらず、any要素の出現回数は0回であることが分かる。なお、any要素に対応した要素であるか否かは、any要素以外の要素に対応する子要素をリストLから差し引けばよい。   First, the restriction candidate information updating unit 124 specifies the number of appearances of the any element acquired in step S66 from the child element list L [ProductName, Quantity] acquired in step S60. Here, it can be seen that no element corresponding to the any element appears in the child element list L [ProductName, Quantity], and the number of occurrences of the any element is zero. Whether or not an element corresponds to an any element may be determined by subtracting a child element corresponding to an element other than the any element from the list L.

そして、制限候補情報更新部124は、第二制限候補テーブル115gに新たなレコードを追加して、ID欄115hには、情報のレコードから連番となるIDの値を格納し、要素宣言ID欄115iには、処理対象となっているPurchaseInfo要素の要素宣言IDである「PurchaseInfo」を格納し、パーティクルID欄115jには、処理対象となっているany要素のパーティクルIDである「any」を格納し、制約条件の種別欄115kには、「出現回数」を格納し、制約条件の候補欄115lには、any属性の出現回数である「0」を格納する。   Then, the restriction candidate information update unit 124 adds a new record to the second restriction candidate table 115g, stores the ID value that is a serial number from the information record in the ID field 115h, and the element declaration ID field. 115i stores “PurchaseInfo”, which is an element declaration ID of the PurchaseInfo element that is the processing target, and “any”, which is the particle ID of the any element that is the processing target, is stored in the particle ID column 115j. Then, the “appearance count” is stored in the constraint condition type column 115k, and “0” that is the occurrence count of the any attribute is stored in the constraint condition candidate column 115l.

次に、制限候補情報更新部124は、PurchaseInfo要素宣言内に、any要素があるか否かを判定する(S68)。ここで、オリジナルスキーマ113aのPurchaseInfo要素宣言(22行目から30行目)には、any要素が存在するため(27行目)、ステップS69に進む。   Next, the restriction candidate information update unit 124 determines whether or not there is an any element in the PurchaseInfo element declaration (S68). Here, since the Any element exists in the PurchaseInfo element declaration (line 22 to line 30) of the original schema 113a (line 27), the process proceeds to step S69.

そして、制限候補情報更新部124は、ステップS69での処理として以下の処理を行う。   Then, the restriction candidate information update unit 124 performs the following process as the process in step S69.

まず、制限候補情報更新部124は、any要素と対応するサンプルデータ114a内の要素を取得する。ここで、ステップS60で取得した子要素のリストL[ProductName,Quantity]から、サンプルデータ114aにはany要素に対応した要素は出現していない。   First, the restriction candidate information update unit 124 acquires an element in the sample data 114a corresponding to the any element. Here, from the child element list L [ProductName, Quantity] acquired in step S60, no element corresponding to the any element appears in the sample data 114a.

そして、制限候補情報更新部124は、以上により得られた情報を第二制限候補テーブル115gに格納する。   Then, the restriction candidate information update unit 124 stores the information obtained as described above in the second restriction candidate table 115g.

具体的には、第二制限候補テーブル115gに新たなレコードを追加して、ID欄115hには、情報のレコードから連番となるIDの値を格納し、要素宣言ID欄115iには、処理対象となっているPurchaseInfo要素の要素宣言IDである「PurchaseInfo」を格納し、パーティクルID欄115jには、処理対象となっているany要素のパーティクルIDである「any」を格納し、制約条件の種別欄115kには、「出現要素」を格納し、制約条件の候補欄115lには、any属性に対応した要素が存在しないため、空欄とする。   Specifically, a new record is added to the second restriction candidate table 115g, the ID column 115h stores the ID value that is a sequential number from the information record, and the element declaration ID column 115i has a process. “PurchaseInfo” that is the element declaration ID of the target PurchaseInfo element is stored, and “any” that is the particle ID of the any element that is the processing target is stored in the particle ID column 115j. “Appearance element” is stored in the type column 115k, and there is no element corresponding to the any attribute in the constraint condition candidate column 115l.

以上で、PurchaseInfo要素に対する制限候補情報の更新処理を終了する。   Thus, the update process of the restriction candidate information for the PurchaseInfo element is completed.

次に、要素Eがサンプルデータ114aの11行目から15行目までのPurchaseInfo要素である場合には、制限候補情報更新部124は、PurchaseInfo要素の子要素を特定し、リストLを取得する(S60)。ここで、PurchaseInfo要素の子要素のリストLは、[ProductName,Quantity,Discount]となる。   Next, when the element E is a PurchaseInfo element from the 11th line to the 15th line of the sample data 114a, the restriction candidate information update unit 124 specifies a child element of the PurchaseInfo element and acquires the list L ( S60). Here, the list L of child elements of the PurchaseInfo element is [ProductName, Quantity, Discot].

次に、制限候補情報更新部124は、第二制限候補テーブル115gにPurchaseInfo要素宣言に対応するレコードがあるか判定する(S61)。ここでは、既に、サンプルデータ114aの07行目から10行目までのPurchaseInfo要素に対する処理を行った結果、第二制限候補テーブル115gにPurchaseInfo要素宣言に対応するレコードがあるため、ステップS70に進む。   Next, the restriction candidate information update unit 124 determines whether there is a record corresponding to the PurchaseInfo element declaration in the second restriction candidate table 115g (S61). Here, as a result of performing the process on the PurchaseInfo element from the 07th line to the 10th line of the sample data 114a, there is a record corresponding to the PurchaseInfo element declaration in the second restriction candidate table 115g, so the process proceeds to step S70.

ステップS70では、制限候補情報更新部124は、PurchaseInfo要素宣言内に、choice要素があるか否かを判定する。ここで、オリジナルスキーマ113aのPurchaseInfo要素宣言(22行目から30行目)には、choice要素は存在しないため、ステップS73に進む。   In step S <b> 70, the restriction candidate information update unit 124 determines whether there is a choice element in the PurchaseInfo element declaration. Here, since the choice element does not exist in the PurchaseInfo element declaration (from the 22nd line to the 30th line) of the original schema 113a, the process proceeds to step S73.

次に、制限候補情報更新部124は、PurchaseInfo要素宣言内に、出現回数が固定でないパーティクルがあるか否かを判定する(S73)。ここで、PurchaseInfo要素宣言内に含まれるパーティクルのうち27行目のany要素は、minOccurs属性が0であり、maxOccurs属性がunboundedであることから、出現回数が固定でないことが分かり、ステップS74に進む。   Next, the restriction candidate information update unit 124 determines whether there is a particle whose number of appearances is not fixed in the PurchaseInfo element declaration (S73). Here, the any element on the 27th line among the particles included in the PurchaseInfo element declaration has a minOccurs attribute of 0 and a maxOccurs attribute of unbounded, so that the number of appearances is not fixed, and the process proceeds to step S74. .

ステップS74では、制限候補情報更新部124は、このany要素の情報(27行目)を取得する。ここで、このany要素のパーティクルIDは簡単のため「any」とする。   In step S74, the restriction candidate information update unit 124 acquires information on the any element (27th line). Here, the particle ID of this any element is “any” for simplicity.

次に、制限候補情報更新部124は、ステップS75の処理として、以下の処理を行う。   Next, the restriction candidate information update unit 124 performs the following process as the process of step S75.

まず、制限候補情報更新部124は、ステップS74で取得したany要素の出現回数を、ステップS60で取得した子要素のリストL[ProductName,Quantity,Discout]から特定する。ここで、子要素のリストL[ProductName,Quantity,Discout]には、any要素に対応した要素[Discout]が出現しているため、要素[Discout]の出現回数(1回)を取得する。   First, the restriction candidate information update unit 124 specifies the number of appearances of the any element acquired in step S74 from the child element list L [ProductName, Quantity, Discout] acquired in step S60. Here, since the element [Discout] corresponding to the any element appears in the child element list L [ProductName, Quantity, Discout], the number of appearances (1 time) of the element [Discout] is acquired.

そして、制限候補情報更新部124は、第二制限候補テーブル115gにおいて、要素宣言ID欄115iに「PurcaseInfo」が格納され、パーティクルID欄115jに「any」が格納され、制約条件の種別欄115kに「出現回数」が格納されているレコードを選択して、制約条件の候補欄115lに格納されている数値と、当該数値に要素[Discout]の出現回数(1回)を加算した数値と、の両方を含む出現回数(ここでは、0〜1)を格納する。   Then, the restriction candidate information update unit 124 stores “PurchaseInfo” in the element declaration ID field 115i, “any” in the particle ID field 115j, and the restriction condition type field 115k in the second restriction candidate table 115g. By selecting a record in which the “number of occurrences” is stored, a numerical value stored in the constraint condition candidate field 115l and a numerical value obtained by adding the number of appearances of the element [Discout] (one time) to the numerical value The number of appearances including both (here, 0 to 1) is stored.

次に、制限候補情報更新部124は、PurchaseInfo要素宣言内に、any要素があるか否かを判定する(S76)。ここで、オリジナルスキーマ113aのPurchaseInfo要素宣言(22行目から30行目)には、any要素が存在するため(27行目)、ステップS77に進む。   Next, the restriction candidate information update unit 124 determines whether or not there is an any element in the PurchaseInfo element declaration (S76). Here, since the Any element exists in the PurchaseInfo element declaration (line 22 to line 30) of the original schema 113a (line 27), the process proceeds to step S77.

そして、制限候補情報更新部124は、ステップS77での処理として以下の処理を行う。   Then, the restriction candidate information update unit 124 performs the following process as the process in step S77.

まず、制限候補情報更新部124は、any要素と対応するサンプルデータ114a内の要素を取得する。ここで、ステップS60で取得した子要素のリストL[ProductName,Quantity,Discount]から、サンプルデータ114aにはany要素に対応した要素[Discount]が出現している。   First, the restriction candidate information update unit 124 acquires an element in the sample data 114a corresponding to the any element. Here, an element [Discount] corresponding to the any element appears in the sample data 114a from the child element list L [ProductName, Quantity, Disco] acquired in step S60.

そして、制限候補情報更新部124は、以上により得られた情報を第二制限候補テーブル115gに格納する。   Then, the restriction candidate information update unit 124 stores the information obtained as described above in the second restriction candidate table 115g.

具体的には、第二制限候補テーブル115gにおいて、要素宣言ID欄115iに「PurcaseInfo」が格納され、パーティクルID欄115jに「any」が格納され、制約条件の種別欄115kに「出現要素」が格納されているレコードを選択して、制約条件の候補欄115lに「Discount」が格納されていない場合には、当該欄に「Discount」を格納する。   Specifically, in the second restriction candidate table 115g, “PurcaseInfo” is stored in the element declaration ID column 115i, “any” is stored in the particle ID column 115j, and “appearing element” is stored in the constraint type column 115k. When a stored record is selected and “Discount” is not stored in the restriction condition candidate field 115l, “Discount” is stored in the field.

以上で、PurchaseInfo要素に対する制限候補情報の更新処理を終了する。   Thus, the update process of the restriction candidate information for the PurchaseInfo element is completed.

次に、要素Eがサンプルデータ114aの01行目から16行目までのPurchaseOrder要素である場合には、制限候補情報更新部124は、PurchaseOrder要素の子要素を特定し、リストLを取得する(S60)。ここで、PurchaseOrder要素の子要素のリストLは、[CustomerName,Telephone,CustomerInfo,ProductName,Quantity,PurchaseInfo,ProductName,Quantity,Discount,PurchaseInfo]となる。   Next, when the element E is a PurchaseOrder element from the 01st line to the 16th line of the sample data 114a, the restriction candidate information update unit 124 specifies a child element of the PurchaseOrder element and acquires the list L ( S60). Here, the child element list L of the PurchaseOrder element is [CustomerName, Telephone, CustomerInfo, ProductName, Quantity, PurchaseInfo, ProductName, Quantity, Disco, Purchase].

次に、制限候補情報更新部124は、第二制限候補テーブル115gにPurchaseOrder要素宣言に対応する情報があるか判定する(S61)。ここでは、第二制限候補テーブル115gには、PurchaseOrder要素宣言の情報はないものとする。そのため、ステップS62に進む。   Next, the restriction candidate information update unit 124 determines whether there is information corresponding to the PurchaseOrder element declaration in the second restriction candidate table 115g (S61). Here, it is assumed that there is no information on the PurchaseOrder element declaration in the second restriction candidate table 115g. Therefore, it progresses to step S62.

次に、制限候補情報更新部124は、PurchaseOrder要素宣言内に、choice要素があるか否かを判定する(S62)。ここで、オリジナルスキーマ113aのPurchaseOrder要素宣言(03行目から10行目)には、choice要素は存在しないため、ステップS65に進む。   Next, the restriction candidate information update unit 124 determines whether there is a choice element in the PurchaseOrder element declaration (S62). Here, since the choice element does not exist in the PurchaseOrder element declaration (from the 03rd line to the 10th line) of the original schema 113a, the process proceeds to step S65.

次に、制限候補情報更新部124は、PurchaseOrder要素宣言内に、出現回数が固定でないパーティクルがあるか否かを判定する(S65)。ここで、PurchaseOrder要素宣言内に含まれるパーティクルのうち07行目のPurchaseInfo要素は、maxOccurs属性がunboundedであることから、出現回数が固定ではないことがわかり、ステップS66に進む。   Next, the restriction candidate information update unit 124 determines whether or not there is a particle whose appearance count is not fixed in the PurchaseOrder element declaration (S65). Here, among the particles included in the PurchaseOrder element declaration, the PurchaseInfo element on the 07th line indicates that the occurrence count is not fixed because the maxOccurs attribute is unbounded, and the process proceeds to step S66.

ステップS66では、制限候補情報更新部124は、このPurchaseInfo要素の情報(07行目)を取得する。ここで、このPurchaseInfo要素のパーティクルIDは簡単のため「PurchaseInfo」とする。   In step S66, the restriction candidate information update unit 124 obtains information of this PurchaseInfo element (line 07). Here, the particle ID of this PurchaseInfo element is “PurchaseInfo” for simplicity.

次に、制限候補情報更新部124は、ステップS67の処理として、以下の処理を行う。   Next, the restriction candidate information update unit 124 performs the following process as the process of step S67.

まず、制限候補情報更新部124は、ステップS66で取得したPurchaseInfo要素の出現回数を、ステップS60で取得した子要素のリストLから特定する。ここで、子要素のリストLには、PurchaseInfo要素に対応した要素は2回出現しているため、PurchaseInfo要素の出現回数は2回であることがわかる。   First, the restriction candidate information update unit 124 specifies the number of appearances of the PurchaseInfo element acquired in step S66 from the child element list L acquired in step S60. Here, since the element corresponding to the PurchaseInfo element appears twice in the child element list L, it can be seen that the number of occurrences of the PurchaseInfo element is twice.

そして、制限候補情報更新部124は、第二制限候補テーブル115gに新たなレコードを追加して、ID欄115hには、情報のレコードから連番となるIDの値を格納し、要素宣言ID欄115iには、処理対象となっているPurchaseOrder要素の要素宣言IDである「PurchaseOrder」を格納し、パーティクルID欄115jには、処理対象となっているPurchaseInfo要素のパーティクルIDである「PurchaseInfo」を格納し、制約条件の種別欄115kには、「出現回数」を格納し、制約条件の候補欄115lには、PurchaseInfo要素の出現回数である「2」を格納する。   Then, the restriction candidate information update unit 124 adds a new record to the second restriction candidate table 115g, stores the ID value that is a serial number from the information record in the ID field 115h, and the element declaration ID field. 115i stores “PurchaseOrder” that is the element declaration ID of the PurchaseOrder element that is the processing target, and “PurchaseInfo” that is the particle ID of the PurchaseInfo element that is the processing target is stored in the particle ID column 115j. Then, the “appearance count” is stored in the restriction condition type column 115k, and “2” that is the appearance count of the PurchaseInfo element is stored in the constraint condition candidate column 115l.

次に、制限候補情報更新部124は、PurchaseOrder要素宣言内に、any要素があるか否かを判定する(S68)。ここで、オリジナルスキーマ113aのPurchaseOrder要素宣言(03行目から10行目)には、any要素が存在しないため、PurchaseOrder要素に対する制限候補情報の更新処理を終了する。   Next, the restriction candidate information updating unit 124 determines whether or not there is an any element in the PurchaseOrder element declaration (S68). Here, since there is no any element in the PurchaseOrder element declaration (from the 03rd line to the 10th line) of the original schema 113a, the update process of the restriction candidate information for the PurchaseOrder element is terminated.

以上により、サンプルデータ114a内の全ての要素について、図15又は図16の処理を実行したため、制限候補情報の更新処理は終了する。   As described above, the processing of FIG. 15 or 16 has been executed for all the elements in the sample data 114a, and therefore the update process of the restriction candidate information ends.

以上のように、本実施形態によれば、サンプルデータ114aを用いて、オリジナルスキーマ113aをより厳しく制限した変換後スキーマ116aを生成することができる。このため、例えば、スキーマ変換装置100のオペレータは、システムにおいて許可することのできる最大限に緩い制限となるサンプルデータを少なくとも一つ以上作成しておくことで、このようなサンプルデータが妥当と判断される最も厳格なスキーマを容易に生成することができるようになる。   As described above, according to the present embodiment, the post-conversion schema 116a in which the original schema 113a is more strictly restricted can be generated using the sample data 114a. For this reason, for example, the operator of the schema conversion device 100 determines that such sample data is appropriate by creating at least one sample data that can be permitted in the system as much as possible. Will be able to easily generate the most stringent schema.

例えば、本実施形態におけるスキーマ変換装置100は、図17(Webサービスシステム170の概略図)に示すWebサービスシステム170において使用することができる。   For example, the schema conversion apparatus 100 according to the present embodiment can be used in the Web service system 170 shown in FIG. 17 (schematic diagram of the Web service system 170).

図示するように、Webサービスシステム170は、スキーマ変換装置100と、メッセージ受信装置171と、スキーマ検証装置172と、アプリケーションサーバ装置173と、を備え、これらの装置は、ネットワーク180を介して、相互に情報を送受信することができる。   As illustrated, the Web service system 170 includes a schema conversion apparatus 100, a message reception apparatus 171, a schema verification apparatus 172, and an application server apparatus 173. These apparatuses are connected to each other via a network 180. Can send and receive information.

メッセージ受信装置171は、Webサービスクライアント(図示せず)から受信したメッセージををスキーマ検証装置172に送信する。ここでは、メッセージの全体又は一部分である検証前XML文書をスキーマ検証装置172に送信する。これは、例えばSOAPメッセージの本体部分であるSOAPボディの内容を取り出し、検証前XML文書としてスキーマ検証装置に送信する処理などが考えられる。   The message reception device 171 transmits the message received from the Web service client (not shown) to the schema verification device 172. Here, the pre-verification XML document that is the whole or part of the message is transmitted to the schema verification device 172. For example, the content of the SOAP body, which is the main part of the SOAP message, can be extracted and transmitted to the schema verification apparatus as a pre-verification XML document.

そして、スキーマ検証装置172においては、受信した検証前XML文書のスキーマ検証を実行する。ここで、スキーマ検証装置172は、スキーマ変換装置100で生成された変換後スキーマを用いて、スキーマ検証を実行する。   Then, the schema verification device 172 executes schema verification of the received pre-verification XML document. Here, the schema verification device 172 performs schema verification using the post-conversion schema generated by the schema conversion device 100.

そして、検証前XML文書が、スキーマ変換装置100により生成された変換後スキーマに対して妥当である場合には、スキーマ検証装置172は、検証済みXML文書をアプリケーションサーバ装置173に送信する。   If the pre-verification XML document is valid for the post-conversion schema generated by the schema conversion apparatus 100, the schema verification apparatus 172 transmits the verified XML document to the application server apparatus 173.

このような検証済みXML文書を受信したアプリケーションサーバ装置173は、検証済みXML文書を用いて、例えば、商品の受注処理や旅行の予約処理など、何らかの業務処理を実行する。   Upon receiving such a verified XML document, the application server device 173 uses the verified XML document to execute some business process such as a product order process or a travel reservation process.

なお、図17に示した例では、アプリケーションサーバ装置173で提供するサービスにおいて、安全と判断されるサンプルデータを用いてスキーマ変換装置100において変換後スキーマを生成しておくことで、アプリケーションサーバ装置173のセキュリティを確保することができるようになる。   In the example illustrated in FIG. 17, in the service provided by the application server device 173, the schema conversion device 100 generates a post-conversion schema using sample data determined to be safe, so that the application server device 173 Security can be ensured.

また、図17で示した例では、Webサービスシステム170での全体の処理を、スキーマ変換装置100、メッセージ受信装置171、スキーマ検証装置172及びアプリケーションサーバ装置173とで分担して行っているが、このような態様に限定されず、Webサービスシステム170での全体の処理を分担する態様は、任意の態様を選択可能である。例えば、Webサービスシステム170での全体の処理をスキーマ変換装置100だけで行うようにすることも可能であり、Webサービスシステム170での任意の処理をスキーマ変換装置100で行うようにすることも可能である。   In the example shown in FIG. 17, the entire processing in the Web service system 170 is shared by the schema conversion device 100, the message reception device 171, the schema verification device 172, and the application server device 173. It is not limited to such an aspect, The aspect which shares the whole process in the Web service system 170 can select arbitrary aspects. For example, the entire process in the Web service system 170 can be performed only by the schema conversion apparatus 100, and any process in the Web service system 170 can be performed by the schema conversion apparatus 100. It is.

以上に記載した実施形態においては、図15に記載したフローチャートにおいて、要素内容のデータ型と値の長さについてより制限を厳しくすることができるようにしているが、このような態様に限定されず、例えば、要素内容から、出現する文字列や、特殊記号の有無、整数値の範囲(最小値と最大値、正の値又は負の値)等の制限を厳しくするようにすることも可能である。   In the embodiment described above, in the flowchart shown in FIG. 15, the data type of the element content and the length of the value can be stricter. However, the embodiment is not limited to such an aspect. For example, it is possible to tighten restrictions on the character strings that appear, the presence of special symbols, the range of integer values (minimum and maximum values, positive values or negative values), etc. is there.

また、以上に記載した実施形態においては、サンプルデータ114aを用いて要素に関する制限をより厳しくするようにしているが、このような態様に限定されず、属性に関しても、例えば、図15と同様の処理で、属性値の値の範囲を限定することができ、また、図16と同様な処理で、anyAtribute属性値として出現する属性の限定等を行うことができる。   In the embodiment described above, the sample data 114a is used to make restrictions on elements more strict. However, the present invention is not limited to such an aspect, and the attributes are the same as those shown in FIG. The range of the attribute value can be limited by the process, and the attribute that appears as the anyAttribute attribute value can be limited by the same process as in FIG.

図18は、本発明の第二の実施形態であるスキーマ変換装置200の概略図である。   FIG. 18 is a schematic diagram of a schema conversion apparatus 200 according to the second embodiment of the present invention.

図示するように、スキーマ変換装置200は、記憶部110と、制御部220と、入力部130と、出力部140と、通信部150と、を備え、第一の実施形態と比較して、制御部220が異なっているため、以下、制御部220に関連する事項について説明する。   As shown in the figure, the schema conversion apparatus 200 includes a storage unit 110, a control unit 220, an input unit 130, an output unit 140, and a communication unit 150, and is controlled as compared with the first embodiment. Since the unit 220 is different, items related to the control unit 220 will be described below.

制御部220は、全体制御部121と、スキーマ検証部122と、探索部123と、制限候補情報更新部124と、スキーマ変換部225と、スキーマ編集部226と、を備え、第一の実施形態と比較して、スキーマ変換部225及びスキーマ編集部226が異なっているため、以下これらに関連する事項について説明する。   The control unit 220 includes an overall control unit 121, a schema verification unit 122, a search unit 123, a restriction candidate information update unit 124, a schema conversion unit 225, and a schema editing unit 226. The first embodiment Since the schema conversion unit 225 and the schema editing unit 226 are different from each other, items related to these will be described below.

スキーマ変換部225は、制限候補情報記憶領域115に記憶されている制限候補のうち、後述するスキーマ編集部226において、スキーマ変換装置200のオペレータより制限の許可の入力を受け付けたものをオリジナルスキーマ113aに適用することで、スキーマの変換を行い、変換後スキーマを生成する。   Of the restriction candidates stored in the restriction candidate information storage area 115, the schema conversion unit 225 receives the restriction permission input from the operator of the schema conversion apparatus 200 in the schema editing unit 226 described later. By applying to, the schema is converted and the converted schema is generated.

スキーマ編集部226は、制限候補情報記憶領域115に記憶されている制限候補を出力部140に出力し、当該制限候補うち、オリジナルスキーマ113aに適用する制限候補の入力を、入力部130を介して受け付け、受け付けた制限候補をスキーマ変換部225に通知する。   The schema editing unit 226 outputs the restriction candidates stored in the restriction candidate information storage area 115 to the output unit 140, and inputs the restriction candidates to be applied to the original schema 113 a among the restriction candidates via the input unit 130. The schema conversion unit 225 is notified of the received restriction candidates.

例えば、本実施形態においては、図19(エディタ画面226aの概略図)に示すようなエディタ画面226aを出力部140に出力することで、オペレータより制限候補の選択を受け付ける。   For example, in the present embodiment, selection of restriction candidates is accepted from the operator by outputting an editor screen 226a as shown in FIG. 19 (schematic diagram of the editor screen 226a) to the output unit 140.

エディタ画面226aは、オリジナルスキーマ表示領域226bと、行数表示領域226cと、を備える。   The editor screen 226a includes an original schema display area 226b and a line number display area 226c.

そして、行数表示領域226cには、制限候補情報記憶領域115に記憶されている制限候補が存在するパーティクルの行数に隣接する位置(図19では、向かって右横の所定位置)に、制限候補が存在することを示すマーク226dが配置される。   The row number display area 226c is limited to a position adjacent to the number of particle rows where the restriction candidates stored in the restriction candidate information storage area 115 exist (a predetermined position on the right side in FIG. 19). A mark 226d indicating that a candidate exists is arranged.

そして、このマーク226dを指定した実行指示の入力を、入力部130を介して受け付けると、スキーマ編集部226は、当該マーク226dに関連するパーティクルに隣接した位置(図19では、下方の所定位置)に、制限候補を特定する情報が表示される。   When the execution instruction specifying this mark 226d is received via the input unit 130, the schema editing unit 226 is positioned adjacent to the particle related to the mark 226d (a predetermined position below in FIG. 19). The information for specifying the restriction candidates is displayed.

そして、スキーマ編集部226は、表示された制限候補を特定した実行指示の入力を、入力部130を介して受け付けることで(例えば、ダブルクリック等)、入力を受け付けた制限候補をスキーマ変換部225に通知する。   Then, the schema editing unit 226 accepts an input of an execution instruction specifying the displayed restriction candidate via the input unit 130 (for example, double-clicking), and the restriction candidate that has received the input is schema conversion part 225. Notify

なお、このような通知を受けたスキーマ変換部225は、通知で特定される変換候補による変換をオリジナルスキーマ113aに対して実行する。   Upon receiving such notification, the schema conversion unit 225 performs conversion on the original schema 113a using the conversion candidate specified by the notification.

図20は、スキーマ変換装置200における制限候補の選択処理を示すフローチャートである。   FIG. 20 is a flowchart showing restriction candidate selection processing in the schema conversion apparatus 200.

まず、スキーマ編集部226は、例えば、図19に示すエディタ画面226aを出力部140に表示して、別ウィンドウにて表示する制限候補の入力を受け付ける(S80)。   First, for example, the schema editing unit 226 displays an editor screen 226a shown in FIG. 19 on the output unit 140, and receives an input of restriction candidates to be displayed in another window (S80).

そして、スキーマ編集部226は、入力部130を介して、行数表示領域226cに配置されているマーク226dを指定した実行指示の入力を受け付けると、入力された制限候補を特定する情報を表示する(S81)。   When the schema editing unit 226 receives an execution instruction specifying the mark 226d arranged in the line number display area 226c via the input unit 130, the schema editing unit 226 displays information for specifying the input restriction candidate. (S81).

ここでは、スキーマ編集部226は、ステップS80で選択されたマーク226dに関連する行数で特定されるパーティクルの要素宣言IDが、第一制限候補テーブル115aの要素宣言ID欄115c、または、第二制限候補テーブル115gの要素宣言ID欄115i、に格納されているレコードを特定し、特定したレコードより、少なくとも制約条件の種別欄115d、115k及び制約条件の候補欄115e、115lに格納されている情報を抽出し、抽出した情報を所定の表示形式に編集して、エディタ画面226aの所定の位置に表示する。   Here, the schema editing unit 226 uses the element declaration ID column 115c of the first restriction candidate table 115a or the second element declaration ID specified by the number of rows related to the mark 226d selected in step S80. The record stored in the element declaration ID field 115i of the restriction candidate table 115g is specified, and the information stored in at least the restriction condition type fields 115d and 115k and the restriction condition candidate fields 115e and 115l from the specified record. , And the extracted information is edited into a predetermined display format and displayed at a predetermined position on the editor screen 226a.

そして、スキーマ編集部226は、入力部130を介して、表示した制限候補を特定した実行指示の入力を受け付けると、選択された制限候補に対応する第一制限候補テーブル115a又は第二制限候補テーブル115gのレコードに格納されている情報をスキーマ変換部225に通知し、スキーマ変換部225は、オリジナルスキーマ113aの変換を実行する(S83)。なお、変換を行った制限候補については、マーク226dを外したり、既に処理済みであることを明示したりする等の処理を行うことが望ましい。   When the schema editing unit 226 receives an input of an execution instruction specifying the displayed restriction candidate via the input unit 130, the first restriction candidate table 115a or the second restriction candidate table corresponding to the selected restriction candidate. Information stored in the 115g record is notified to the schema conversion unit 225, and the schema conversion unit 225 performs conversion of the original schema 113a (S83). For the restriction candidates that have been converted, it is desirable to perform processing such as removing the mark 226d or clearly indicating that processing has already been performed.

ステップS80〜S83までの処理は、入力部130を介して、編集の終了の指示の入力を受け付けるまで行う(S84)。   The processes from steps S80 to S83 are performed until an input of an instruction to end editing is received via the input unit 130 (S84).

そして、スキーマ変換部225は、変換後スキーマを変換後スキーマ記憶領域116に記憶する(S85)。   Then, the schema conversion unit 225 stores the converted schema in the converted schema storage area 116 (S85).

以上のように、本実施形態においては、オリジナルスキーマ113aの変換を行う前に、変換候補を表示して、オペレータの選択を受け付けることで、オペレータが望まない変換が行われてしまうことを防止することができる。このような場合でも、変換候補は、サンプルデータ114aに基づいて既に絞り込まれているため、オペレータは効率的に変換候補を選択することができる。   As described above, in the present embodiment, before conversion of the original schema 113a is performed, conversion candidates are displayed and an operator's selection is accepted, thereby preventing the operator from performing unnecessary conversion. be able to. Even in such a case, since the conversion candidates are already narrowed down based on the sample data 114a, the operator can efficiently select the conversion candidates.

なお、以上に記載した実施形態においては、設定情報記憶領域112に記憶されている設定情報に基づいて制限候補を絞り込んでから、制限候補の選択を受け付けているが、このような態様に限定されず、設定情報記憶領域112に記憶されている設定情報に基づいて制限候補を絞り込まずに、スキーマ編集部226による編集処理を行ってもよい。   In the embodiment described above, selection of restriction candidates is accepted after narrowing down restriction candidates based on the setting information stored in the setting information storage area 112. However, the present invention is limited to such a mode. First, the editing process by the schema editing unit 226 may be performed without narrowing down restriction candidates based on the setting information stored in the setting information storage area 112.

図21は、本発明の第三の実施形態であるWebサービスシステム370の概略図である。   FIG. 21 is a schematic diagram of a Web service system 370 according to the third embodiment of the present invention.

図示するように、Webサービスシステム370は、スキーマ変換装置300と、クライアント端末374と、を備え、これらはネットワーク381を介して、相互に情報の送受信を行うことができるようにされている。   As shown in the figure, the Web service system 370 includes a schema conversion device 300 and a client terminal 374, which can transmit and receive information to and from each other via a network 381.

ここで、クライアント端末374は、通常のパーソナルコンピュータで構成可能であるため、詳細な説明を省略する。   Here, since the client terminal 374 can be configured by a normal personal computer, detailed description thereof is omitted.

図22は、スキーマ変換装置300の概略図である。   FIG. 22 is a schematic diagram of the schema conversion apparatus 300.

図示するように、スキーマ変換装置300は、記憶部310と、制御部320と、入力部130と、出力部140と、通信部150と、を備える。   As illustrated, the schema conversion apparatus 300 includes a storage unit 310, a control unit 320, an input unit 130, an output unit 140, and a communication unit 150.

記憶部310は、スキーマリポジトリ記憶領域111と、設定情報記憶領域112と、オリジナルスキーマ記憶領域113と、サンプルデータ記憶領域114と、制限候補情報記憶領域115と、変換後スキーマ記憶領域116と、ログ情報記憶領域317と、を備え、第一の実施形態と比較して、ログ情報記憶領域317が追加されているため、以下、ログ情報記憶領域317に関連する事項について説明する。   The storage unit 310 includes a schema repository storage area 111, a setting information storage area 112, an original schema storage area 113, a sample data storage area 114, a restriction candidate information storage area 115, a converted schema storage area 116, a log Since the log information storage area 317 is added as compared with the first embodiment, items related to the log information storage area 317 will be described below.

ログ情報記憶領域317には、スキーマ検証部122において、スキーマ検証の対象となったXML文書が、変換後スキーマに対しては妥当ではないが、オリジナルスキーマに対しては妥当であると判断された場合に、当該XML文書を特定する情報と、当該XML文書が、変換後スキーマに対しては妥当ではないが、オリジナルスキーマに対しては妥当であることを特定する情報と、が関連付けられて記憶される。   In the log information storage area 317, the schema verification unit 122 determines that the XML document that is the object of schema verification is not valid for the converted schema but is valid for the original schema. In this case, the information specifying the XML document and the information specifying that the XML document is not valid for the converted schema but valid for the original schema are stored in association with each other. Is done.

制御部320は、全体制御部121と、スキーマ検証部122と、探索部123と、制限候補情報更新部124と、スキーマ変換部125と、ログ取得部327と、アプリケーション部328と、を備え、第一の実施形態と比較して、ログ取得部327及びアプリケーション部328が異なっているため、以下これらに関連する事項について説明する。   The control unit 320 includes an overall control unit 121, a schema verification unit 122, a search unit 123, a restriction candidate information update unit 124, a schema conversion unit 125, a log acquisition unit 327, and an application unit 328. Since the log acquisition unit 327 and the application unit 328 are different from those of the first embodiment, items related to these will be described below.

ログ取得部327は、スキーマ検証部122において、スキーマ検証の対象となったXML文書が、変換後スキーマに対しては妥当ではないが、オリジナルスキーマに対しては妥当であると判断された場合に、当該XML文書を特定する情報と、当該XML文書が、変換後スキーマに対しては妥当ではないが、オリジナルスキーマに対しては妥当であることを特定する情報と、が関連付けてログ情報としてログ情報記憶領域317に記憶する。   The log acquisition unit 327 determines that the schema verification unit 122 determines that the XML document subjected to the schema verification is not valid for the converted schema but is valid for the original schema. The log information is associated with the information specifying the XML document and the information specifying that the XML document is not valid for the converted schema but valid for the original schema. The information is stored in the information storage area 317.

また、ログ取得部327は、スキーマ検証部122において、スキーマ検証の対象であるXML文書が、オリジナルスキーマ113aに対しては妥当であり、変換後スキーマ116aに対しては妥当ではないと判断された場合に、当該XML文書のログ情報を、当該XML文書を送信してきたクライアント端末374に送信する処理を行う。   Further, the log acquisition unit 327 determines that the schema verification unit 122 determines that the XML document that is the object of schema verification is valid for the original schema 113a and not valid for the converted schema 116a. In this case, a process of transmitting log information of the XML document to the client terminal 374 that has transmitted the XML document is performed.

アプリケーション部は、スキーマ検証部122において妥当と判断された検証済みXML文書を用いて、例えば、商品の受注処理や旅行の予約処理など、何らかの業務処理を実行する。   The application unit uses the verified XML document determined to be valid by the schema verification unit 122 to execute some business process such as a product order process or a travel reservation process.

図23は、スキーマ変換装置300においてXML文書の検証する際の処理を示すフローチャートである。   FIG. 23 is a flowchart illustrating processing when the schema conversion apparatus 300 verifies the XML document.

まず、スキーマ変換装置300では、全体制御部121が、通信部150を介して、クライアント端末374よりXML文書を受信する(S90)。   First, in the schema conversion apparatus 300, the overall control unit 121 receives an XML document from the client terminal 374 via the communication unit 150 (S90).

次に、スキーマ検証部122は、変換後スキーマ記憶領域116に記憶されている変換後スキーマを用いて、ステップS90で受信したXML文書のスキーマ検証を行う(S91)。   Next, the schema verification unit 122 performs schema verification of the XML document received in step S90 using the converted schema stored in the converted schema storage area 116 (S91).

そして、スキーマ検証部122は、XML文書が変換後スキーマ116aに対して妥当か否かを判断し(S92)、妥当である場合には(ステップS92でYes)ステップS93に進み、妥当でない場合には(ステップS92でNo)ステップS94に進む。   Then, the schema verification unit 122 determines whether or not the XML document is valid for the converted schema 116a (S92). If it is valid (Yes in step S92), the schema verification unit 122 proceeds to step S93. (No in step S92), the process proceeds to step S94.

ステップS93では、スキーマ検証部122は、妥当と判断された検証済みXML文書をアプリケーション部328に出力する。   In step S <b> 93, the schema verification unit 122 outputs the verified XML document determined to be valid to the application unit 328.

一方、ステップS94では、スキーマ検証部122は、ステップS92で変換後スキーマに対して妥当ではないと判断されたXML文書を、オリジナルスキーマ記憶領域113に記憶されているオリジナルスキーマ113aを用いて、スキーマ検証を行う。   On the other hand, in step S94, the schema verification unit 122 uses the original schema 113a stored in the original schema storage area 113 for the XML document determined to be invalid with respect to the converted schema in step S92. Perform verification.

そして、スキーマ検証部122は、XML文書がオリジナルスキーマ113aに対して妥当か否かを判断し(S95)、妥当である場合には(ステップS95でYes)ステップS96に進み、妥当でない場合には(ステップS95でNo)ステップS97に進む。   Then, the schema verification unit 122 determines whether the XML document is valid with respect to the original schema 113a (S95). If it is valid (Yes in step S95), the schema verification unit 122 proceeds to step S96. (No in step S95) The process proceeds to step S97.

ステップS96では、ログ取得部327は、スキーマ検証の対象となったXML文書がを特定する情報と、当該XML文書が、変換後スキーマに対しては妥当ではないが、オリジナルスキーマに対しては妥当であることを特定する情報と、が関連付けてログ情報としてログ情報記憶領域317に記憶する。   In step S <b> 96, the log acquisition unit 327 determines that the XML document that is the object of schema verification and the XML document are not valid for the converted schema but valid for the original schema. Are stored in the log information storage area 317 as log information in association with each other.

ステップS97では、全体制御部121は、XML文書がスキーマ検証で妥当でないと判断された旨を通知するエラーメッセージ(ログ情報がある場合には、当該ログ情報を添付して)をクライアント端末374に送信する。   In step S97, the overall control unit 121 sends an error message (attaching the log information if there is log information) notifying the client terminal 374 that the XML document is determined to be invalid by the schema verification. Send.

以上のような処理を行うことにより、スキーマの変換を行うことにより、スキーマ検証の結果が異なることとなった履歴(ログ)を取得することができ、当該履歴(ログ)を分析することで、スキーマ変換の妥当性を判断することができるようになる。   By performing the process as described above, by converting the schema, it is possible to obtain a history (log) that results in different schema verification results, and by analyzing the history (log), The validity of schema conversion can be judged.

以上に記載した実施形態においては、制約条件の厳しい変換後スキーマを用いて、XML文書のスキーマ検証を実施するようにしている。しかしながら、スキーマ文書の利用用途はスキーマ検証だけではなく、他の用途に使用してもよい。   In the embodiment described above, schema verification of an XML document is performed using a post-conversion schema with strict constraints. However, the usage of the schema document may be used not only for schema verification but also for other purposes.

例えば、変換後スキーマをWSDLの中に含めてインターフェースとして公開してもよい。また、JAXB(Java Architecture for XML Binding)などのデータバインディングツールでは、スキーマ文書の情報を元にJava(登録商標)のクラスを生成することができる。変換後ツールは、JAXBを用いてJava(登録商標)のクラスを生成する際に利用してもよい。   For example, the converted schema may be included in WSDL and published as an interface. Further, a data binding tool such as JAXB (Java Architecture for XML Binding) can generate a Java (registered trademark) class based on information in a schema document. The post-conversion tool may be used when generating a Java (registered trademark) class using JAXB.

また、制限候補情報を保存しておけば、同じもしくは類似するオリジナルスキーマに対して変換を再度行なう場合、容易に再変換を実施することができる。   In addition, if the restriction candidate information is stored, reconversion can be easily performed when reconversion is performed on the same or similar original schema.

オリジナルスキーマを制約条件の厳しいスキーマに変更した後に、オリジナルスキーマの方に修正が加わってしまう可能性がある。その場合、スキーマの変更を再度実施することが考えられる。スキーマの変更を手作業で行っている場合、このような作業は非常に負担が大きい。しかし、本発明を用いると、制限候補情に変更内容が含まれているため、制限候補情を保存しておくことで、容易に再変換が可能である。   After the original schema is changed to one with more restrictive conditions, there is a possibility that the original schema will be modified. In that case, it is conceivable to change the schema again. If the schema is changed manually, such work is very burdensome. However, when the present invention is used, the restriction candidate information includes the change contents, and therefore, reconversion can be easily performed by storing the restriction candidate information.

また、本実施形態では、any要素による任意の要素の出現を許す制約条件を、具体的な要素、例えばDiscount要素の出現だけを許す制約条件に変換する方法を説明した。ここでは具体的な要素名を特定できる場合を例に取り説明したが、具体的な要素名を特定することが困難な場合、例えば出現を許す要素の名前空間URIや名前空間の種別を特定するように制約条件を変更してもよい。any要素ではnamespace属性により出現を許す名前空間を特定することができる。例えば、namespace属性に##otherを指定した場合、対象名前空間以外の名前空間に属する要素の出現を許す。また、namespace属性に##targetNamespaceを指定すると、出現を許す具体的な名前空間URLを指定することができる。   Further, in the present embodiment, the method of converting a constraint condition that allows an arbitrary element to appear due to an any element into a constraint condition that allows only the appearance of a specific element, for example, a Disco element, has been described. Here, the case where a specific element name can be specified has been described as an example. However, when it is difficult to specify a specific element name, for example, the name space URI or name space type of an element that is allowed to appear is specified. The constraint condition may be changed as described above. In the “any” element, the name space allowed to appear can be specified by the “namespace” attribute. For example, when ## other is specified in the namespace attribute, an element belonging to a namespace other than the target namespace is allowed to appear. If ## targetNamespace is specified in the namespace attribute, it is possible to specify a specific name space URL that is allowed to appear.

また、図4の27行目のany要素を変換する場合、例えばany要素のnamespace属性に##otherを設定することで、対象名前空間とは異なる名前空間に属するDiscount要素の出現を許しつつ、対象名前空間に属する要素の出現を禁止することができるため、具体的な要素名を特定することなく制約条件を厳しくすることができる。また、##targetNamespaceを利用してDiscount要素が属する名前空間URIであるhttp://example.org/orderを指定することで、http://example.org/orderの名前空間URIに属するもののみ出現を許すことができ、より制約条件を厳しくすることができる。   In addition, when converting the any element on the 27th line in FIG. 4, for example, by setting ## other in the namespace attribute of the any element, while allowing a Disco element belonging to a namespace different from the target namespace to appear, Since the appearance of an element belonging to the target namespace can be prohibited, the constraint condition can be tightened without specifying a specific element name. In addition, using ## targetNamespace, http://example.com, which is the namespace URI to which the Disco element belongs. By specifying org / order, http: // example. Only those that belong to the name space URI of org / order can be allowed to appear, and more restrictive conditions can be made.

スキーマ変換装置の概略図。Schematic diagram of a schema conversion apparatus. スキーマ文書管理テーブルの概略図。Schematic diagram of a schema document management table. 設定情報テーブルの概略図。Schematic diagram of a setting information table. オリジナルスキーマの概略図。Schematic of the original schema. サンプルデータの概略図。Schematic of sample data. 第一制限候補テーブルの概略図。The schematic diagram of a 1st restriction candidate table. 第二制限候補テーブルの概略図。Schematic of a 2nd restriction candidate table. 変換後スキーマの概略図。Schematic of converted schema. コンピュータの概略図。Schematic diagram of a computer. スキーマ変換装置における全体の処理を示すフローチャート。The flowchart which shows the whole process in a schema conversion apparatus. 制限候補情報を更新する処理を示すフローチャート。The flowchart which shows the process which updates restriction | limiting candidate information. 要素に対応する要素宣言のデータを取得する処理を示すフローチャート。The flowchart which shows the process which acquires the data of the element declaration corresponding to an element. スキーマの概略図。Schematic diagram. import要素の概略図。Schematic of the import element. テキストデータの制限候補情報を更新する処理を示すフローチャート。The flowchart which shows the process which updates the restriction | limiting candidate information of text data. 子要素の制限候補情報を更新する処理を示すフローチャート。The flowchart which shows the process which updates the restriction candidate information of a child element. Webサービスシステムの概略図。1 is a schematic diagram of a Web service system. スキーマ変換装置の概略図。Schematic diagram of a schema conversion apparatus. エディタ画面の概略図。Schematic diagram of the editor screen. 制限候補の選択処理を示すフローチャート。The flowchart which shows the selection process of a restriction candidate. Webサービスシステムの概略図。1 is a schematic diagram of a Web service system. スキーマ変換装置の概略図。Schematic diagram of a schema conversion apparatus. XML文書の検証する際の処理を示すフローチャート。The flowchart which shows the process at the time of verification of an XML document.

符号の説明Explanation of symbols

100、200、300 スキーマ変換装置
110 記憶部
111 スキーマリポジトリ記憶領域
112 設定情報記憶領域
113 オリジナルスキーマ記憶領域
114 サンプルデータ記憶領域
115 制限候補情報記憶領域
116 変換後スキーマ記憶領域
317 ログ情報記憶領域
120 制御部
121 全体制御部
122 スキーマ検証部
123 探索部
124 制限候補情報更新部
125、225 スキーマ変換部
226 スキーマ編集部
327 ログ取得部
328 アプリケーション部
130 入力部
140 出力部
150 通信部
100, 200, 300 Schema conversion device 110 Storage unit 111 Schema repository storage area 112 Setting information storage area 113 Original schema storage area 114 Sample data storage area 115 Restriction candidate information storage area 116 Converted schema storage area 317 Log information storage area 120 Control Unit 121 Overall control unit 122 Schema verification unit 123 Search unit 124 Restriction candidate information update unit 125, 225 Schema conversion unit 226 Schema editing unit 327 Log acquisition unit 328 Application unit 130 Input unit 140 Output unit 150 Communication unit

Claims (16)

スキーマ文書を生成するスキーマ変換装置であって、
サンプルデータに含まれる要素を妥当と判断可能な最も厳しい制約条件を変換候補として、当該要素毎に取得する処理と、
前記要素に対応する要素宣言をオリジナルスキーマより特定し、特定した要素宣言の要素内容における前記要素に対する制約条件を、前記変換候補として取得した制約条件に変換することで、前記スキーマ文書を生成する処理と、を行う制御部と、
前記オリジナルスキーマ内の要素宣言と、サンプルデータに含まれる要素を妥当と判断可能な最も厳しい制約条件と、を変換候補情報として記憶する記憶部と、を備え、
前記制御部は、
前記サンプルデータに含まれる要素を、深さ優先で探索し、帰りがけ順で探索された要素を妥当と判断可能な最も厳しい制約条件を変換候補として取得し、
前記変換候補情報において、前記サンプルデータに含まれる要素に対応する要素宣言に対応付けられている制約条件と、取得した制約条件と、を満たす最も厳しい制約条件を特定し、前記変換候補情報における制約条件を、特定した制約条件に変更すること
を特徴とするスキーマ変換装置。
A schema conversion device for generating a schema document,
A process for obtaining each element as the conversion candidate with the strictest constraint that can determine that the element included in the sample data is valid,
A process of generating the schema document by specifying an element declaration corresponding to the element from the original schema, and converting the constraint condition for the element in the element content of the identified element declaration into the constraint condition acquired as the conversion candidate and a control unit that performs,
A storage unit that stores, as conversion candidate information, element declarations in the original schema and the strictest constraints that can determine that the elements included in the sample data are valid,
The controller is
The elements included in the sample data are searched with depth priority, and the strictest constraints that can be determined to be appropriate for the elements searched in the order of return are obtained as conversion candidates.
In the conversion candidate information, a constraint condition associated with an element declaration corresponding to an element included in the sample data and a constraint condition that satisfies the acquired constraint condition are identified, and the constraint in the conversion candidate information A schema conversion apparatus characterized in that a condition is changed to a specified constraint condition .
請求項1に記載のスキーマ変換装置であって、
前記制御部は、
予め定められた制約条件の厳しさの序列に従って、サンプルデータに含まれる要素を妥当と判断可能な最も厳しい制約条件を取得すること、
を特徴とするスキーマ変換装置。
The schema conversion device according to claim 1,
The controller is
Obtaining the most stringent constraints that can be considered appropriate for the elements included in the sample data, in accordance with a pre-determined order of severity of constraints,
Schema conversion device characterized by
請求項に記載のスキーマ変換装置であって、
前記序列は、包含されるデータ型が、包含するデータ型よりもより厳しいと判断されるものであること、
を特徴とするスキーマ変換装置。
The schema conversion device according to claim 2 ,
The ranking is such that the included data type is determined to be stricter than the included data type;
Schema conversion device characterized by
請求項に記載のスキーマ変換装置であって、
前記序列は、要素内容の値の長さの範囲の狭いものが、より厳しいと判断されるものであること、
を特徴とするスキーマ変換装置。
The schema conversion device according to claim 2 ,
The order is such that a narrow range of element content values is judged to be stricter,
Schema conversion device characterized by
請求項に記載のスキーマ変換装置であって、
前記序列は、要素内容として出現する要素の数の範囲の狭いものが、より厳しいと判断されるものであること、
を特徴とするスキーマ変換装置。
The schema conversion device according to claim 2 ,
The order is determined to be stricter if the range of the number of elements appearing as element contents is narrow,
Schema conversion device characterized by
請求項に記載のスキーマ変換装置であって、
前記序列は、要素内容として出現する要素が、任意の要素の出現を認めているものよりも、特定の要素の出現を認めているものの方が、より厳しいと判断されるものであること、
を特徴とするスキーマ変換装置。
The schema conversion device according to claim 2 ,
The order is determined to be more severe when an element appearing as element content allows the appearance of a specific element than the element that allows the appearance of an arbitrary element,
Schema conversion device characterized by
請求項1に記載のスキーマ変換装置であって、
オリジナルスキーマの変更を許容する要素宣言と、制約条件の種別と、を特定する設定情報を記憶する記憶部を備え、
前記制御部は、前記変換候補のうち、前記設定情報において特定されている要素宣言及び制約条件の種別に対応する制約条件を、前記オリジナルスキーマの制約条件と変換すること、
を特徴とするスキーマ変換装置。
The schema conversion device according to claim 1,
A storage unit is provided for storing setting information for specifying element declarations that allow changes to the original schema and types of constraint conditions,
The control unit converts, among the conversion candidates, a constraint condition corresponding to an element declaration and a constraint condition type specified in the setting information, with a constraint condition of the original schema,
Schema conversion device characterized by
請求項1に記載のスキーマ変換装置であって、
前記制御部は、
前記変換候補を出力部に表示する処理と、
入力部を介して、表示された変換候補を適用するか否かの入力を受け付ける処理と、
適用すると入力された変換候補に対応する制約条件と、前記オリジナルスキーマの制約条件と、の変換を行う処理と、を行うこと、
を特徴とするスキーマ変換装置。
The schema conversion device according to claim 1,
The controller is
Processing for displaying the conversion candidate on the output unit;
A process of receiving an input as to whether or not to apply the displayed conversion candidate through the input unit;
A process of converting the constraint condition corresponding to the input conversion candidate when applied and the constraint condition of the original schema;
Schema conversion device characterized by
コンピュータを、スキーマ文書を生成するスキーマ変換装置として機能させるプログラムであって、
前記コンピュータを、
サンプルデータに含まれる要素を妥当と判断可能な最も厳しい制約条件を変換候補として、当該要素毎に取得する処理と、
前記要素に対応する要素宣言をオリジナルスキーマより特定し、特定した要素宣言の要素内容における前記要素に対する制約条件を、前記変換候補として取得した制約条件に変換することで、前記スキーマ文書を生成する処理と、を行う制御手段と
前記オリジナルスキーマ内の要素宣言と、サンプルデータに含まれる要素を妥当と判断可能な最も厳しい制約条件と、を変換候補情報として記憶する記憶手段と、して機能させ、
前記制御手段に、
前記サンプルデータに含まれる要素を、深さ優先で探索し、帰りがけ順で探索された要素を妥当と判断可能な最も厳しい制約条件を変換候補として取得する処理と、
前記変換候補情報において、前記サンプルデータに含まれる要素に対応する要素宣言に対応付けられている制約条件と、取得した制約条件と、を満たす最も厳しい制約条件を特定し、前記変換候補情報における制約条件を、特定した制約条件に変更する処理と、を行わせること、
を特徴とするプログラム。
A program that causes a computer to function as a schema conversion device that generates a schema document,
The computer,
A process for obtaining each element as the conversion candidate with the strictest constraint that can determine that the element included in the sample data is valid,
A process of generating the schema document by specifying an element declaration corresponding to the element from the original schema, and converting the constraint condition for the element in the element content of the identified element declaration into the constraint condition acquired as the conversion candidate and, a control means for performing,
Functioning as storage means for storing the element declaration in the original schema and the strictest constraints that can determine that the elements included in the sample data are valid as conversion candidate information,
In the control means,
A process of searching for an element included in the sample data with depth priority, and acquiring the most strict constraint that can be determined to be valid as an element searched for in return order, as a conversion candidate;
In the conversion candidate information, a constraint condition associated with an element declaration corresponding to an element included in the sample data and a constraint condition that satisfies the acquired constraint condition are identified, and the constraint in the conversion candidate information Processing to change the condition to the specified constraint condition,
A program characterized by
請求項に記載のプログラムであって、
前記制御手段に、
予め定められた制約条件の厳しさの序列に従って、サンプルデータに含まれる要素を妥当と判断可能な最も厳しい制約条件を取得する処理を行わせること、
を特徴とするプログラム。
The program according to claim 9 , wherein
In the control means,
In accordance with a predetermined order of severity of constraints, let the process to obtain the most severe constraints that can be considered appropriate elements included in the sample data,
A program characterized by
請求項10に記載のプログラムであって、
前記序列は、包含されるデータ型が、包含するデータ型よりもより厳しいと判断されるものであること、
を特徴とするプログラム。
The program according to claim 10 ,
The ranking is such that the included data type is determined to be stricter than the included data type;
A program characterized by
請求項10に記載のプログラムであって、
前記序列は、要素内容の値の長さの範囲の狭いものが、より厳しいと判断されるものであること、
を特徴とするプログラム。
The program according to claim 10 ,
The order is such that a narrow range of element content values is judged to be stricter,
A program characterized by
請求項10に記載のプログラムであって、
前記序列は、要素内容として出現する要素の数の範囲の狭いものが、より厳しいと判断されるものであること、
を特徴とするプログラム。
The program according to claim 10 ,
The order is determined to be stricter if the range of the number of elements appearing as element contents is narrow,
A program characterized by
請求項10に記載のプログラムであって、
前記序列は、要素内容として出現する要素が、任意の要素の出現を認めているものよりも、特定の要素の出現を認めているものの方が、より厳しいと判断されるものであること、
を特徴とするプログラム。
The program according to claim 10 ,
The order is determined to be more severe when an element appearing as element content allows the appearance of a specific element than the element that allows the appearance of an arbitrary element,
A program characterized by
請求項10に記載のプログラムであって、
前記制御手段に、
前記変換候補を出力手段に表示する処理と、
入力手段を介して、表示された変換候補を適用するか否かの入力を受け付ける処理と、
適用すると入力された変換候補に対応する制約条件と、前記オリジナルスキーマの制約条件と、の変換を行う処理と、を行わせること、
を特徴とするプログラム。
The program according to claim 10 ,
In the control means,
Processing for displaying the conversion candidates on an output means;
A process of receiving an input as to whether or not to apply the displayed conversion candidate via an input means;
A process of converting the constraint condition corresponding to the input conversion candidate when applied and the constraint condition of the original schema;
A program characterized by
制御部および記憶部を有するスキーマ変換装置が、スキーマ文書を生成するスキーマ生成方法であって、
前記制御部が、サンプルデータに含まれる要素を妥当と判断可能な最も厳しい制約条件を変換候補として、当該要素毎に取得する処理と、
前記制御部が、前記要素に対応する要素宣言をオリジナルスキーマより特定し、特定した要素宣言の要素内容における前記要素に対する制約条件を、前記変換候補として取得した制約条件に変換することで、前記スキーマ文書を生成する処理と、を行う過程と、
前記記憶部が、前記オリジナルスキーマ内の要素宣言と、サンプルデータに含まれる要素を妥当と判断可能な最も厳しい制約条件と、を変換候補情報として記憶する過程と、を備え、
前記制御部は、
前記サンプルデータに含まれる要素を、深さ優先で探索し、帰りがけ順で探索された要素を妥当と判断可能な最も厳しい制約条件を変換候補として取得する処理と、
前記変換候補情報において、前記サンプルデータに含まれる要素に対応する要素宣言に対応付けられている制約条件と、取得した制約条件と、を満たす最も厳しい制約条件を特定し、前記変換候補情報における制約条件を、特定した制約条件に変更する処理と、を行うこと
を特徴とするスキーマ生成方法。
A schema conversion apparatus having a control unit and a storage unit is a schema generation method for generating a schema document,
The control section, the elements contained in the sample data as a conversion candidate severest constraints capable considered appropriate, the process of acquiring each said element,
The control unit identifies an element declaration corresponding to the element from the original schema, and converts the constraint condition for the element in the element content of the identified element declaration into the constraint condition acquired as the conversion candidate, thereby the schema. and over extent to carry out the process of generating the document, the,
The storage unit includes a process of storing element declarations in the original schema and the strictest constraints that can determine that the elements included in the sample data are valid as conversion candidate information,
The controller is
A process of searching for an element included in the sample data with depth priority, and acquiring the most strict constraint that can be determined to be valid as an element searched for in return order, as a conversion candidate;
In the conversion candidate information, a constraint condition associated with an element declaration corresponding to an element included in the sample data and a constraint condition that satisfies the acquired constraint condition are identified, and the constraint in the conversion candidate information And a process for changing a condition to a specified constraint condition .
JP2008188552A 2008-07-22 2008-07-22 Schema conversion device, program, and schema generation method Expired - Fee Related JP5235545B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008188552A JP5235545B2 (en) 2008-07-22 2008-07-22 Schema conversion device, program, and schema generation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008188552A JP5235545B2 (en) 2008-07-22 2008-07-22 Schema conversion device, program, and schema generation method

Publications (2)

Publication Number Publication Date
JP2010026857A JP2010026857A (en) 2010-02-04
JP5235545B2 true JP5235545B2 (en) 2013-07-10

Family

ID=41732621

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008188552A Expired - Fee Related JP5235545B2 (en) 2008-07-22 2008-07-22 Schema conversion device, program, and schema generation method

Country Status (1)

Country Link
JP (1) JP5235545B2 (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9286275B2 (en) * 2004-08-23 2016-03-15 Oracle America, Inc. System and method for automatically generating XML schema for validating XML input documents
JP4501886B2 (en) * 2006-03-30 2010-07-14 日本電気株式会社 XML schema editing support apparatus, XML schema editing support method, and program

Also Published As

Publication number Publication date
JP2010026857A (en) 2010-02-04

Similar Documents

Publication Publication Date Title
CN106682219B (en) Associated document acquisition method and device
CN101258487B (en) Annotating documents in a collaborative application with data in disparate information systems
US20060218160A1 (en) Change control management of XML documents
US20170102925A1 (en) Automatch process and system for software development kit for application programming interface
US8095913B2 (en) Computer readable storage medium that stores a test specifications creating program, test specifications creating apparatus and test specifications creating method
JP4285658B2 (en) Apparatus and method for providing web service
CN101256492A (en) Software development method and system for executing model drive structure
CN109801677B (en) Sequencing data automatic analysis method and device and electronic equipment
CN106776266B (en) Configuration method of test tool and terminal equipment
US20060203274A1 (en) Document processing apparatus, method of control of such apparatus and storage medium storing document processing program
JP5675676B2 (en) Business analysis design support device, business analysis design support method, and business analysis design support program
CN117112060A (en) Component library construction method and device, electronic equipment and storage medium
Gómez et al. An approach to the co-creation of models and metamodels in Enterprise Architecture Projects.
JP2010152699A (en) Method, system, device and program for reusing data
JP5235545B2 (en) Schema conversion device, program, and schema generation method
US20130262451A1 (en) Analysis support apparatus, analysis support method and analysis support program
KR20110094804A (en) Semantic tagging server for supporting reuse of software artifacts, and methods thereof
Le Zou et al. On synchronizing with web service evolution
JP4802125B2 (en) Weblog management program, weblog management apparatus, and weblog management method
US7725504B2 (en) Method and apparatus for helping user form structured diagram from unstructured information source
US20050120299A1 (en) System and method for creation of a network server application page
JP4045283B2 (en) Data management apparatus and data management method
KR102624044B1 (en) Method of application generation based on template and server implementing thereof
JP2018045525A (en) Reference information output program, output program, reference information output method, and reference information output device
Koder Increasing Full Stack Development Productivity via Technology Selection

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110125

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20121127

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130128

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20130226

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130326

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

Free format text: PAYMENT UNTIL: 20160405

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees