JP2005352945A - Style sheet creation device - Google Patents

Style sheet creation device Download PDF

Info

Publication number
JP2005352945A
JP2005352945A JP2004175206A JP2004175206A JP2005352945A JP 2005352945 A JP2005352945 A JP 2005352945A JP 2004175206 A JP2004175206 A JP 2004175206A JP 2004175206 A JP2004175206 A JP 2004175206A JP 2005352945 A JP2005352945 A JP 2005352945A
Authority
JP
Japan
Prior art keywords
file
conversion pattern
style sheet
item
correspondence
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.)
Pending
Application number
JP2004175206A
Other languages
Japanese (ja)
Inventor
Yoshihisa Terada
佳久 寺田
Shuichi Shimizu
秀一 清水
Yuka Ozawa
由佳 小澤
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2004175206A priority Critical patent/JP2005352945A/en
Publication of JP2005352945A publication Critical patent/JP2005352945A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a style sheet creation device for precisely and automatically performing a conversion between structured documents. <P>SOLUTION: This style sheet creation device comprises a schema file analysis means 202 analyzing first and second schema files describing, for first and second structured documents, the structures thereof, respectively; a correspondence file analysis means 201 reading and analyzing a correlation file describing the associations of items between the first and second structured documents; a conversion pattern determination means 203 determining a conversion pattern from the first structured document to the second structured document based on the analysis result of the correspondence file and the analysis result of the schema files; and a style sheet output means outputting, based on the conversion pattern, a style sheet for performing the conversion of data structure between different structured documents of the first and second structured document. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、データ構造の異なる構造化文書間においてデータ構造の変換を行うためのスタイルシート作成装置に関するものである。   The present invention relates to a style sheet creation apparatus for converting a data structure between structured documents having different data structures.

近年、インターネットやデジタル放送の普及により、コンテンツの数が爆発的に増加している。これら多くのコンテンツの中から、所望のコンテンツの内容把握や検索を容易に行うために、コンテンツに様々なメタデータを付加するケースが増加してきている。また、メタデータは、コンピュータ同士のデータ送受信やインターネットとの親和性を考慮し、例えばメタ言語であるXML(eXtensible Markup Language)により記述されている。このXML等の記述のデータ構造は様々な団体により策定されている。また、メタ言語のデータ構造は、メタデータが付加されるコンテンツの種類や、メタデータを利用する目的に応じて異なる。よって、コンテンツに適合させてメタデータに基づいたXML文書を作成しても、他の用途にコンテンツを利用する場合には、他の用途に適合するデータ構造のXML文書を新たに作成する必要がある。新たに作成するXML文書は、すでに作成されているXML文書を利用して作成するのが有効であるため、XML文書のデータ構造の変換が行われる。ここで、XML文書間のデータ構造を変換する場合、XML文書に対してXSLT(XML Stylesheet Language Transformations)変換を行う。このとき、どのような変換を行うかを指定するスタイルシートとしてXSLTファイルが作成される。   In recent years, with the spread of the Internet and digital broadcasting, the number of contents has increased explosively. Among these many contents, in order to easily grasp and search the contents of desired contents, cases of adding various metadata to the contents are increasing. The metadata is described in XML (eXtensible Markup Language), which is a meta language, in consideration of data transmission / reception between computers and affinity with the Internet. The data structure of description such as XML is formulated by various organizations. Further, the data structure of the meta language differs depending on the type of content to which the metadata is added and the purpose for using the metadata. Therefore, even if an XML document based on metadata is created in conformity with the content, if the content is used for other purposes, it is necessary to create a new XML document having a data structure suitable for the other purposes. is there. Since it is effective to create a newly created XML document using an already created XML document, the data structure of the XML document is converted. Here, when the data structure between XML documents is converted, XSLT (XML Stylesheet Language Transformations) conversion is performed on the XML document. At this time, an XSLT file is created as a style sheet that specifies what conversion is to be performed.

特許文献1では、構造化文書を変換するための部品が、GUI(Graphical User Interface)を用いてメタデータの制作者に提示される。ここで、部品とは、変換ルールを記述したフォーム記述を部品化したものである。また、フォーム記述とは、構造化文書を表示装置に整った体裁で表示する形式に変換するための制御ルールを記述したものである。制作者が提示された部品から所望の部品を選択すると、部品が組み合わされてXSLTファイルが形成される。よって、XSLTに関する知識を持たない人でも、容易にXSLTファイルを作成することができる。   In Patent Document 1, a component for converting a structured document is presented to a metadata producer using a GUI (Graphical User Interface). Here, the component is a component of the form description describing the conversion rule. The form description is a description of control rules for converting a structured document into a format that is displayed in a format that is arranged on a display device. When the creator selects a desired part from the presented parts, the parts are combined to form an XSLT file. Therefore, even a person who does not have knowledge about XSLT can easily create an XSLT file.

また、特許文献2では、変換対象のXML文書のXMLスキーマを全てオントロジーモデルへ変換する。そして、変換されたオントロジーモデルによりXML文書間の項目の対応関係を抽出し、自動的にXSLTファイルを作成している。
特開2003−303183号公報 特開2003−233528号公報
Moreover, in patent document 2, all the XML schemas of the XML document to be converted are converted into an ontology model. Then, the correspondence of items between XML documents is extracted by the converted ontology model, and an XSLT file is automatically created.
JP 2003-303183 A JP 2003-233528 A

しかし、特許文献1では、XML文書を変換するために必要な部品を、XML文書の変換を行う制作者が人手で選択しなければならない。ここで、XML文書の変換は、XMLの構造変換を行う変換であるため、XML文書間の部品、つまり後述の項目の対応関係を考える必要がある。つまり、項目が、例えば「要素」「属性」「要素値」「属性値」のいずれであるかを考えて必要な部品を選択する必要がある。よって、XSLTファイルを自動的に作成することができず、XSLTファイルの作成にも時間がかかる。   However, in Japanese Patent Laid-Open No. 2004-228561, a creator who converts an XML document must manually select parts necessary for converting the XML document. Here, since the conversion of the XML document is a conversion that performs XML structure conversion, it is necessary to consider the correspondence between components between XML documents, that is, items to be described later. That is, it is necessary to select a necessary component in consideration of whether the item is, for example, “element”, “attribute”, “element value”, or “attribute value”. Therefore, the XSLT file cannot be automatically created, and it takes time to create the XSLT file.

また、特許文献2では、オントロジーモデルによりXML文書間のタグの関係を抽出する際に、変換対象のXML文書のXMLスキーマを全てオントロジーモデルへ変換する必要がある。よって、意味的構造を記述していないXMLスキーマ言語から意味的構造を記述するオントロジーに変換を行う際に、項目が有する情報の欠落や、情報の意味の変更などの問題が発生する。   In Patent Document 2, it is necessary to convert all XML schemas of an XML document to be converted into an ontology model when extracting a tag relationship between XML documents using an ontology model. Therefore, when an XML schema language that does not describe a semantic structure is converted into an ontology that describes a semantic structure, problems such as missing information in items and changes in the meaning of information occur.

そこで、本発明は、構造化文書間の変換を正確かつ自動的に行うためのスタイルシート作成装置を提供することを目的とする。   SUMMARY An advantage of some aspects of the invention is that it provides a style sheet creation apparatus for accurately and automatically converting between structured documents.

本願第1発明は、上記の課題を解決するために、データ構造の異なる第1及び第2構造化文書間においてデータ構造の変換を行うためのスタイルシート作成装置であって、前記第1及び第2構造化文書それぞれについてその構造を記述した第1及び第2スキーマファイルを解析するスキーマファイル解析手段と、各構造化文書に含まれる情報単位である項目について、前記第1及び第2構造化文書間におけるその関連付けを記述した対応関係ファイルを読み込み、前記項目の対応関係を解析する対応関係ファイル解析手段と、前記対応関係ファイルの解析結果及び前記スキーマファイルの解析結果に基づいて、前記第1構造化文書から前記第2構造化文書への変換パターンを決定する変換パターン決定手段と、前記変換パターンに基づいて、前記第1及び第2構造化文書の異なる構造化文書間におけるデータ構造の変換を行うためのスタイルシートを出力するスタイルシート出力手段と、を含むことを特徴とするスタイルシート作成装置を提供する。   A first invention of the present application is a style sheet creation device for converting a data structure between a first and a second structured document having different data structures in order to solve the above-mentioned problems. Schema file analysis means for analyzing the first and second schema files describing the structure of each of the two structured documents, and the first and second structured documents for items which are information units included in each structured document A correspondence file analysis unit that reads the correspondence file describing the association between the items and analyzes the correspondence relationship of the items, and the first structure based on the analysis result of the correspondence file and the analysis result of the schema file Conversion pattern determining means for determining a conversion pattern from the structured document to the second structured document, and based on the conversion pattern, Providing a style sheet producing apparatus which comprises a style sheet output means for outputting a style sheet for converting the data structure between serial different structured document of the first and second structured document.

ここで、項目とは、例えば構造化文書において要素位置を明示し、属性を収納するためのタグである。上記のように、対応関係ファイルを利用することにより、スキーマファイルから自動的かつ効率的に項目を抽出することができる。また、対応関係ファイル解析手段により項目間の対応関係を解析し、スキーマファイル解析手段により項目間の階層構造及び種類を解析することで、第1構造化文書から第2構造化文書への変換パターンを項目ごとに決定することができる。例えば、構造化文書の項目の種類が「要素」と「属性」の2種類である場合、第1構造化文書の変換対象である項目ごとに、「要素」→「要素」、「要素」→「属性」、「属性」→「要素」などの変換パターンを決定することができる。よって、決定された変換パターンに基づいてスタイルシートを自動的、効率的かつ容易に作成することができる。   Here, the item is, for example, a tag for clearly indicating an element position in a structured document and storing an attribute. As described above, the items can be automatically and efficiently extracted from the schema file by using the correspondence file. Also, the correspondence pattern between the first structured document and the second structured document is analyzed by analyzing the correspondence between items by the correspondence file analyzing means and analyzing the hierarchical structure and type between items by the schema file analyzing means. Can be determined for each item. For example, when there are two types of items of the structured document, “element” and “attribute”, “element” → “element”, “element” → “element” → for each item to be converted in the first structured document. A conversion pattern such as “attribute”, “attribute” → “element” can be determined. Therefore, a style sheet can be created automatically, efficiently and easily based on the determined conversion pattern.

また、スタイルシートの作成は、スキーマファイルから対応関係ファイルのモデルへの変換を伴わずに、対応関係ファイル及びスキーマファイルの解析結果に基づいて行われる。そのため、変換に伴う項目の情報の欠落や情報の意味の変更などを防止することができる。   The style sheet is created based on the analysis result of the correspondence file and the schema file without conversion from the schema file to the model of the correspondence file. Therefore, it is possible to prevent a lack of item information or a change in the meaning of information associated with the conversion.

本願第2発明は、第1発明において、前記スキーマファイル解析手段は、前記対応関係ファイル解析手段において前記第1及び第2構造化文書間の対応関係が解析された項目を、前記第1及び第2スキーマファイルから抽出し、抽出した項目の情報を解析することを特徴とするスタイルシート作成装置を提供する。   According to a second aspect of the present invention, in the first aspect, the schema file analysis unit includes the first and second items obtained by analyzing the correspondence relationship between the first and second structured documents in the correspondence file analysis unit. 2. A style sheet creation apparatus characterized by extracting information from an extracted item from a schema file and analyzing the extracted item information.

対応関係ファイル解析手段が対応関係ファイルに基づいて解析した項目とは、すなわち変換対象となる項目である。第1及び第2スキーマファイルの項目のうち、変換対象の項目のみについて、項目の階層構造や種類を解析することにより、効率的にスタイルシートを作成することができる。   The item analyzed by the correspondence file analysis unit based on the correspondence file is an item to be converted. Of the items in the first and second schema files, only the items to be converted can be efficiently created by analyzing the hierarchical structure and type of items.

本願第3発明は、第2発明において、前記項目の情報とは、前記項目の種類及び/または項目の階層構造であることを特徴とするスタイルシート作成装置を提供する。   A third invention of the present application provides the style sheet creating apparatus according to the second invention, wherein the item information is a type of the item and / or a hierarchical structure of the item.

項目の階層構造を解析することにより、異なる階層構造を有する構造化文書間でも正確なデータ構造の変換が可能となる。また項目の種類を解析することにより、構造化文書間で項目の扱いが異なる場合でも正確なデータ構造の変換が可能となる。   By analyzing the hierarchical structure of items, an accurate data structure can be converted between structured documents having different hierarchical structures. Also, by analyzing the types of items, it is possible to convert the data structure accurately even when the handling of items differs between structured documents.

本願第4発明は、第3発明において、前記項目の種類は、要素、属性、要素値及び/または属性値が含まれることを特徴とするスタイルシート作成装置を提供する。   A fourth invention of the present application provides the style sheet creating apparatus according to the third invention, wherein the type of the item includes an element, an attribute, an element value, and / or an attribute value.

本願第5発明は、第1発明において、前記対応関係ファイルは、OWL(Web Ontology Language)により記述されたオントロジーファイルであることを特徴とするスタイルシート作成装置を提供する。   A fifth invention of the present application provides the style sheet creating apparatus according to the first invention, wherein the correspondence file is an ontology file described by OWL (Web Ontology Language).

項目の対応関係を記述した対応関係ファイルとしてオントロジーファイルを利用することにより、構造化文書間の項目の対応関係を効率的に検索することができる。また、インターネット上で利用されているオントロジーファイルを利用することにより、HTML文書などの情報を映像データのメタデータに容易に変換することができる。   By using the ontology file as the correspondence file describing the correspondence between items, it is possible to efficiently retrieve the correspondence between items between structured documents. Further, by using an ontology file used on the Internet, information such as an HTML document can be easily converted into metadata of video data.

本願第6発明は、第1発明において、前記スキーマファイル解析手段は、前記対応関係ファイル解析手段において前記第1及び第2構造化文書間の対応関係が解析された項目を、前記第1及び第2スキーマファイルから抽出し、その情報を解析し、前記変換パターン決定手段は、抽出された項目の対応関係を項目の情報の対応関係に置換することにより変換パターンを項目毎に決定することを特徴とするスタイルシート作成装置を提供する。   According to a sixth aspect of the present invention, in the first aspect, the schema file analyzing means includes the first and second items obtained by analyzing the correspondence between the first and second structured documents in the correspondence file analyzing means. 2. Extracting from a schema file and analyzing the information, the conversion pattern determining means determines a conversion pattern for each item by replacing the correspondence of the extracted item with the correspondence of the item information. A style sheet creating apparatus is provided.

対応関係ファイル解析手段は、例えば、第1構造化文書の項目1と第2構造化文書の項目2とが等しい(項目1→項目2)ことを解析する。また、スキーマファイル解析手段は、スキーマファイルの解析結果として例えば項目の種類を特定する。ここで、項目の種類とは、例えば「要素」、「属性」、「要素値」または「属性値」などのタグの内容である。例えば、項目1の種類が「要素」、項目2の種類が「属性」の場合は、対応関係ファイルから解析した対応関係(項目1→項目2)と各項目の種類とに基づいて、変換パターン決定手段は、「要素」→「属性」の変換パターンと決定する。このように、変換パターンの決定は、対応関係ファイル及びスキーマファイルの解析結果に基づいて、自動的かつ効率的に行われる。よって、第1構造化文書と第2構造化文書との間でデータ構造の変換を行うためのスタイルシートを、この変換パターンに基づいて自動的、効率的かつ容易に作成できる。また、スタイルシートの作成は、スキーマファイルから対応関係ファイルのモデルへの変換を伴わずに、対応関係ファイル及びスキーマファイルの解析結果に基づいて行われる。そのため、変換に伴う項目の情報の欠落や情報の意味の変更などを防止することができる。   The correspondence relationship file analysis unit analyzes, for example, that item 1 of the first structured document is equal to item 2 of the second structured document (item 1 → item 2). Further, the schema file analysis means specifies, for example, the type of item as the analysis result of the schema file. Here, the item type is the content of a tag such as “element”, “attribute”, “element value”, or “attribute value”. For example, when the type of item 1 is “element” and the type of item 2 is “attribute”, the conversion pattern is calculated based on the correspondence (item 1 → item 2) analyzed from the correspondence file and the type of each item. The determining means determines the conversion pattern of “element” → “attribute”. Thus, the conversion pattern is automatically and efficiently determined based on the analysis result of the correspondence file and the schema file. Therefore, a style sheet for converting the data structure between the first structured document and the second structured document can be created automatically, efficiently and easily based on this conversion pattern. The style sheet is created based on the analysis result of the correspondence file and the schema file without conversion from the schema file to the model of the correspondence file. Therefore, it is possible to prevent a lack of item information or a change in the meaning of information associated with the conversion.

本願第7発明は、第1発明において、前記変換パターン決定手段は、前記第2構造化文書から前記第1構造化文書への変換パターンをさらに決定することを特徴とするスタイルシート作成装置を提供する。   A seventh invention of the present application provides the style sheet creation device according to the first invention, wherein the conversion pattern determining means further determines a conversion pattern from the second structured document to the first structured document. To do.

第1構造化文書から第2構造化文書への変換を行うスタイルシートだけでなく、第2構造化文書から第1構造化文書への変換を行うスタイルシートを作成することができる。   In addition to the style sheet for converting from the first structured document to the second structured document, a style sheet for converting from the second structured document to the first structured document can be created.

本願第8発明は、第1発明において、前記スタイルシート出力手段は、前記第1構造化文書の項目から前記第2構造化文書の項目への変換パターンを所定のスタイルシート言語で定義するテンプレートを、変換パターン毎に記憶している変換パターン蓄積手段と、前記変換パターン決定手段が決定した各変換パターンに対応するテンプレートを前記変換パターン蓄積手段から抽出し、抽出したテンプレートに基づいて前記スタイルシートに前記スタイルシート言語で前記変換パターンを記述するテンプレート記述手段とを有することを特徴とするスタイルシート作成装置を提供する。   According to an eighth aspect of the present invention, in the first aspect, the style sheet output means includes a template that defines a conversion pattern from the item of the first structured document to the item of the second structured document in a predetermined style sheet language. The conversion pattern storage means stored for each conversion pattern and the template corresponding to each conversion pattern determined by the conversion pattern determination means are extracted from the conversion pattern storage means, and the style sheet is extracted based on the extracted template. There is provided a style sheet creating apparatus comprising template description means for describing the conversion pattern in the style sheet language.

第1構造化文書の項目から第2構造化文書の項目への変換パターンに応じたテンプレートを用いて、スタイルシート言語によるスタイルシートの作成を容易に行うことができる。   Using a template corresponding to the conversion pattern from the first structured document item to the second structured document item, a style sheet can be easily created in a style sheet language.

本願第9発明は、第8発明において、前記変換パターン蓄積手段は、項目の情報の変換パターンを定義するテンプレートを記憶していることを特徴とするスタイルシート作成装置を提供する。   A ninth invention of the present application provides the style sheet creating apparatus according to the eighth invention, wherein the conversion pattern storage means stores a template defining a conversion pattern of item information.

構造化文書間で、項目の情報が異なる場合であっても正確にデータ構造を変換することができるスタイルシートを作成することができる。例えば、構造化文書間で階層構造が異なる場合や構造の種類が異なる場合であっても正確なデータ構造の変換が可能となる。   It is possible to create a style sheet that can accurately convert the data structure even when item information differs between structured documents. For example, even when the hierarchical structure is different between structured documents or when the types of structures are different, an accurate data structure can be converted.

本願第10発明は、第1発明において、前記構造化文書はXML(eXtensible Markup Language)文書であり、前記スキーマファイルはXMLスキーマファイルであり、前記スタイルシートはXSLT(XML Stylesheet Language Transformations)ファイルであることを特徴とするスタイルシート作成装置を提供する。   In a tenth aspect of the present invention, in the first aspect, the structured document is an XML (eXtensible Markup Language) document, the schema file is an XML schema file, and the style sheet is an XSLT (XML Stylesheet Language Transformations) file. Provided is a style sheet creating apparatus characterized by the above.

本願第11発明は、データ構造の異なる第1及び第2構造化文書間においてデータ構造の変換を行うためのスタイルシート作成方法であって、前記第1及び第2構造化文書それぞれについてその構造を記述した第1及び第2スキーマファイルを解析するスキーマファイル解析ステップと、各構造化文書に含まれる情報単位である項目について、前記第1及び第2構造化文書間におけるその関連付けを記述した対応関係ファイルを読み込み、前記項目の対応関係を解析する対応関係ファイル解析ステップと、前記対応関係ファイルの解析結果及び前記スキーマファイルの解析結果に基づいて、前記第1構造化文書から前記第2構造化文書への変換パターンを決定する変換パターン決定ステップと、前記変換パターンに基づいて、前記第1及び第2構造化文書の異なる構造化文書間におけるデータ構造の変換を行うためのスタイルシートを出力するスタイルシート出力ステップとを含むことを特徴とするスタイルシート作成方法を提供する。   The eleventh invention of the present application is a style sheet creation method for converting the data structure between the first and second structured documents having different data structures, and the structure of each of the first and second structured documents. Schema file analysis step for analyzing the described first and second schema files, and the correspondence relationship describing the association between the first and second structured documents with respect to items which are information units included in each structured document Based on the correspondence file analysis step of reading the file and analyzing the correspondence of the items, and the analysis result of the correspondence file and the analysis result of the schema file, the first structured document to the second structured document A conversion pattern determining step for determining a conversion pattern into the first and second based on the conversion pattern Providing a style sheet creation method characterized by including a style sheet output step of outputting a style sheet for converting the data structure in different structured documents of the structured document.

構造化文書間の項目の対応関係を記述した対応関係ファイルを利用することにより、スタイルシートを自動的、効率的かつ容易に作成することができる。また、スタイルシートの作成は、スキーマファイルから対応関係ファイルのモデルへの変換を伴わずに、対応関係ファイル及びスキーマファイルの解析結果に基づいて行われる。そのため、変換に伴う項目の情報の欠落や情報の意味の変更などを防止することができる。   By using a correspondence file describing the correspondence between items between structured documents, a style sheet can be created automatically, efficiently and easily. The style sheet is created based on the analysis result of the correspondence file and the schema file without conversion from the schema file to the model of the correspondence file. Therefore, it is possible to prevent a lack of item information or a change in the meaning of information associated with the conversion.

<発明の概要>
以下、メタ言語とは、データの論理的な構造を記述するための言語である。メタ言語としては、例えば前述のXMLの他にSGML(Standard Generalized Markup Language)やHTML(HyperText Markup Language)等が挙げられる。また、構造化文書とは、メタ言語を用いて作成された文書であり、XML文書、SGML文書及びHTML等が挙げられる。スキーマファイルとは、構造化文書の取り得る構造をスキーマ言語で記述したファイルであり、例えばXMLスキーマファイルが挙げられる。なお、後述の項目の情報や階層構造を読み取り可能なファイルであればXMLスキーマファイルに限定されず、例えばRDF(Resource Description Framework)ファイルやCSV(Comma Separated Value)ファイルなどを用いることができる。また、スタイルシートとは、異なるデータ構造を有する構造化文書間のデータ構造を変換するための変換ルールを記述したものであり、例えばXMLスタイルシートが挙げられる。スタイルシートのスタイルシート言語としては、XSLT(XML Stylesheet Language Transformations)ファイルなどが挙げられる。
<Summary of invention>
Hereinafter, the meta language is a language for describing the logical structure of data. Examples of the meta language include SGML (Standard Generalized Markup Language) and HTML (HyperText Markup Language) in addition to the above-described XML. A structured document is a document created using a meta language, and examples include an XML document, an SGML document, and HTML. A schema file is a file in which a structure that can be taken by a structured document is described in a schema language. For example, an XML schema file is used. Note that the file is not limited to an XML schema file as long as it can read information on items and a hierarchical structure to be described later. For example, an RDF (Resource Description Framework) file or a CSV (Comma Separated Value) file can be used. A style sheet describes a conversion rule for converting a data structure between structured documents having different data structures, and includes, for example, an XML style sheet. A style sheet language of the style sheet includes an XSLT (XML Stylesheet Language Transformations) file.

また、対応関係ファイルは、構造化文書間の項目の対応関係を記述したファイルであり、例えばシソーラスやオントロジーなどの同義語辞書ファイルが挙げられる。項目とは、例えば構造化文書において要素位置を明示し、属性を収納するためのタグである。また、項目は、項目の種類や項目の階層構造などの情報を有している。項目の種類とは、例えば「要素」、「属性」、「要素値」または「属性値」などのタグの内容である。   The correspondence file is a file that describes the correspondence between items between structured documents, and examples thereof include synonym dictionary files such as a thesaurus and an ontology. The item is, for example, a tag for clearly indicating an element position in a structured document and storing an attribute. The item has information such as the type of item and the hierarchical structure of the item. The item type is the content of a tag such as “element”, “attribute”, “element value”, or “attribute value”.

互いにデータ構造が異なる構造化文書Aと構造化文書Bとの間でデータ構造の変換を行うためのスタイルシートの作成方法の概要を説明する。まず、構造化文書A及び構造化文書B間の項目の関連づけを記述した対応関係ファイルを読み込み、項目の対応関係を解析する。例えば、対応関係ファイルから構造化文書Aの項目IAと構造化文書Bの項目IBとが等しい(項目IA→項目IB)ことが解析される。   An outline of a method of creating a style sheet for converting the data structure between the structured document A and the structured document B having different data structures will be described. First, a correspondence file describing the association of items between the structured document A and the structured document B is read, and the correspondence between items is analyzed. For example, it is analyzed from the correspondence file that the item IA of the structured document A and the item IB of the structured document B are equal (item IA → item IB).

次に、構造化文書AのスキーマファイルSA及び構造化文書BのスキーマファイルSBそれぞれから項目を抽出し、項目間の階層構造及び種類の解析を行う。項目の抽出は、対応関係ファイルにおいて対応関係が解析された項目IA及び項目IBについて行えば良い。例えば、スキーマファイルSAからは項目IAを抽出し、スキーマファイルSBからは項目IBを抽出する。そして、抽出された項目IA及び項目IBの情報を解析する。項目の情報として、例えば項目IAの種類が「要素」、項目IBの種類が「属性」であると解析される。   Next, items are extracted from each of the schema file SA of the structured document A and the schema file SB of the structured document B, and the hierarchical structure and type between the items are analyzed. The item extraction may be performed for the item IA and the item IB whose correspondence is analyzed in the correspondence file. For example, the item IA is extracted from the schema file SA, and the item IB is extracted from the schema file SB. Then, the information of the extracted item IA and item IB is analyzed. As the item information, for example, it is analyzed that the type of the item IA is “element” and the type of the item IB is “attribute”.

上記の対応関係ファイルから解析した項目の対応関係(項目IA→項目IB)と、項目IA、IBの種類に基づいて、構造化文書Aから構造化文書Bへの変換パターンを決定する。ここでは、「要素」→[属性」の変換パターンが決定され、この変換パターンに基づいて構造化文書Aと構造化文書Bとの間でデータ構造の変換を行うためのスタイルシートを作成する。   A conversion pattern from the structured document A to the structured document B is determined on the basis of the correspondence relationship between items analyzed from the correspondence file (item IA → item IB) and the types of the items IA and IB. Here, a conversion pattern of “element” → [attribute] is determined, and a style sheet for converting the data structure between the structured document A and the structured document B is created based on the conversion pattern.

上記のように、構造化文書間の項目の対応関係を記述した対応関係ファイルを利用することにより、スキーマファイルから自動的かつ効率的に項目を抽出することができる。また、対応関係ファイル解析手段により項目間の対応関係を解析し、スキーマファイル解析手段により項目間の階層構造及び種類を解析することで、構造化文書Aから構造化文書Bへの変換パターンを項目ごとに決定することができる。よって、決定された変換パターンに基づいてスタイルシートを自動的、効率的かつ容易に作成することができる。   As described above, items can be automatically and efficiently extracted from the schema file by using the correspondence file describing the correspondence of items between structured documents. In addition, the correspondence file analysis unit analyzes the correspondence between items, and the schema file analysis unit analyzes the hierarchical structure and type between items, thereby converting the conversion pattern from the structured document A to the structured document B. Can be determined for each. Therefore, a style sheet can be created automatically, efficiently and easily based on the determined conversion pattern.

また、スタイルシートの作成は、スキーマファイルから対応関係ファイルのモデルへの変換を伴わずに、対応関係ファイル及びスキーマファイルの解析結果に基づいて行われる。そのため、変換に伴う項目の情報の欠落や情報の意味の変更などを防止することができる。
<第1実施形態例>
[構成]
以下、メタ言語としてXMLを、構造化文書としてはXMLにより記述されたXML文書を、スキーマファイルとしてはXMLスキーマで記述されたXMLスキーマファイルを、対応関係ファイルとしてオントロジーファイルを用いる。また、XSLTファイルによりスタイルシートを作成する場合を例に挙げる。
(1)全体構成
本発明のXSLTファイル作成装置101を有するXML文書変換装置100について第1実施形態例を挙げて詳細に説明する。図1は、第1実施形態例に係るXML文書間におけるデータ構造の変換を示す説明図である。ここで、MPEG(Moving Picture Coding Experts Group)7で記述されたメタデータAとTV Anytimeで記述されたメタデータBとの異なるデータ構造間で変換を行う場合を例に挙げる。以下、メタデータAをXMLで記述した文書をXML文書A、メタデータBをXMLで記述した文書をXML文書Bとする。
The style sheet is created based on the analysis result of the correspondence file and the schema file without conversion from the schema file to the model of the correspondence file. Therefore, it is possible to prevent a lack of item information or a change in the meaning of information associated with the conversion.
<First embodiment>
[Constitution]
Hereinafter, XML is used as a meta language, an XML document described in XML is used as a structured document, an XML schema file described in XML schema is used as a schema file, and an ontology file is used as a correspondence file. An example of creating a style sheet from an XSLT file will be described.
(1) Overall Configuration An XML document conversion apparatus 100 having the XSLT file creation apparatus 101 of the present invention will be described in detail with reference to a first embodiment. FIG. 1 is an explanatory diagram showing data structure conversion between XML documents according to the first embodiment. Here, a case where conversion is performed between different data structures of metadata A described in MPEG (Moving Picture Coding Experts Group) 7 and metadata B described in TV Anytime will be described as an example. Hereinafter, a document in which metadata A is described in XML is referred to as XML document A, and a document in which metadata B is described in XML is referred to as XML document B.

XML文書変換装置100は、XML文書AとXML文書Aと異なるデータ構造で記述されたXML文書Bとの間でのデータ構造の変換を行う。XML文書変換装置100は、スタイルシートであるXSLTファイルを作成するXSLTファイル作成装置101と、作成されたXSLTファイルに基づいてXML文書間のXMLのデータ構造の変換を行うXSLTパーサ102とを含む。XSLTファイル作成装置101は、オントロジーファイル107の解析結果と、XML文書Aの構造を記述したXMLスキーマファイルSA及びXML文書Bの構造を記述したXMLスキーマファイルSBの解析結果に基づいてXSLTファイルを作成する。XSLTパーサ102は、XSLTファイル作成装置101から出力されたXSLTファイルに基づいて、XML文書AとXML文書Bとの間でXMLのデータ構造の変換を行う。   The XML document conversion apparatus 100 converts the data structure between the XML document A and the XML document B described in a data structure different from the XML document A. The XML document conversion apparatus 100 includes an XSLT file generation apparatus 101 that generates an XSLT file that is a style sheet, and an XSLT parser 102 that converts an XML data structure between XML documents based on the generated XSLT file. The XSLT file creation apparatus 101 creates an XSLT file based on the analysis result of the ontology file 107 and the analysis result of the XML schema file SA describing the structure of the XML document A and the XML schema file SB describing the structure of the XML document B. To do. The XSLT parser 102 converts the XML data structure between the XML document A and the XML document B based on the XSLT file output from the XSLT file creation apparatus 101.

(2)XSLTファイル作成装置の構成
次に、XSLTファイル作成装置101によるスタイルシートの作成について説明する。図2は、XSLTファイル作成装置101の構成を示すブロック図である。XSLTファイル作成装置101は、オントロジー解析手段201、スキーマファイル解析手段202、変換パターン決定手段203、テンプレート記述手段204及びテンプレートDB205を含む。ここで、テンプレート記述手段204及びテンプレートDB205は、特許請求の範囲のスタイルシート出力手段に含まれる。XSLTファイル作成装置101は、図3に示す4つの機能を実行する。
◎オントロジーファイル107の解析(ステップS1)
◎XMLスキーマファイルSA及びSBの解析(ステップS2)
◎変換パターンの決定(ステップS3)
◎変換パターンに基づくXSLTファイルの出力(ステップS4)
以下に上記4つの機能について詳細に説明を行う。
(2) Configuration of XSLT File Creation Device Next, creation of a style sheet by the XSLT file creation device 101 will be described. FIG. 2 is a block diagram showing the configuration of the XSLT file creation apparatus 101. The XSLT file creation apparatus 101 includes ontology analysis means 201, schema file analysis means 202, conversion pattern determination means 203, template description means 204, and template DB 205. Here, the template description means 204 and the template DB 205 are included in the style sheet output means in the claims. The XSLT file creation apparatus 101 performs the four functions shown in FIG.
◎ Analysis of ontology file 107 (step S1)
◎ Analysis of XML schema files SA and SB (step S2)
◎ Determination of conversion pattern (step S3)
◎ Output of XSLT file based on conversion pattern (step S4)
The above four functions will be described in detail below.

(2−1)オントロジーファイルの解析
オントロジー解析手段201は、オントロジーファイル107を読み込み、オントロジーファイル107から変換対象となる項目を抽出し、その項目の対応関係を抽出する。
(2-1) Ontology File Analysis The ontology analysis unit 201 reads the ontology file 107, extracts items to be converted from the ontology file 107, and extracts correspondences between the items.

(2−1−1)オントロジーファイル
オントロジーファイル107には、変換対象であるXML文書A及びXML文書B間における項目の対応関係が記述されている。例えばW3C(World Wide Web Consortium)により策定されているOWL(Web Ontology language)を用いてオントロジーファイル107を記述する。なお、項目の関係を記述できればOWLに限定されない。また、項目とは、例えばXML文書において要素位置を明示し、属性を収納するためのタグである。オントロジーファイル107には、項目の対応関係の他に、項目の種類や項目の階層構造などの情報を新たに定義し記述することが可能である。ここで、項目の種類とは、例えば「要素」、「属性」、「要素値」及び/または「属性値」である。また、項目の階層構造とは、項目間の親子関係である。
(2-1-1) Ontology file The ontology file 107 describes the correspondence of items between the XML document A and the XML document B to be converted. For example, the ontology file 107 is described using OWL (Web Ontology language) formulated by W3C (World Wide Web Consortium). In addition, if it can describe the relationship of an item, it will not be limited to OWL. An item is a tag for clearly indicating an element position and storing an attribute in an XML document, for example. In the ontology file 107, in addition to the correspondence between items, information such as item types and item hierarchical structures can be newly defined and described. Here, the item type is, for example, “element”, “attribute”, “element value”, and / or “attribute value”. The item hierarchical structure is a parent-child relationship between items.

なお、後述のXMLスキーマファイルを解析する際に、同一のXML文書内に同一の項目が複数存在する場合がある。そこで、変換対象である項目を識別できるようにオントロジーファイル107の記述を行うと好ましい。例えば、同一のXML文書内に、階層構造がXXX/YYYである項目と、ZZZ/NNN/YYYである項目が存在した場合、オントロジーファイル107にYYYと記述しただけでは、変換対象である項目を一意に識別できない。そこで、YYYの階層構造をオントロジーファイル107に記述してYYYを識別する。また、ZZZ/NNN/YYY中のNNNが一意に識別可能な項目である場合は、例えば項目「NNN」からの相対位置をNNN/YYYのように記述することでYYYを識別する。   When analyzing an XML schema file described later, there may be a plurality of the same items in the same XML document. Therefore, it is preferable to describe the ontology file 107 so that items to be converted can be identified. For example, if there are items whose hierarchical structure is XXX / YYY and items whose structure is ZZZ / NNN / YYY in the same XML document, simply writing YYY in the ontology file 107 will change the item to be converted. It cannot be uniquely identified. Therefore, the YYY hierarchical structure is described in the ontology file 107 to identify YYY. When NNN in ZZZ / NNN / YYY is an item that can be uniquely identified, YYY is identified by describing the relative position from the item “NNN” as NNN / YYY, for example.

(2−1−2)オントロジーファイルにより定義される変換パターン
次に、オントロジーファイルにより定義される変換パターンの一例について説明する。XML文書間のデータ構造の変換では、主に、「要素」、「属性」、「要素値」または「属性値」間において変換が行われる。そのため、変換されるパターンとしては、例えば、図4に示す変換パターンのバリエーションが一例として挙げられる。図4の「No」欄には変換パターンを一意に識別するID番号、「変換パターン」欄には「要素」、「属性」、「要素値」または「属性値」間における変換の方向を示す変換パターンを示す。図4中のNo1の変換パターン「要素」→「要素」は、一方のXML文書の「要素」が、他方のXML文書の「要素」に変換されることを示す。つまり、変換パターン「要素」→「要素」は、一方のXML文書の「要素」が持つ値と他方のXML文書の「要素」が持つ値とが同一となる変換パターンである。
(2-1-2) Conversion Pattern Defined by Ontology File Next, an example of a conversion pattern defined by the ontology file will be described. In the conversion of the data structure between XML documents, conversion is mainly performed between “element”, “attribute”, “element value”, or “attribute value”. Therefore, as a pattern to be converted, for example, a variation of the conversion pattern shown in FIG. 4 is given as an example. In FIG. 4, the “No” column indicates an ID number for uniquely identifying a conversion pattern, and the “Conversion Pattern” column indicates the conversion direction between “element”, “attribute”, “element value”, or “attribute value”. Indicates the conversion pattern. The conversion pattern “element” → “element” of No. 1 in FIG. 4 indicates that “element” of one XML document is converted to “element” of the other XML document. That is, the conversion pattern “element” → “element” is a conversion pattern in which the value of the “element” of one XML document is the same as the value of the “element” of the other XML document.

上記の変換パターンのうち変換パターンNo.1からNo.3までについて、XML文書の変換例を図5に示す。図5では、「XML文書A」から「XML文書B」へデータ構造が変換されている。例えば、変換パターンNo.1の「要素」→「要素」に着目すると、変換前の「要素」<AAA>から「要素」<BBB>に変換される。このとき、「要素」<AAA>の持つ値αと「要素」<BBB>の持つ値αとが同一であることが分かる。   Among the above conversion patterns, conversion pattern No. 1 to No. FIG. 5 shows an XML document conversion example up to 3. In FIG. 5, the data structure is converted from “XML document A” to “XML document B”. For example, conversion pattern No. Focusing on “element” → “element” of 1, “element” <AAA> before conversion is converted to “element” <BBB>. At this time, it can be seen that the value α of the “element” <AAA> and the value α of the “element” <BBB> are the same.

さらに、オントロジーファイル107には、例えば{項目IAの値と項目IBの値を加算した値と項目ICの値が同値}や{項目IAの値の文字列と項目IBの値の文字列をつなげた文字列と項目ICの値の文字列が同値}という関係を記述してもよい。その他、{「要素A」が存在した場合、「要素B」を「要素C」に変換する}という変換パターン、{「複数の要素」→「要素」}という変換パターン、{「複数の要素」→「複数の要素」}という変換パターンなどの種種の変換パターンが挙げられる。さらに、「要素」や「属性」など変換対象の項目の種類に基づいた変換パターンに限られず、項目の個数や内容などによる変換パターンであっても良い。例えば、変換パターンとして、{XML文書Aに含まれる「要素A」の個数を、XML文書Bの「要素B」の値に入力する}という変換パターンなどが挙げられる。   Further, the ontology file 107 connects, for example, {a value obtained by adding the value of the item IA and the value of the item IB and the value of the item IC} or {a character string of the value of the item IA and a character string of the value of the item IB The relationship that the character string and the character string of the value of the item IC are the same value} may be described. In addition, {if "element A" is present, "element B" is converted to "element C"} conversion pattern, {"plural elements" → "element"} conversion pattern, {"plural elements" → Various conversion patterns such as a conversion pattern “multiple elements”}. Furthermore, the conversion pattern is not limited to the conversion pattern based on the type of item to be converted such as “element” or “attribute”, but may be a conversion pattern based on the number of items, contents, or the like. For example, as the conversion pattern, a conversion pattern of {input the number of “element A” included in the XML document A as the value of “element B” in the XML document B}, or the like is cited.

(2−1−3)オントロジー記述の例
前述の図4に示す変換パターンを元に、それらの項目の対応関係をオントロジーで記述した例を図6に示す。図6には、図4に示す「No」欄及び「変換パターン」欄に対応するオントロジー記述の例を「OWL記述」欄に示す。「OWL記述」欄と「変換パターン」欄とにおける「A」「B」「C」「D」「E」等の文字は対応している。この図6のOWL記述に基づいて、XML文書間の項目の対応関係を記述したオントロジーファイルが作成される。オントロジーファイル107の一例を図7に示す。図7のオントロジーファイル107には、図6のOWL記述に従って、XML文書A及びXML文書B間における「要素」、「属性」、「要素値」、「属性値」の項目の対応関係が記述されている。
(2-1-3) Example of ontology description FIG. 6 shows an example in which the correspondence between these items is described by ontology based on the conversion pattern shown in FIG. FIG. 6 shows an example of ontology description corresponding to the “No” column and the “conversion pattern” column shown in FIG. 4 in the “OWL description” column. Characters such as “A”, “B”, “C”, “D”, and “E” in the “OWL description” column and the “conversion pattern” column correspond to each other. Based on the OWL description in FIG. 6, an ontology file describing the correspondence between items between XML documents is created. An example of the ontology file 107 is shown in FIG. The ontology file 107 in FIG. 7 describes the correspondence between the items of “element”, “attribute”, “element value”, and “attribute value” between the XML document A and the XML document B in accordance with the OWL description in FIG. ing.

(2−1−4)変換対象項目の抽出及び対応関係の解析
次に、オントロジー解析手段201は、XML文書AからXML文書Bへの変換の際に変換対象となる項目を、読み込んだオントロジーファイル107の記述から抽出する。つまり、XML文書間においてどの項目とどの項目の間で変換が行われるかを抽出する。抽出は、例えばオントロジーファイル107中で宣言されているクラスやプロパティを読み取り、どの項目が変換の対象となるのかに基づいて行う。具体的には、例えば、OWL記述の<owl:Class rdf:ID=”….”>で宣言されている項目、rdf:resource=”…”で呼び出されている項目及びXMLスキーマファイルのNameSpace(名前空間)から呼び出されている項目等の抽出をおこなうことで、変換対象となる項目を抽出する。さらに、オントロジー解析手段201は、抽出した項目の対応関係を解析する。
(2-1-4) Extraction of Conversion Target Item and Analysis of Correspondence Next, ontology analysis unit 201 reads an ontology file that has read an item to be converted at the time of conversion from XML document A to XML document B. Extract from 107 description. That is, it is extracted which item and which item are converted between XML documents. The extraction is performed, for example, by reading a class or property declared in the ontology file 107 and based on which item is a conversion target. Specifically, for example, an item declared with <ow: Class rdf: ID = “...>” In the OWL description, an item called with rdf: resource = “...”, And a NameSpace ( The items to be converted are extracted by extracting the items called from the namespace. Furthermore, the ontology analysis unit 201 analyzes the correspondence between the extracted items.

前述のオントロジーファイル107を例に挙げ、オントロジー解析手段201による変換対象となる項目の抽出及び解析を説明する。まず、図7のL200では、呼び出されるスキーマファイル等が宣言されている。aaa:は、XML文書AのXMLスキーマファイルSAを示し、bbb:はXML文書BのXMLスキーマファイルSBを示している。L201からL202では、「TypeContent」と「aaa:AnalogIC」が等しいことが記述されている。また、L203からL204では、「bbb:Type」は、「TypeContent」を値として保持していることが記述されている。よって、オントロジー解析手段201は、L201からL204の記述により、XML文書Aの項目「AnalogIC」及びXML文書Bの項目「Type」が所持している値が同値であるという対応関係を解析する。ここで、「AnalogIC」→「TypeContent」の変換を変換対応1と称する。同様に、L205からL206では、XML文書Aの項目「PartsName」及びXML文書Bの項目「Name」が同値であるという対応関係を解析する。「PartsName」→「Name」の変換を変換対応2と称する。また、L207からL208にて、XML文書Aの項目「InputOffsetVoltage」とXML文書Bの項目「unit」が「V」を取るという状況と、XML文書Bの項目「V_IO」の値が同値であるという対応関係を解析する。この「InputOffsetVoltage」+「unit」+「V」→「V_IO」の変換を変換対応3と称する。そして、オントロジー解析手段201は、これらの抽出した変換対象である項目及び項目の対応関係をスキーマファイル解析手段202に出力する。   Taking the ontology file 107 as an example, the extraction and analysis of items to be converted by the ontology analysis means 201 will be described. First, in L200 of FIG. 7, a schema file to be called is declared. aaa: indicates the XML schema file SA of the XML document A, and bbb: indicates the XML schema file SB of the XML document B. L201 to L202 describe that “TypeContent” and “aaa: AnalogIC” are equal. Further, in L203 to L204, it is described that “bbb: Type” holds “TypeContent” as a value. Therefore, the ontology analyzing unit 201 analyzes the correspondence relationship that the values possessed by the item “AnalogIC” of the XML document A and the item “Type” of the XML document B are the same value by the description of L201 to L204. Here, the conversion of “Analog IC” → “Type Content” is referred to as “conversion correspondence 1”. Similarly, in L205 to L206, the correspondence relationship that the item “PartsName” of the XML document A and the item “Name” of the XML document B are the same value is analyzed. The conversion “PartsName” → “Name” is referred to as “conversion correspondence 2”. Further, in L207 to L208, the item “InputOffsetVoltage” of the XML document A and the item “unit” of the XML document B take “V”, and the value of the item “V_IO” of the XML document B is the same value. Analyze the correspondence. This conversion of “InputOffsetVoltage” + “unit” + “V” → “V_IO” is referred to as conversion correspondence 3. Then, the ontology analysis unit 201 outputs the extracted items to be converted and the correspondence between the items to the schema file analysis unit 202.

(2−2)XMLスキーマファイルの解析
スキーマファイル解析手段202は、変換対象であるXMLスキーマファイルSA及びXMLスキーマファイルSBを読み込み、オントロジーファイル107の解析で抽出された、変換対象である項目の階層構造や項目の種類等の項目の情報を解析する。ここでは、階層構造としてXpathを解析するものとする。なお、Xpathに限定されず、Xpointerなど他の位置指定方法を解析しても良い。
(2-2) Analysis of XML Schema File Schema file analysis means 202 reads the XML schema file SA and XML schema file SB that are conversion targets, and the hierarchy of items to be converted extracted by the analysis of ontology file 107 Analyze item information such as structure and item type. Here, it is assumed that Xpath is analyzed as a hierarchical structure. Note that the present invention is not limited to Xpath, and other position designation methods such as Xpointer may be analyzed.

スキーマファイル解析手段202は、変換対象の各項目について「要素」、「属性」、「要素値」、「属性値」のいずれの種類であるかを解析する。例えば、XMLスキーマファイルに、Elementと指定されている項目は「要素」であると判定し、「Attribute」と指定されている項目は「属性」であると判定する。ここで、項目の種類が「要素値」及び「属性値」などである場合は、XMLスキーマファイルからだけでは項目の種類を特定できない。そこで、スキーマファイル解析手段202は、オントロジーファイル107の記述から項目の種類を特定する。例えば、オントロジーファイル107において「hasValue」が指定されている項目の種類が「要素値」及び「属性値」であるとして項目の種類を特定する。スキーマファイル解析手段202は、この解析結果を変換パターン決定手段203に出力する。   The schema file analysis unit 202 analyzes the type of “element”, “attribute”, “element value”, or “attribute value” for each item to be converted. For example, it is determined that an item designated as Element in the XML schema file is “element”, and an item designated as “Attribute” is determined as “attribute”. Here, when the item type is “element value”, “attribute value”, or the like, the item type cannot be specified only from the XML schema file. Therefore, the schema file analysis unit 202 identifies the type of item from the description of the ontology file 107. For example, the type of the item is specified assuming that the type of the item for which “hasValue” is specified in the ontology file 107 is “element value” and “attribute value”. The schema file analysis unit 202 outputs the analysis result to the conversion pattern determination unit 203.

(2−2−1)XMLスキーマファイルの解析の一例
上述のスキーマファイル解析手段202による解析を、XMLスキーマ言語で記述したスキーマファイルを用いてさらに詳細に説明する。図8及び図9は、それぞれXMLスキーマファイルSA及びXMLスキーマファイルSBの一例である。
(2-2-1) Example of Analysis of XML Schema File The analysis by the above-described schema file analysis unit 202 will be described in more detail using a schema file described in the XML schema language. 8 and 9 are examples of the XML schema file SA and the XML schema file SB, respectively.

まず、図8のXMLスキーマファイルSAの解析について説明する。スキーマファイル解析手段202は、図5のオントロジーファイル107の解析で抽出した変換対象の項目をXMLスキーマファイルSAから読み取る。ここでは、XMLスキーマファイルSAの変換対象の項目として、「AnalogIC」、「PartsName」、「InputOffsetVoltage」及び「unit」が抽出されている。よって、これらの項目のXpath及び項目の種類をXMLスキーマファイルSAから読み取る。   First, analysis of the XML schema file SA in FIG. 8 will be described. The schema file analysis unit 202 reads the item to be converted extracted by the analysis of the ontology file 107 in FIG. 5 from the XML schema file SA. Here, “AnalogIC”, “PartsName”, “InputOffsetVoltage”, and “unit” are extracted as items to be converted in the XML schema file SA. Therefore, the Xpath of these items and the item type are read from the XML schema file SA.

スキーマファイル解析手段202は、図8のL101から、項目「AnalogIC」について、Xpathが「/AnalogIC」であり、項目の種類が「要素」であることを解析する。同様に、L102から、項目「PartsName」について、Xpathが「/AnalogIC/PartsName」であり、項目の種類が「要素」であることを解析する。また、L103から、項目「InputOffsetVoltage」について、Xpathが「/AnalogIC/InputOffsetVoltage」であり、項目の種類が「要素」であることを解析する。さらに、スキーマファイル解析手段202は、L104からL105の記述から、項目「unit」は、項目「InputOffsetVoltage」に含まれる「属性」であり、そのXpathが「/AnalogIC/InputOffsetVoltage/@unit」であると解析する。同様に、図9のXMLスキーマファイルSBについても変換対象である項目の解析を行う。   The schema file analysis unit 202 analyzes from L101 of FIG. 8 that the Xpath is “/ AnalogIC” and the item type is “element” for the item “AnalogIC”. Similarly, from L102, for the item “PartsName”, it is analyzed that Xpath is “/ AnalogIC / PartsName” and the item type is “element”. Further, from L103, for the item “InputOffsetVoltage”, it is analyzed that Xpath is “/ AnalogIC / InputOffsetVoltage” and the item type is “element”. Further, the schema file analysis unit 202 indicates that the item “unit” is an “attribute” included in the item “InputOffsetVoltage” and its Xpath is “/ AnalogIC / InputOffsetVoltage / @ unit” based on the descriptions of L104 to L105. To analyze. Similarly, for the XML schema file SB of FIG. 9, the items to be converted are analyzed.

以上のXMLスキーマファイルSA及びXMLスキーマファイルSBの解析結果を図10に示す。図10の「対応」欄にはオントロジー解析手段201で抽出した変換対応1〜3の分類を示し、変換対応毎に変換対象である項目、その項目が抽出されたXMLスキーマファイル名、項目の種類、Xpathを示す。この解析結果を変換パターン決定手段203に出力する。   The analysis results of the XML schema file SA and XML schema file SB are shown in FIG. The “correspondence” column in FIG. 10 shows the classifications of the conversion correspondences 1 to 3 extracted by the ontology analysis unit 201, the items to be converted for each conversion correspondence, the XML schema file name from which the items are extracted, and the type of the item , Xpath. The analysis result is output to the conversion pattern determination means 203.

(2−3)変換パターンの決定
変換パターン決定手段203は、オントロジーファイルの解析結果及びスキーマファイルの解析結果に基づいて、XML文書A及びXML文書B間の変換パターンを決定する。つまり、オントロジー解析手段201により抽出した変換対象の項目、スキーマファイル解析手段202より解析した各項目の種類やXpathに基づいて、どの種類の項目からどの種類の項目への変換であるかを示す変換パターンを決定する。
(2-3) Determination of Conversion Pattern The conversion pattern determination unit 203 determines a conversion pattern between the XML document A and the XML document B based on the analysis result of the ontology file and the analysis result of the schema file. That is, based on the item to be converted extracted by the ontology analyzing unit 201, the type of each item analyzed by the schema file analyzing unit 202, and the Xpath, the conversion indicating from which type of item to which type of item is converted. Determine the pattern.

変換パターン決定手段203による変換パターンの決定方法について、図10及び図11を用いて説明する。図10は、XMLスキーマファイルSA及びXMLスキーマファイルSBの解析結果である。図11は、図10の変換パターンの決定方法を示す説明図である。図10の変換対応1は、図7のオントロジーファイル107の解析結果より、{「AnalogIC」と、「Type」が所持している値とが同値である}を意味する。ここで、XMLスキーマファイルSA及びXMLスキーマファイルSBより、項目「AnalogIC」が「要素」、項目「Type」が「要素」、「TypeContent」が「要素値」であることが解析されている。よって、変換パターン決定手段203は、図11に示すように変換対応1が「要素」→「要素値」の変換パターンと決定する。   A conversion pattern determination method by the conversion pattern determination unit 203 will be described with reference to FIGS. FIG. 10 shows the analysis results of the XML schema file SA and the XML schema file SB. FIG. 11 is an explanatory diagram showing a method for determining the conversion pattern of FIG. The conversion correspondence 1 in FIG. 10 means {“AnalogIC” and the value possessed by “Type” are the same value} from the analysis result of the ontology file 107 in FIG. Here, it is analyzed from the XML schema file SA and the XML schema file SB that the item “AnalogIC” is “element”, the item “Type” is “element”, and the “TypeContent” is “element value”. Therefore, the conversion pattern determination unit 203 determines that the conversion correspondence 1 is a conversion pattern of “element” → “element value” as shown in FIG.

同様に、図10の変換対応2は、{「PartsName」と「Name」が同値である}を意味する。ここで、項目「PartsName」が「要素」であり、項目「Name」が「要素」である。よって、変換パターン決定手段203は、変換対応2が「要素」→「要素」の変換パターンと決定する。   Similarly, conversion correspondence 2 in FIG. 10 means {“PartsName” and “Name” have the same value}. Here, the item “PartsName” is “element”, and the item “Name” is “element”. Therefore, the conversion pattern determination unit 203 determines that the conversion correspondence 2 is a conversion pattern of “element” → “element”.

また、変換対応3は、{「InputOffsetVoltage」かつ「unit」が「V」を取るという状況と、「V_IO」は同値である}ことを意味する。ここで、項目「InputOffsetVoltage」が「要素」、項目「unit」が「属性」、「V」が項目「unit」の「属性値」、項目「V_IO」が「要素」である。よって、変換パターン決定手段203は、変換対応3が「要素」+「属性」+「属性値」→「要素」の変換パターンと決定する。変換パターン決定手段203は、決定した変換パターンをテンプレート記述手段204に出力する。   Also, the conversion correspondence 3 means {“InputOffsetVoltage” and “unit” takes “V” and “V_IO” has the same value}. Here, the item “InputOffsetVoltage” is “element”, the item “unit” is “attribute”, the “V” is “attribute value” of the item “unit”, and the item “V_IO” is “element”. Therefore, the conversion pattern determining means 203 determines that the conversion correspondence 3 is a conversion pattern of “element” + “attribute” + “attribute value” → “element”. The conversion pattern determination unit 203 outputs the determined conversion pattern to the template description unit 204.

(2−4)XSLTファイルの出力
テンプレート記述手段204は、変換パターン決定手段203が決定した変換パターンに基づいてテンプレートDB205を検索し、テンプレート記述手段204は、検索されたテンプレートに基づいてXSLTファイル108を追記し、出力する。
(2-4) Output of XSLT file The template description means 204 searches the template DB 205 based on the conversion pattern determined by the conversion pattern determination means 203, and the template description means 204 searches the XSLT file 108 based on the searched template. Is added and output.

(2−4−1)テンプレートDB
テンプレートDB205は、XML文書間の変換パターンを所定のスタイルシート言語で定義するテンプレートを、変換パターン毎に記憶している。ここでは、スタイルシート言語としてXSLTを用いている。図12に、テンプレートDB205に記憶されているテンプレートの一例を示す。図12は、図6に示したオントロジーファイルにおける変換パターン毎のテンプレートの一覧表を示す。図12の「No」欄、「変換パターン」欄は、図6の変換パターンに対応している。また、「テンプレート」欄に対応するテンプレートの記述例をXSLTにより示している。なお、「テンプレート」欄及び「変換パターン」欄の「A」「B」「C」「D」「E」などの文字は対応している。また、No1の<xsl:template match=“/Xpath/A“>の「/Xpath/A」には、AのXpathの値が代入されることを示している。
(2-4-1) Template DB
The template DB 205 stores, for each conversion pattern, a template that defines a conversion pattern between XML documents in a predetermined style sheet language. Here, XSLT is used as the style sheet language. FIG. 12 shows an example of a template stored in the template DB 205. FIG. 12 shows a list of templates for each conversion pattern in the ontology file shown in FIG. The “No” column and the “conversion pattern” column in FIG. 12 correspond to the conversion patterns in FIG. Also, a description example of the template corresponding to the “template” column is shown by XSLT. Note that characters such as “A”, “B”, “C”, “D”, and “E” in the “template” column and “conversion pattern” column correspond to each other. In addition, the value of Xpath of A is substituted for “/ Xpath / A” of <xsl: template match = “/ Xpath / A“> of No1.

(2−4−2)項目の値のデータ形式が異なる場合のテンプレート
テンプレートとしては、さらに次のようなテンプレートが挙げられる。XML書間の変換パターンが例えば「要素A」→「要素B」への変換パターンの場合、「要素A」の値及び「要素B」の値が同一である場合あっても取りうる値のデータ形式が異なる場合がある。そこで、テンプレートDB205に値のデータ形式を変換するためのテンプレートを蓄積しておく。
(2-4-2) Template when data format of item value is different Examples of templates include the following templates. When the conversion pattern between XML documents is, for example, a conversion pattern from “element A” to “element B”, data of possible values even when the value of “element A” and the value of “element B” are the same The format may be different. Therefore, a template for converting the data format of values is stored in the template DB 205.

具体的に、例えば、XML文書Aの項目「Day」が、XML文書Bの項目「Date」に対応している場合を例に挙げ説明を行う。ここで、「Day」及び「Date」は、「要素」である。XML文書AからXML文書Bへの変換の際、要素「Day」の値のは、年月日が、YYYYMMDDというデータ形式を有する。一方、要素「Date」の値は、YYMMDDというデータ形式を有する。同じ日付をあらわす項目であっても、その日付の値のデータ形式が異なる。そのため、要素「Day」→要素「Date」の変換の際に、その値のデータ形式を変更する必要がある。値のデータ形式を変換するためのテンプレートの一例を図13に示す。図13では、「XML文書A」欄にXML文書Aの値のデータ形式を示し、「XML文書B」欄にXML文書Bの値のデータ形式を示す。ここで、オントロジーファイル107には、予め、{YYYYMMDDというデータ形式をとる要素「Day」とYYMMDDというデータ形式をとる要素「Date」が同値}という記述が行われているものとする。まず、テンプレート記述手段204は、「要素Day」→「要素Date」の変換パターンを受け取ると、その変換パターンに応じてテンプレートを選択する。さらに、「要素Day」及び「要素Date」の値のデータ形式を変換するためにテンプレートを選択する。ここで、テンプレート記述手段204は、値のデータ形式を変換するテンプレートとして、図21に示す「先頭の2文字を削除」を選択する。そして、テンプレート記述手段204は、選択した「要素A」→「要素B」のテンプレート及び「先頭の2文字を削除」のテンプレートに基づいてXSLTファイルの記述を行う。   Specifically, for example, the case where the item “Day” of the XML document A corresponds to the item “Date” of the XML document B will be described as an example. Here, “Day” and “Date” are “elements”. At the time of conversion from the XML document A to the XML document B, the value of the element “Day” has a data format in which the date is YYYYMMDD. On the other hand, the value of the element “Date” has a data format of YYMMDD. Even if the items represent the same date, the data format of the date value is different. Therefore, it is necessary to change the data format of the value when converting the element “Day” → the element “Date”. An example of a template for converting the data format of values is shown in FIG. In FIG. 13, the data format of the value of the XML document A is shown in the “XML document A” column, and the data format of the value of the XML document B is shown in the “XML document B” column. Here, it is assumed that the ontology file 107 is described in advance as “element“ Day ”having a data format of YYYYMMDD and element“ Date ”having a data format of YYMMDD are equivalent”. First, upon receiving a conversion pattern “element day” → “element date”, the template description unit 204 selects a template according to the conversion pattern. Further, a template is selected to convert the data format of the values of “element day” and “element date”. Here, the template description means 204 selects “Delete the first two characters” shown in FIG. 21 as a template for converting the data format of the value. Then, the template description unit 204 describes the XSLT file based on the selected “element A” → “element B” template and “delete the first two characters” template.

(2−4−3)優先順位の情報を有するテンプレート
さらに、テンプレートDB205に、変換の優先順位の情報を設定したテンプレートを蓄積しておき、テンプレート記述手段204が優先順位に基づいてテンプレートの選択を行ったり、XSLTファイルの記述を行っても良い。
(2-4-3) Template having priority information Further, a template in which conversion priority information is set is stored in the template DB 205, and the template description unit 204 selects a template based on the priority. Or an XSLT file may be described.

(2−4−4)XSLTファイルの作成
テンプレート記述手段204は、変換パターン決定手段203から変換パターンを受け付け、XSLTファイル108の作成を開始する。ここでは、XML文書AからXML文書Bへの変換を行うXSLTファイル108、及びXML文書BからXML文書Aへの変換を行うXSLTファイル108の作成を開始する。まず、テンプレート記述手段204は、変換パターンを受け付けると、XML文書AからXML文書Bへの変換方向であるか、あるいはXML文書BからXML文書Aへの変換方向であるかに応じて、テンプレートDB205内のテンプレートを検索する。テンプレート記述手段204は、変換パターンをキーにして検索されたテンプレートを、XSLTファイル108に記述する。テンプレート記述手段204は、全ての変換対象の項目について、XSLTファイル108への記述が終了すると、作成したXSLTファイル108を出力する。
(2-4-4) Creation of XSLT File The template description unit 204 receives the conversion pattern from the conversion pattern determination unit 203 and starts creating the XSLT file 108. Here, creation of the XSLT file 108 for converting the XML document A to the XML document B and the XSLT file 108 for converting the XML document B to the XML document A are started. First, when the template description unit 204 receives the conversion pattern, the template DB 205 determines whether the conversion direction is from the XML document A to the XML document B or the conversion direction from the XML document B to the XML document A. Search for templates in The template description unit 204 describes a template searched using the conversion pattern as a key in the XSLT file 108. The template description unit 204 outputs the created XSLT file 108 when the description in the XSLT file 108 is completed for all items to be converted.

前記の処理により、XML文書AからXML文書Bへの変換を行うXSLTファイル108、及びXML文書BからXML文書Aへの変換を行うXSLTファイル108が出力される。   As a result of the above processing, an XSLT file 108 that converts XML document A to XML document B and an XSLT file 108 that converts XML document B to XML document A are output.

(2−4−5)XML文書AからXML文書Bへの変換のためのXSLTファイルの作成
次に、XML文書AからXML文書Bへの変換を行うXSLTファイル108の作成方法について、図10及び図11の変換パターンを例にとり、より具体的に説明する。図14は、作成されるXSLTファイルの一例である。テンプレート記述手段204は、図14に示すXSLTのヘッダ情報(L501からL502)を含むXSLTファイル108の作成を開始する。なお、図14のXSLTファイル108は、XML文書AからXML文書Bへの変換の際のXSLTファイル108である。テンプレート記述手段204は、受け付けた変換パターンに対応するテンプレートの検索を行うために、XSLT記述(L503からL504の部分)をXSLTファイルに記述する。
(2-4-5) Creation of XSLT File for Conversion from XML Document A to XML Document B Next, a method for creating the XSLT file 108 for converting XML document A to XML document B will be described with reference to FIG. A more specific description will be given by taking the conversion pattern of FIG. 11 as an example. FIG. 14 is an example of the XSLT file to be created. The template description unit 204 starts creating the XSLT file 108 including the XSLT header information (L501 to L502) shown in FIG. Note that the XSLT file 108 in FIG. 14 is the XSLT file 108 at the time of conversion from the XML document A to the XML document B. The template description unit 204 describes the XSLT description (parts L503 to L504) in the XSLT file in order to search for a template corresponding to the accepted conversion pattern.

さらに、テンプレート記述手段204は、変換対応1の場合は、「要素」→「要素値」の変換パターンに対応するテンプレートをテンプレートDB205から検索する。ここでは、図12から「要素」→「要素値」の変換パターンとしてNo.7のテンプレートが検索される。そして、テンプレート記述手段204は、No.7のテンプレートをXSLTファイルに追記(L505からL506)する。同様に、変換対応2の「要素」→「要素」の変換パターンのテンプレートとして、図12のNo.1のテンプレートを検索する。そして、図13のXSLTファイルに追記(L507からL508)する。また、変換対応3に関しては、「要素」+「属性」+「属性値」→「要素」の変換パターンであるため、図12のNo.9のテンプレートを検索し、XSLTファイルに追記(L509からL510)する。オントロジー解析手段201が抽出した全ての変換対応に関してテンプレートの記述が終了すると、テンプレート記述手段204は、XSLTファイル108を出力する。   Further, in the case of conversion correspondence 1, the template description unit 204 searches the template DB 205 for a template corresponding to the conversion pattern “element” → “element value”. Here, as a conversion pattern “element” → “element value” from FIG. 7 templates are searched. And the template description means 204 is No. 7 template is added to the XSLT file (L505 to L506). Similarly, as a template for a conversion pattern of “element” → “element” corresponding to conversion 2, No. 1 in FIG. Search for one template. Then, it is added to the XSLT file of FIG. 13 (L507 to L508). For conversion correspondence 3, since the conversion pattern is “element” + “attribute” + “attribute value” → “element”, No. 9 templates are searched and added to the XSLT file (L509 to L510). When the description of the template is completed for all the conversion correspondences extracted by the ontology analysis means 201, the template description means 204 outputs the XSLT file 108.

(2−4−6)XML文書BからXML文書Aへの変換のためのXSLTファイルの作成
次に、XML文書BからXML文書Aへの変換におけるXSLTファイル108も同様に作成を行う。変換パターン決定手段203は、図11の変換対象の項目、項目の種類、各項目のXpathのデータを用いて、変換パターンを決定している。ここで、変換対応1の変換は「要素値」→「要素」の変換パターン、変換対応2の変換は「要素」→「要素」の変換パターン、変換対応3の変換は「要素」→「要素」+「属性」+「属性値」の変換パターンである。変換パターン決定手段203は、テンプレート記述手段204に対してXSLTファイル作成の指示を出す。テンプレート記述手段204は、テンプレートDB205より、該当する変換パターンのテンプレートを検索する。「要素値」→「要素」の変換パターンは図12のNo.3のテンプレートが、「要素」→「要素」への変換パターンはNo.1のテンプレートが、「要素」→「要素」+「属性」+「属性値」への変換パターンはNo.10のテンプレートが検索される。そして、これらのテンプレートがXSLTファイルに記述される。記述後のXSLTファイルを図15に示す。図15には、まずXSLTの宣言部分(L801からL802)と、テンプレートを呼び出すための記述(L803からL804)が行われている。そして、図15のL803からL806にNo.3に対応するテンプレートが、L808からL809にNo.1に対応するテンプレートが、L810からL811にNo.10に対応するXSLTテンプレートが記述されている。
(2-4-6) Creation of XSLT File for Conversion from XML Document B to XML Document A Next, the XSLT file 108 in the conversion from the XML document B to the XML document A is created in the same manner. The conversion pattern determination unit 203 determines a conversion pattern using the items to be converted, the item types, and the Xpath data of each item in FIG. Here, conversion of conversion correspondence 1 is “element value” → “element” conversion pattern, conversion of conversion correspondence 2 is “element” → “element” conversion pattern, and conversion of conversion correspondence 3 is “element” → “element” "+" Attribute "+" attribute value "conversion pattern. The conversion pattern determination unit 203 instructs the template description unit 204 to create an XSLT file. The template description unit 204 searches the template DB 205 for a template of the corresponding conversion pattern. The conversion pattern of “element value” → “element” is No. in FIG. 3 template, the conversion pattern from “element” to “element” is No. No. 1 has a conversion pattern “No.” → “Element” + “Attribute” + “Attribute Value”. Ten templates are searched. These templates are described in the XSLT file. FIG. 15 shows the XSLT file after the description. In FIG. 15, first, a declaration part (L801 to L802) of XSLT and a description (L803 to L804) for calling a template are performed. Then, from No. L803 to L806 in FIG. 3 corresponding to the template No. 3 from L808 to L809. 1 corresponds to No. 1 from L810 to L811. An XSLT template corresponding to 10 is described.

なお、変換パターン決定手段203は、XML文書AからXML文書Bへの変換、あるいはXML文書BからXML文書Aへの変換におけるXSLTファイル108のどちらを作成するのかを指示しても良い。また、両方のXSLTファイル108に交代で記述を行い、同時にXSLTファイル108作成しても良い。   Note that the conversion pattern determination unit 203 may instruct which of the XSLT files 108 to create in the conversion from the XML document A to the XML document B or the conversion from the XML document B to the XML document A. Alternatively, both XSLT files 108 may be described alternately and the XSLT file 108 may be created at the same time.

(2−4−7)XSLTファイルの記述方法
ここで、テンプレート記述手段204は、項目の階層構造を整理して複数のXSLTテンプレートを1つにまとめた形に修正したテンプレートをXSLTファイル108に記述すると好ましい。例えば、テンプレート記述手段204は、次のように修正したテンプレートをXSLTファイル108に記述する。図16はテンプレートを修正せずに作成したXSLTファイルの一例であり、図17は修正したテンプレートにより作成したXSLTファイルの一例である。図16のXSLTファイル108には、変換対象の項目毎にXpathがAAA/BBB、CCC、AAA/DDDである変換パターンのテンプレートが記述されている。この場合、L301とL302の部分で、<AAA>の項目が2回出力され、XSLTファイルへの記述が多くなる。そこで、上位の項目で下位の複数の項目を入れ子、つまり階層化する。例えば、出力される項目の順に、AAA/BBB、AAA/DDD、CCCのようにテンプレートのソートを行う。そして、図17に示すように同一の項目以下に含まれる項目は、1つの上位の項目にまとめてXSLTファイル(102)に記載する。これにより、<AAA>の項目は、L401部分に1回出力されるだけで、2回出力される現象を回避することができる。
(2-4-7) XSLT file description method Here, the template description means 204 describes a template in the XSLT file 108, which is obtained by organizing the hierarchical structure of items and correcting a plurality of XSLT templates into one. It is preferable. For example, the template description unit 204 describes the template corrected as follows in the XSLT file 108. FIG. 16 is an example of an XSLT file created without modifying a template, and FIG. 17 is an example of an XSLT file created using a modified template. The XSLT file 108 in FIG. 16 describes a template of a conversion pattern in which the Xpath is AAA / BBB, CCC, AAA / DDD for each item to be converted. In this case, the item <AAA> is output twice in the portions of L301 and L302, and the description in the XSLT file increases. Therefore, a plurality of lower items are nested in the upper items, that is, hierarchized. For example, the templates are sorted in the order of the output items, such as AAA / BBB, AAA / DDD, and CCC. Then, as shown in FIG. 17, items included under the same item are grouped into one upper item and described in the XSLT file (102). As a result, the item <AAA> is output only once in the L401 portion, and the phenomenon of being output twice can be avoided.

より具体的に、図18及び図19を用いて説明する。図18には、XML文書AからXML文書Bにデータ構造を変換する場合において、変換対象の項目毎のXpathを記載している。左欄にはXML文書AのXpathを、右欄にはXSLTファイルのXpathを示す。図19は、作成されるXSLTファイルを示す。   This will be described more specifically with reference to FIGS. FIG. 18 shows the Xpath for each item to be converted when the data structure is converted from the XML document A to the XML document B. The left column shows the Xpath of the XML document A, and the right column shows the Xpath of the XSLT file. FIG. 19 shows the XSLT file that is created.

ここで、図18に示すように、XML文書Aの全ての変換対象である項目が、XML文書Bの「Semiconductor」以下の項目に変換される。よって、まず、XML文書Aの項目を項目「Semiconductor」に変換するテンプレートを、XSLTファイルに記述する(L601からL602)。すなわち、図19に示すように、項目「AnalogIC」は、項目「Semiconductor」を省略してXSLTファイル108に記述される(L603からL604)。同様に、項目「PartsName」及び「InputOffsetVoltage」についても、それぞれ、L605からL606及びL607からL608に示すように項目「Semiconductor」を省略してXSLTファイル108に記述される。   Here, as shown in FIG. 18, all items to be converted in the XML document A are converted to items below “Semiconductor” in the XML document B. Therefore, first, a template for converting the item of the XML document A into the item “Semiconductor” is described in the XSLT file (L601 to L602). That is, as shown in FIG. 19, the item “AnalogIC” is described in the XSLT file 108 by omitting the item “Semiconductor” (L603 to L604). Similarly, the items “PartsName” and “InputOffsetVoltage” are also described in the XSLT file 108 by omitting the item “Semiconductor” as indicated by L605 to L606 and L607 to L608, respectively.

前記では、XSLTファイルの変換対象の項目毎のXpathに基づいて階層化しているが、XML文書AのXpathに基づいて階層化を行っても良い。より具体的に、図18及び図20を用いて説明する。図20は、作成されるXSLTファイルを示す。   In the above description, hierarchization is performed based on the Xpath for each item to be converted in the XSLT file. However, hierarchization may be performed based on the Xpath of the XML document A. This will be described more specifically with reference to FIGS. FIG. 20 shows the XSLT file to be created.

図18に示すように、XML文書Aの変換対象の項目は、すべて項目「AnalogIC」以下の項目となっている。そこで、項目「AnalogIC」のテンプレート中に、項目「AnalogIC」以下の項目を呼び出すための記述を行う。すなわち、図20に示すように、項目「AnalogIC」のテンプレート(L701からL702)をXSLTファイルに記述する際に次の記述を行う。項目「AnalogIC」のテンプレートが終了する</xsl:template>(L702)の直前に、他のテンプレートを呼びだすための記述(L703)を行う。
[処理]
図21は、XML文書変換装置100が行う処理の流れを示すフローチャートである。
As shown in FIG. 18, the items to be converted in the XML document A are all items below the item “Analog IC”. Therefore, a description for calling an item below the item “AnalogIC” is made in the template of the item “AnalogIC”. That is, as shown in FIG. 20, the following description is made when the template (L701 to L702) of the item “AnalogIC” is described in the XSLT file. A description (L703) for calling another template is made immediately before </ xsl: template> (L702) when the template of the item “AnalogIC” ends.
[processing]
FIG. 21 is a flowchart showing the flow of processing performed by the XML document conversion apparatus 100.

ステップS11:オントロジー解析手段201は、オントロジーファイル107を読み込む。   Step S11: The ontology analysis means 201 reads the ontology file 107.

ステップS12:オントロジー解析手段201は、オントロジーファイル107から変換対象となる項目を抽出する。   Step S12: The ontology analysis means 201 extracts items to be converted from the ontology file 107.

ステップS13:オントロジー解析手段201は、抽出した変換対象となる項目の対応関係を解析する。   Step S13: The ontology analysis means 201 analyzes the correspondence between the extracted items to be converted.

ステップS14:スキーマファイル解析手段202は、XML文書のスキーマファイルを読み込む。   Step S14: The schema file analysis unit 202 reads the schema file of the XML document.

ステップS15、S16:スキーマファイル解析手段202は、読み込んだスキーマファイルから変換対象である項目のXpathや項目の種類等の項目の情報を解析する。   Steps S15 and S16: The schema file analysis unit 202 analyzes item information such as the Xpath of the item to be converted and the item type from the read schema file.

ステップS17:変換パターン決定手段203は、オントロジーファイルの解析結果及びスキーマファイルの解析結果に基づいて、XML文書A及びXML文書B間の変換パターンを決定する。   Step S17: The conversion pattern determination unit 203 determines a conversion pattern between the XML document A and the XML document B based on the analysis result of the ontology file and the analysis result of the schema file.

ステップS18:テンプレート記述手段204は、変換パターン決定手段203が決定した変換パターンに基づいて、XSLTファイル108に追記するテンプレートDB205を検索する。   Step S18: The template description unit 204 searches the template DB 205 to be added to the XSLT file 108 based on the conversion pattern determined by the conversion pattern determination unit 203.

ステップS19、S20:テンプレート記述手段204は、検索されたテンプレートに基づいてXSLTファイル108を追記し、出力する。   Steps S19 and S20: The template description unit 204 adds and outputs the XSLT file 108 based on the searched template.

以上の処理により、XML文書AからXML文書Bへの変換に用いられるXSLTファイル108及びXML文書BからXML文書Aへの変換に用いられるXSLTファイル108がXSLTファイル作成装置101から出力される。   With the above processing, the XSLT file 108 used for conversion from the XML document A to the XML document B and the XSLT file 108 used for conversion from the XML document B to the XML document A are output from the XSLT file creation apparatus 101.

なお、オントロジー解析手段201によるステップS1からステップS3のオントロジーファイル107の解析処理の前に、スキーマファイル解析手段202によるステップS4からステップS6のスキーマファイルの解析処理を行っても良い。この場合、まず、スキーマファイル解析手段202は、スキーマファイル中の全ての項目を抽出し、解析する。次に、オントロジー解析手段201が変換対象となる項目を抽出する。そして、スキーマファイルから抽出された全ての項目の中から変換対象となる項目を抽出し、その変換パターンを決定する。変換パターンからXSLTファイル108の出力については、上記と同様の処理が行われる。
[効果]
構造化文書間の項目の対応関係を記述した対応関係ファイルを利用することにより、スキーマファイルから自動的かつ効率的に項目を抽出することができる。また、対応関係ファイル解析手段により項目間の対応関係を解析し、スキーマファイル解析手段により項目間の階層構造及び種類を解析することで、XML文書間の変換パターンを項目ごとに決定することができる。よって、決定された変換パターンに基づいてスタイルシートを自動的、効率的かつ容易に作成することができる。
Note that the schema file analysis unit 202 may perform the schema file analysis process from step S4 to step S6 before the ontology analysis unit 201 performs the analysis process of the ontology file 107 from step S1 to step S3. In this case, first, the schema file analysis unit 202 extracts and analyzes all items in the schema file. Next, the ontology analysis unit 201 extracts items to be converted. Then, an item to be converted is extracted from all items extracted from the schema file, and its conversion pattern is determined. For the output of the XSLT file 108 from the conversion pattern, the same processing as described above is performed.
[effect]
By using a correspondence file that describes the correspondence between items between structured documents, items can be automatically and efficiently extracted from the schema file. Also, by analyzing the correspondence between items by the correspondence file analysis means and analyzing the hierarchical structure and type between items by the schema file analysis means, the conversion pattern between XML documents can be determined for each item. . Therefore, a style sheet can be created automatically, efficiently and easily based on the determined conversion pattern.

また、スタイルシートの作成は、スキーマファイルから対応関係ファイルのモデルへの変換を伴わずに、)対応関係ファイル及びスキーマファイルの解析結果に基づいて行われる。そのため、変換に伴う項目の情報の欠落や情報の意味の変更などを防止することができる。   The style sheet is created based on the analysis result of the correspondence file and the schema file without conversion from the schema file to the model of the correspondence file. Therefore, it is possible to prevent a lack of item information or a change in the meaning of information associated with the conversion.

<その他の実施形態例>
コンピュータに前述の処理を実行させるプログラム及びそのプログラムを記録したコンピュータ読み取り可能な記録媒体は、本発明に含まれる。ここで記録媒体としては、コンピュータが読み書き可能なフレキシブルディスク、ハードディスク、半導体メモリ、CD−ROM、DVD、光磁気ディスク(MO)、その他のものが挙げられる。
<Other embodiment examples>
A program that causes a computer to execute the above-described processing and a computer-readable recording medium that records the program are included in the present invention. Here, examples of the recording medium include a computer readable / writable flexible disk, hard disk, semiconductor memory, CD-ROM, DVD, magneto-optical disk (MO), and others.

メタデータのデータ構造が撮影、編集、放送などの段階によって変化するような、放送局のメタデータ制作システム等に利用可能であり、特に、そのシステム内のメタデータデータ構造の変換装置に好適である。   It can be used in a metadata production system of a broadcasting station where the metadata data structure changes depending on the stage of shooting, editing, broadcasting, etc., and particularly suitable for a metadata data structure conversion device in the system. is there.

第1実施形態例に係るXML文書間におけるデータ構造の変換を示す説明図。Explanatory drawing which shows conversion of the data structure between the XML documents which concern on the example of 1st Embodiment. XSLTファイル作成装置101の構成を示すブロック図。1 is a block diagram showing a configuration of an XSLT file creation apparatus 101. FIG. XSLTファイル作成装置101が実行する4つの機能。Four functions executed by the XSLT file creation apparatus 101. 変換パターンのバリエーションの一例。An example of conversion pattern variations. 変換パターンNo.1からNo.3のXML文書の変換例。Conversion pattern No. 1 to No. 3 shows an example of conversion of XML document 3. 図5の変換パターンを元に、それらの項目の対応関係をオントロジーで記述した一例。An example in which the correspondence of these items is described in an ontology based on the conversion pattern of FIG. オントロジーファイル107の一例。An example of ontology file 107. XMLスキーマファイルSAの一例。An example of an XML schema file SA. XMLスキーマファイルSBの一例。An example of an XML schema file SB. XMLスキーマファイルSA及びSBの解析結果の一例。An example of the analysis result of XML schema file SA and SB. 図10の変換パターンの決定方法を示す説明図。Explanatory drawing which shows the determination method of the conversion pattern of FIG. テンプレートDB205に記憶されているテンプレートの一例。An example of the template memorize | stored in template DB205. 値のデータ形式を変換するためのテンプレートの一例。An example of a template for converting the data format of a value. 作成されるXSLTファイルの一例。An example of the XSLT file created. 記述後のXSLTファイルの一例。An example of the XSLT file after description. テンプレートを修正せずに作成したXSLTファイルの一例。An example of an XSLT file created without modifying a template. 修正したテンプレートにより作成したXSLTファイルの一例An example of an XSLT file created with a modified template XML文書AからXML文書Bにデータ構造を変換する場合における、変換対象の項目毎のXpathの一例。An example of an Xpath for each item to be converted when the data structure is converted from the XML document A to the XML document B. 作成されるXSLTファイル。XSLT file to be created. 作成されるXSLTファイル。XSLT file to be created. XML文書変換装置100が行う処理の流れを示すフローチャート。6 is a flowchart showing a flow of processing performed by the XML document conversion apparatus 100.

符号の説明Explanation of symbols

100:XML文書変換装置
101:XSLTファイル作成装置
102:XSLTパーサ
107:オントロジーファイル
108:XSLTファイル
201:オントロジー解析手段
202:スキーマファイル解析手段
203:変換パターン決定手段
204:テンプレート記述手段
205:テンプレートDB
100: XML document conversion apparatus 101: XSLT file creation apparatus 102: XSLT parser 107: ontology file 108: XSLT file 201: ontology analysis means 202: schema file analysis means 203: conversion pattern determination means 204: template description means 205: template DB

Claims (11)

データ構造の異なる第1及び第2構造化文書間においてデータ構造の変換を行うためのスタイルシート作成装置であって、
前記第1及び第2構造化文書それぞれについてその構造を記述した第1及び第2スキーマファイルを解析するスキーマファイル解析手段と、
各構造化文書に含まれる情報単位である項目について、前記第1及び第2構造化文書間におけるその関連付けを記述した対応関係ファイルを読み込み、前記項目の対応関係を解析する対応関係ファイル解析手段と、
前記対応関係ファイルの解析結果及び前記スキーマファイルの解析結果に基づいて、前記第1構造化文書から前記第2構造化文書への変換パターンを決定する変換パターン決定手段と、
前記変換パターンに基づいて、前記第1及び第2構造化文書の異なる構造化文書間におけるデータ構造の変換を行うためのスタイルシートを出力するスタイルシート出力手段と、
を含むことを特徴とするスタイルシート作成装置。
A style sheet creation apparatus for converting a data structure between first and second structured documents having different data structures,
Schema file analyzing means for analyzing the first and second schema files describing the structures of the first and second structured documents,
Correspondence file analysis means for reading a correspondence file describing the association between the first and second structured documents for items which are information units included in each structured document, and analyzing the correspondence of the items; ,
Conversion pattern determining means for determining a conversion pattern from the first structured document to the second structured document based on the analysis result of the correspondence file and the analysis result of the schema file;
Style sheet output means for outputting a style sheet for converting a data structure between different structured documents of the first and second structured documents based on the conversion pattern;
A style sheet creating apparatus comprising:
前記スキーマファイル解析手段は、前記対応関係ファイル解析手段において前記第1及び第2構造化文書間の対応関係が解析された項目を、前記第1及び第2スキーマファイルから抽出し、抽出した項目の情報を解析することを特徴とする請求項1に記載のスタイルシート作成装置。   The schema file analysis unit extracts items whose correspondence relationship between the first and second structured documents is analyzed from the first and second schema files by the correspondence file analysis unit, and extracts the extracted items. The style sheet creating apparatus according to claim 1, wherein information is analyzed. 前記項目の情報とは、前記項目の種類及び/または項目の階層構造であることを特徴とする請求項2に記載のスタイルシート作成装置。   The style sheet creating apparatus according to claim 2, wherein the item information is a type of the item and / or a hierarchical structure of the item. 前記項目の種類は、要素、属性、要素値及び/または属性値が含まれることを特徴とする請求項3に記載のスタイルシート作成装置。   The style sheet creating apparatus according to claim 3, wherein the item type includes an element, an attribute, an element value, and / or an attribute value. 前記対応関係ファイルは、OWL(Web Ontology Language)により記述されたオントロジーファイルであることを特徴とする請求項1に記載のスタイルシート作成装置。   The style sheet creation apparatus according to claim 1, wherein the correspondence file is an ontology file described by OWL (Web Ontology Language). 前記スキーマファイル解析手段は、前記対応関係ファイル解析手段において前記第1及び第2構造化文書間の対応関係が解析された項目を、前記第1及び第2スキーマファイルから抽出し、その情報を解析し、
前記変換パターン決定手段は、抽出された項目の対応関係を項目の情報の対応関係に置換することにより変換パターンを項目毎に決定することを特徴とする請求項1に記載のスタイルシート作成装置。
The schema file analysis unit extracts items whose correspondence between the first and second structured documents is analyzed by the correspondence file analysis unit from the first and second schema files, and analyzes the information. And
The style sheet creation apparatus according to claim 1, wherein the conversion pattern determination unit determines a conversion pattern for each item by replacing a correspondence relationship of the extracted items with a correspondence relationship of item information.
前記変換パターン決定手段は、前記第2構造化文書から前記第1構造化文書への変換パターンをさらに決定することを特徴とする請求項1に記載のスタイルシート作成装置。   The style sheet creation apparatus according to claim 1, wherein the conversion pattern determination unit further determines a conversion pattern from the second structured document to the first structured document. 前記スタイルシート出力手段は、
前記第1構造化文書の項目から前記第2構造化文書の項目への変換パターンを所定のスタイルシート言語で定義するテンプレートを、変換パターン毎に記憶している変換パターン蓄積手段と、
前記変換パターン決定手段が決定した各変換パターンに対応するテンプレートを前記変換パターン蓄積手段から抽出し、抽出したテンプレートに基づいて前記スタイルシートに前記スタイルシート言語で前記変換パターンを記述するテンプレート記述手段と、
を有することを特徴とする請求項1に記載のスタイルシート作成装置。
The style sheet output means includes
Conversion pattern storage means for storing, for each conversion pattern, a template that defines a conversion pattern from the item of the first structured document to the item of the second structured document in a predetermined style sheet language;
A template description unit that extracts a template corresponding to each conversion pattern determined by the conversion pattern determination unit from the conversion pattern storage unit, and describes the conversion pattern in the style sheet language in the style sheet based on the extracted template; ,
The style sheet creating apparatus according to claim 1, comprising:
前記変換パターン蓄積手段は、項目の情報の変換パターンを定義するテンプレートを記憶していることを特徴とする請求項8に記載のスタイルシート作成装置。   9. The style sheet creation apparatus according to claim 8, wherein the conversion pattern storage unit stores a template defining a conversion pattern of item information. 前記構造化文書はXML(eXtensible Markup Language)文書であり、前記スキーマファイルはXMLスキーマファイルであり、前記スタイルシートはXSLT(XML Stylesheet Language Transformations)ファイルであることを特徴とする請求項1に記載のスタイルシート作成装置。   2. The structured document according to claim 1, wherein the structured document is an XML (eXtensible Markup Language) document, the schema file is an XML schema file, and the style sheet is an XSLT (XML Stylesheet Language Transformations) file. Style sheet creation device. データ構造の異なる第1及び第2構造化文書間においてデータ構造の変換を行うためのスタイルシート作成方法であって、
前記第1及び第2構造化文書それぞれについてその構造を記述した第1及び第2スキーマファイルを解析するスキーマファイル解析ステップと、
各構造化文書に含まれる情報単位である項目について、前記第1及び第2構造化文書間におけるその関連付けを記述した対応関係ファイルを読み込み、前記項目の対応関係を解析する対応関係ファイル解析ステップと、
前記対応関係ファイルの解析結果及び前記スキーマファイルの解析結果に基づいて、前記第1構造化文書から前記第2構造化文書への変換パターンを決定する変換パターン決定ステップと、
前記変換パターンに基づいて、前記第1及び第2構造化文書の異なる構造化文書間におけるデータ構造の変換を行うためのスタイルシートを出力するスタイルシート出力ステップと、
を含むことを特徴とするスタイルシート作成方法。
A stylesheet creation method for converting a data structure between first and second structured documents having different data structures,
A schema file analyzing step of analyzing first and second schema files describing the structure of each of the first and second structured documents;
A correspondence file analysis step of reading a correspondence file describing the association between the first and second structured documents for items which are information units included in each structured document, and analyzing the correspondence of the items; ,
A conversion pattern determining step for determining a conversion pattern from the first structured document to the second structured document based on the analysis result of the correspondence file and the analysis result of the schema file;
A style sheet output step of outputting a style sheet for converting a data structure between different structured documents of the first and second structured documents based on the conversion pattern;
A method for creating a style sheet, comprising:
JP2004175206A 2004-06-14 2004-06-14 Style sheet creation device Pending JP2005352945A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004175206A JP2005352945A (en) 2004-06-14 2004-06-14 Style sheet creation device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004175206A JP2005352945A (en) 2004-06-14 2004-06-14 Style sheet creation device

Publications (1)

Publication Number Publication Date
JP2005352945A true JP2005352945A (en) 2005-12-22

Family

ID=35587357

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004175206A Pending JP2005352945A (en) 2004-06-14 2004-06-14 Style sheet creation device

Country Status (1)

Country Link
JP (1) JP2005352945A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008245258A (en) * 2007-03-23 2008-10-09 Research In Motion Ltd Method and system for orchestration of content processing in mobile delivery framework
JP2010277120A (en) * 2009-05-26 2010-12-09 Kyocera Mita Corp Image forming apparatus and application view conversion program
US7882145B2 (en) 2007-03-23 2011-02-01 Research In Motion Limited Method and system for orchestration of content processing in mobile delivery frameworks
JP2016038685A (en) * 2014-08-06 2016-03-22 Jfeシステムズ株式会社 Data conversion apparatus, data conversion method, and data conversion program

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008245258A (en) * 2007-03-23 2008-10-09 Research In Motion Ltd Method and system for orchestration of content processing in mobile delivery framework
US7882145B2 (en) 2007-03-23 2011-02-01 Research In Motion Limited Method and system for orchestration of content processing in mobile delivery frameworks
JP2010277120A (en) * 2009-05-26 2010-12-09 Kyocera Mita Corp Image forming apparatus and application view conversion program
JP2016038685A (en) * 2014-08-06 2016-03-22 Jfeシステムズ株式会社 Data conversion apparatus, data conversion method, and data conversion program

Similar Documents

Publication Publication Date Title
Geurts et al. Towards ontology-driven discourse: From semantic graphs to multimedia presentations
CN100547581C (en) Method, the system of generating structure pattern candidate target
JP4997749B2 (en) Document processing method, program, and system
US20060236228A1 (en) Extensible markup language schemas for bibliographies and citations
Ide et al. The linguistic annotation framework: a standard for annotation interchange and merging
JP2006525608A (en) System and method for managing dynamic content assemblies
Huynh et al. Enabling web browsers to augment web sites' filtering and sorting functionalities
Troncy Bringing the IPTC news architecture into the semantic web
CA2353682A1 (en) Link management of document structures
JP4042830B2 (en) Content attribute information normalization method, information collection / service provision system, and program storage recording medium
US20090083300A1 (en) Document processing device and document processing method
JP2008090404A (en) Document retrieval apparatus, method and program
Almas et al. Perseids collaborative platform for annotating text re-uses of fragmentary authors
US20080005662A1 (en) Server Device and Name Space Issuing Method
US20110252313A1 (en) Document information selection method and computer program product
Stührenberg et al. A toolkit for multi-dimensional markup
JP2005352945A (en) Style sheet creation device
KR100941971B1 (en) Apparatus and Method for a query express
JP5426533B2 (en) Method and apparatus for searching multimedia content
US20090083620A1 (en) Document processing device and document processing method
Boot et al. Connecting TEI content into an ontology of the editorial domain
JP4410005B2 (en) Structured document structure conversion device and program
JP5102474B2 (en) XML data generation method and program thereof
Witt et al. Integrated linguistic annotation models and their application in the domain of antecedent detection
JP4242701B2 (en) Storage search device, storage search program, and storage search program recording medium