KR20040000194A - A Method of Extracting a Document Type Definition - Google Patents

A Method of Extracting a Document Type Definition Download PDF

Info

Publication number
KR20040000194A
KR20040000194A KR1020020035368A KR20020035368A KR20040000194A KR 20040000194 A KR20040000194 A KR 20040000194A KR 1020020035368 A KR1020020035368 A KR 1020020035368A KR 20020035368 A KR20020035368 A KR 20020035368A KR 20040000194 A KR20040000194 A KR 20040000194A
Authority
KR
South Korea
Prior art keywords
tree
dtd
xml
node
document
Prior art date
Application number
KR1020020035368A
Other languages
Korean (ko)
Inventor
오동익
Original Assignee
오동익
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 오동익 filed Critical 오동익
Priority to KR1020020035368A priority Critical patent/KR20040000194A/en
Publication of KR20040000194A publication Critical patent/KR20040000194A/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/14Tree-structured documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation
    • G06F40/154Tree transformation for tree-structured or markup documents, e.g. XSLT, XSL-FO or stylesheets

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Document Processing Apparatus (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PURPOSE: A method for extracting document structure information is provided to extract DTD(Document Type Definition) from XML(eXtensible Markup Language) which is not provided DTD, to generate DTD in a short time and efficiently. CONSTITUTION: A root tree node is generated(S1). A current path and insert pointer is generated, and initiates the current path and insert pointer(S2). An element is extracted by an XML Tokenizer at a tree constructing step. Tags in the XML document are analyzed, and extract start tag, end tag and PCDATA token(S3). Existence of same named element is checked(S4). In case that the same named tree node is existed, the new node is added(S5-1). S3 or S5 is executed for all elements(S6).

Description

문서구조정보 추출방법{A Method of Extracting a Document Type Definition}A method of extracting a document type definition

본 발명은 DTD 추출방법에 관한 것으로서, 보다 상세하게는 비정형화된 XML 문서로부터 DTD(Document Type Definition)을 추출하는 방법에 관한 것이다.The present invention relates to a DTD extraction method, and more particularly, to a method for extracting a DTD (Document Type Definition) from an unstructured XML document.

W3C라는 단체에서 표준화하고 있는 XML(Extensible Markup Language)이란 새로운 언어가 월드와이드웹(World Wide Web)에서 데이터를 표현하는 주요한 표준으로 자리잡고 있다. XML의 제안은 "어떤 형태의 데이터이던지 표준 개방 형태로만표현되면 자유롭게 주고받을 수 있고 조작할 수 있게 하겠다"는 목표로 출발했다. 이런 유연성을 갖는 XML은 전자상거래와 지능형 웹 검색과 같은 차세대 애플리케이션을 접목한 웹에서의 서류(document) 교환, 질의(query)하는 표준으로 급부상하고 있다. XML 데이터는 반정형(semistructured) 데이터의 한가지 형태다. XML 데이터는 계층적으로 구조화된 엘리먼트의 모임으로써 각각의 엘리먼트는 기본적인 단순한 타입이거나(atomic), 아니면 다른 요소들의 모임으로 이뤄져 있다. 더구나 XML 서류들의 각 엘리먼트에는 '태그'라는 것이 있어 HTML에서처럼 단지 엘리먼트를 어떻게 표현할까를 표시한다기보다는 그 데이터의 의미(semantic)를 나타내 줄 수 있다. 그러므로, 반정형 데이터와 같이 XML 데이터는 계층적으로 구조화되고 또 자기 스스로 묘사하는 형태다. 하지만 XML이 반정형 데이터와 다른 점은 자유 선택으로 동반되는 DTD(Document Type Definition)라는 개념이다. XML 서류에 들어있는 DTD는 서류의 내부 구조를 명시하는 역할을 담당한다. 본질적으로 DTD는 각각의 엘리먼트에 그 엘리먼트의 서브 엘리먼트가 따라야 하는 규칙적인 표현(regular expression) 패턴을 표시해준다. DTD는 산업의 표준으로서 전자 서류들의 자유로운 교환을 가능하게 해줄 뿐 아니라, DTD에 따르는 서류들의 내용을 추출하고 이해하고 분석할 수 있게 해준다. 그 외에도 DTD는 XML 데이터의 구조를 정의할 수 있는 기본적인 수단을 제공한다. 그렇기 때문에, DTD는 XML 데이터의 효율적인 저장뿐만 아니라 XML 서류들의 수집에 대한 질의생성(formulation), 최적화(optimization), 처리(processing) 등에 관해 아주 중요한 역할을 담당한다. 예를 들면, DTD는 XML 데이터의 질의에 대한 처리에 있어 데이터의 적절한 부분만을 검색할 수 있게 해줘 처리를 빠르게 해준다. 기본적인 아이디어는 DTD에 의해 나타내어지는 데이터 구조에 대한 정보를 이용해 질의의 path expression을 만족할 가능성이 없는 엘리먼트를 자르는데 사용하는 것이다. 이러한 DTD의 중요성에도 불구하고, DTD는 XML 서류에 반드시 제공돼야 하는 것이 아니다. 그렇게 때문에 많은 XML 데이터들은 DTD를 갖지 않는 경우가 많다. 하지만, DTD가 주어지지 않더라도 스키마 정보는 실제 XML 데이터에 '태그'(tag)라는 형태로 이미 들어가 있다. 이러한 특징은 XML 데이터가 반정형 데이터 모델을 따르기 때문이다.Extensible Markup Language (XML), which is being standardized by the W3C organization, is becoming a major standard for representing data on the World Wide Web. XML's proposal started with the goal of "any type of data can be freely exchanged and manipulated if it is expressed only in standard open form." XML with this flexibility is emerging as a standard for exchanging documents and querying the Web, combining next-generation applications such as e-commerce and intelligent web search. XML data is a form of semistructured data. XML data is a collection of hierarchically structured elements, each of which is a basic simple type (atomic) or a collection of other elements. Furthermore, each element in XML documents has a 'tag' that can represent the semantics of the data rather than just how the element is represented, as in HTML. Thus, like semi-structured data, XML data is hierarchically structured and self-describing. But XML differs from semi-structured data in the concept of document type definition (DTD), which is accompanied by free choice. The DTD contained in the XML document is responsible for specifying the internal structure of the document. In essence, the DTD marks each element with a regular expression pattern that the subelements of that element must follow. The DTD is an industry standard that allows not only the free exchange of electronic documents, but also the extraction, understanding and analysis of the contents of the documents in accordance with the DTD. In addition, the DTD provides a basic means of defining the structure of XML data. As such, DTDs play a very important role in query formation, optimization, and processing of XML documents as well as the efficient storage of XML data. For example, the DTD speeds up processing by allowing you to retrieve only the appropriate portion of the data when processing an XML data query. The basic idea is to use information about the data structure represented by the DTD to cut out elements that are unlikely to satisfy the path expression of the query. Despite the importance of these DTDs, DTDs are not required to be provided in XML documents. As a result, many XML data often do not have a DTD. However, even if no DTD is given, the schema information is already included in the form of 'tag' in the actual XML data. This is because XML data follows a semistructured data model.

비 정형화된 문서에서 상품정보를 추출하기 위해 필요한 가장 핵심적인 기술은 문서내의 정보를 계층구조로 표현하고 이를 통해 정보를 추출하는 것이다. 비 정형화된 데이터 소스에서 정보 추출을 위해서는 데이터 채집(Data Mining)분야에서 활발한 연구가 진행되고 있고, 특히 HTML 문서에서의 정보추출에 관한 작업도 래퍼(Wrapper)를 활용한 방식 등을 통하여 활발히 진행되고 있으나 아직까지 만족할 만한 정보 추출이 이루어지고 있지는 못하다.The most essential technique for extracting product information from an informal document is to express the information in the document in a hierarchical structure and to extract the information. In order to extract information from unstructured data sources, active research is being conducted in the field of data mining, and in particular, information extraction from HTML documents is actively conducted through the use of wrappers. However, satisfactory information extraction has not been made yet.

이와 유사한 연구들은 다른 연구 그룹들에 의해서도 이루어진 바 있으나, 전체적인 DTD 문법을 활용할 수 없다거나, 다른 프로그램 모듈에서 인터페이스가 될 수 없다는 제약점을 가지고 있다. 또한 이들은 XML문서들의 공통된 구조를 추출하기 위하여 먼저 XML문서 각각의 구조를 트리나 그래프를 이용하여 표현하고 이들을 통합하는 2단계 알고리즘을 채택하고 있다.Similar studies have been conducted by other research groups, but have the limitation that they cannot utilize the overall DTD grammar or interface with other program modules. Also, in order to extract the common structure of XML documents, they first adopt a two-stage algorithm that expresses the structure of each XML document using tree or graph and integrates them.

본 발명은 상기한 바와 같은 문제점을 해결하기 위하여 다른 프로그램 모듈의 인터페이스로 사용될 수 있도록 하고, DTD가 제공되지 않는 XML 문서에서 DTD를 추출하고, 보다 빠르고 효율적으로 DTD을 생성할 수 있는 효율적인 DTD 추출방법을 제공하는 것을 목적으로 한다.The present invention can be used as an interface of other program modules to solve the above problems, extract the DTD from the XML document is not provided DTD, efficient DTD extraction method that can generate DTD faster and more efficiently The purpose is to provide.

본 발명의 다른 목적은 독립된 모듈로 구현되지만 인터페이스를 통해 다른 모듈에서 활용이 가능한 DTD 추출방법을 제공하는 것이다.Another object of the present invention is to provide a DTD extraction method that is implemented as an independent module but can be utilized in other modules through an interface.

본 발명의 또 다른 목적은 종래의 2단계 DTD추출 알고리즘에서 각 XML문서의 구조를 중간적 형태의 트리나 그래프로 변환하는 단계를 삭제한 향상된 1단계 알고리즘을 적용한 DTD 추출방법을 제공하는 것이다.It is still another object of the present invention to provide a DTD extraction method using an advanced one-step algorithm that eliminates the step of transforming the structure of each XML document into an intermediate tree or graph in the conventional two-step DTD extraction algorithm.

이러한 목적들을 달성하기 위한 본 발명에 따른 DTD 추출방법은 여러 XML 데이터를 위한 단일 DTD를 생성하기 위해 입력되는 XML정보를 계층적 자료구조(Tree)로 표현하는 것을 특징으로 한다.The DTD extraction method according to the present invention for achieving these objects is characterized by representing the XML information input to create a single DTD for multiple XML data in a hierarchical data structure (Tree).

본 발명에 따른 DTD 추출방법의 구체적인 특징은 DTD(Document Type Definition)가 제공되지 않는 XML(Extensible Markup Language) 문서에서 DTD를 추출하는 방법에 있어서: XML 문서의 루트(Root) 트리노드(tree node)를 생성하는 제1과정과; 트리내에서 검색 및 삽입될 위치를 가리키는 현재경로(current path)와 삽입포인터(insert pointer)를 생성하여 상기 루트 노드를 가리키도록 초기화하는 제2과정과; XML 문서의 각 구성요소(element)를 추출하는 제3과정과; 추출된 구성요소(element)에 대하여 전달된 구성요소(element)와 같은 이름을 가진 트리노드를 검색하는 제4과정과; 구성요소(element)와 같은 이름의 트리노드가 존재하는 경우에는 구성요소(element) 단계에 입각한 트리노드의 속성을 갱신하고, 존재하지 않는 경우에는 추가될 위치를 가리키는 현재경로(current path)와 삽입포인터(insert pointer)의 설정정보, 시작 포인터(start pointer)의 설정정보를 바탕으로 트리노드를 생성하는 제5과정과; 제3과정 내지 제5과정을 처리되지 않은 구성요소가 없도록 XML 문서의 모든 구성요소에 대하여 반복하는 제6과정과; 모든 서브트리(subtree)에 대하여 OR 관계로 설정된 두 서브트리(subtree) 중 공통된 노드를 추출하여 병합(merge)하는 제7과정과; 더 이상 서브트리(subtree)가 존재하지 않는 상태의 통합트리에서 DTD 문법을 추출하는 제8과정을 포함하여 이루어지는 점이다.A specific feature of the DTD extraction method according to the present invention is a method for extracting a DTD from an Extensible Markup Language (XML) document that does not provide a Document Type Definition (DTD): a root tree node of an XML document. Generating a first process; Generating a current path and an insert pointer indicating a location to be searched and inserted in the tree and initializing the pointer to point to the root node; Extracting each element of the XML document; A fourth step of searching for a tree node having the same name as the delivered element with respect to the extracted element; If there is a tree node with the same name as the element, it updates the attributes of the tree node based on the element level, and if it does not exist, it indicates the current path and A fifth process of generating a tree node based on setting information of an insertion pointer and setting information of a start pointer; A sixth step of repeating steps 3 to 5 for all components of the XML document such that there are no unprocessed elements; A seventh step of extracting and merging a common node among two subtrees set in an OR relationship with respect to all subtrees; An eighth step of extracting the DTD grammar from the unified tree in which no subtree exists anymore is included.

도 1은 비 정형화된 문서 수집기의 시스템 구성도,1 is a system configuration diagram of an unstructured document collector;

도 2는 트리와 트리노드의 속성을 이용하여 XML DTD의 각 연산자들을 표현한 DTD연산자의 트리표현도,2 is a tree representation of a DTD operator expressing each operator of an XML DTD using attributes of a tree and a tree node;

도 3은 본 발명에 따른 DTD 추출방법의 진행과정을 나타낸 흐름도,3 is a flowchart illustrating a process of a DTD extraction method according to the present invention;

도 4는 트리 수정 및 보완 단계에서 트리를 간략화 하는 작업의 예시도,4 is an exemplary diagram of a task of simplifying a tree in a tree modification and supplementation step

이하, 첨부된 도면을 참조로 본 발명에 따른 DTD 추출방법에 관하여 설명하기로 한다.Hereinafter, a DTD extraction method according to the present invention will be described with reference to the accompanying drawings.

도 1은 인터넷을 통해 연결된 쇼핑몰 서버로부터 비 정형화된 상품정보를 제공받은 경우, 문서의 정보를 처리하는 시스템의 개략적 구성을 나타낸 구성도이다.1 is a block diagram showing a schematic configuration of a system for processing information of a document when receiving informal product information from a shopping mall server connected through the Internet.

각 쇼핑몰로부터 XML 문서를 수신받는 XML 문서 수집기 모듈(1)과, 수집된 데이터로부터 XML 정보를 추출하고 그룹화하기 위한 추출 및 그룹화 모듈(2)과, DTD 추출기 모듈(3), 및 XML 매핑(mapping) 및 데이터 저장 모듈(4)로 구성되어 있다. 이중 XML 정보추출 및 그룹화 모듈(2)과 DTD 추출기 모듈(3)은 본 발명의 핵심으로서, 비 정형화된 XML문서에서 DTD를 추출하는 역할을 한다.An XML document collector module 1 for receiving XML documents from each shopping mall, an extraction and grouping module 2 for extracting and grouping XML information from the collected data, a DTD extractor module 3, and XML mapping ) And a data storage module 4. Dual XML information extraction and grouping module (2) and DTD extractor module (3) is the core of the present invention, serves to extract a DTD from an unstructured XML document.

본 발명에서는 비 정형화된 XML문서에서 DTD를 추출하기 위해 XML문서를 트리(tree)로 표현하기 위한 2가지 자료구조인 트리노드(tree node)와 원본 트리노드 테이블(tree node table)을 사용한다.In the present invention, to extract a DTD from an unstructured XML document, two data structures, a tree node and an original tree node table, are used to represent an XML document as a tree.

트리(tree)는 XML 문서의 각 구성요소(Element)를 표현하는 노드(node)로 구성된다. 이러한 트리노드는 XML문서에서 각 구성요소(element)가 가질 수 있는 관계들, 즉 명령(Mandatory), 조건(Optional), OR, 반복(Repetition)을 가리키는 속성들로 구성되어 있다. 또한, 트리노드(tree node)에는 속성(attribute) 이외에 노드간의 관계를 나타내기 위한 필드(field)가 필요하게 된다. [표 1]은 트리노드의 중요필드와 역할을 나타내고 있다.The tree consists of nodes that represent each element of the XML document. Such a tree node consists of attributes that indicate the relationships each element can have in an XML document, namely, Mandatory, Optional, OR, and Repetition. In addition, a tree node requires a field for indicating a relationship between nodes in addition to an attribute. Table 1 shows the important fields and roles of the tree node.

속성명Attribute name 역 할Role 비고Remarks ele_nameele_name 해당 노드의 XML element 이름XML element name of the node 트리노드의 공통 속성Common attributes of tree nodes isMandatoryisMandatory 해당 노드의 Mandatory와 Optional 표현Mandatory and Optional Representation of the Node isRepeatisRepeat 해당 노드의 관계 중 repetition 표현Repetition expression among relationships of the node isCheckedisChecked ·해당 노드의 Repetition을 확인·트리구성중 해당 노드의 방문여부Check the repetition of the node.Visit the node during tree construction isNewCreatedisNewCreated 해당 노드의 새로이 생성된 트리노드 여부Whether the node is a newly created tree node refnodeIDrefnodeID 해당 노드의 원본 트리노드의 링크정보Link information of the original tree node of the node 일반 트리노드 속성General Treenode Attributes chainchain ·트리노드의 일정 패턴 반복 표현·다음 트리노드의 경로정보 저장Repetitive expression of a certain pattern of a tree nodeSaves path information of the next tree node 트리의 반복 처리를 위한 속성Attributes for Iterating Trees linkedlinked ·element 패턴의 반복 표현·이전 트리노드의 경로정보 저장Iterative representation of element patternStorage path information of previous tree node isTempisTemp 해당 노드가 임시노드임을 나타냄Indicates that this node is a temporary node 임시 노드 관련 속성Temporary Node Related Attributes isORisOR 해당 임시노드가 OR 관계임을 표현Indicates that temporary node is in OR relationship isOptionalisOptional 해당 임시노드가 Optional임을 표현Express that the temporary node is optional

위의 표에서 알 수 있듯이 구성요소(Element)의 처리여부를 판별할 수 있는isChecked 속성과 해당 트리노드가 현재 처리중인 XML문서의 부모 구성요소 (Element)로 둘러 싸인 단락을 처리하는 도중에 새로이 생성되었는지의 여부를 나타내기위한 isNewCreated속성을 가진다. 또한 isTemp 속성을 가지는데, 이는 임시노드를 나타내기 위한 속성이다.As can be seen from the table above, the isChecked property to determine whether the element is processed and whether the tree node is newly created while processing the paragraph surrounded by the parent element of the XML document being processed. Has an isNewCreated attribute to indicate whether It also has an isTemp attribute, which is used to represent a temporary node.

XML문서를 트리로 구축하는 과정에서는 여러 개의 임시노드를 사용하여 각 XML문서에 포함되어진 구성요소(element)간의 순서관계와 반복(Repetition) 및 선택조건(Optional)관계를 표현하고 있다. 이러한 방법 때문에 트리상에서 하나의 구성요소(element)에 대한 복수개의 트리노드가 존재하고 또한 그러한 각각의 트리노드는 자식노드를 가질 수 있다. 이러한 중복정의 문제를 해결하기 위해서 본 발명에서는 트리상에서 실제 해당 트리노드의 구조를 표현하는 원본 트리노드에 대한 경로를 refnodeID라는 이름으로 각 트리노드가 필드로서 저장하도록 설계하였다.In the process of constructing the XML document as a tree, several temporary nodes are used to express the order relationship, repetition, and optional relationship between elements included in each XML document. Because of this method, there may be a plurality of tree nodes for one element on the tree and each such tree node may have child nodes. In order to solve this problem of redundancy, the present invention is designed such that each tree node stores a path to an original tree node representing a structure of the corresponding tree node on the tree under the name refnodeID.

그리고, 원본 트리노드들의 리스트를 테이블로서 관리하여 새로운 노드가 트리에 추가되어질 때나 트리노드의 isChecked속성을 갱신할 때 원본 트리노드 테이블에서 원본 트리노드의 경로정보를 추출하여 현재경로(currentPath)와 삽입포인터(insertPointer)의 위치를 설정하는데 사용할 수 있도록 하였다.Also, by managing the list of original tree nodes as a table, when the new node is added to the tree or when updating the isChecked property of the tree node, the path information of the original tree node is extracted from the original tree node table, and the current path is inserted. It can be used to set the position of a pointer (insertPointer).

도 2는 앞서 설명한 트리노드와 트리노드의 속성을 이용하여 XML DTD의 각 연산자들을 표현한 것이다. 앞서 설명한 트리 노드 및 데이터 구조를 사용하여 DTD 추출기는 XML 문서내의 중첩된 구조를 트리로 표현하게 된다.2 illustrates each operator of the XML DTD by using the above-described tree node and attributes of the tree node. Using the tree nodes and data structures described above, the DTD extractor will represent a nested structure in an XML document as a tree.

이러한 트리 구성은 크게 초기화, 트리구축, 트리 수정 및 보완의 3단계로 구분되어질 수 있다. 도 3은 본 발명에 따른 DTD 추출과정을 나타낸 흐름도이다.This tree structure can be divided into three stages: initialization, tree construction, tree modification, and supplementation. 3 is a flowchart illustrating a DTD extraction process according to the present invention.

초기화 단계에서는 우선 모든 XML 구성요소(element)의 부모인 루트(Root) 트리 노드를 생성하게 된다(S1).In the initialization step, first, a root tree node that is the parent of all XML elements is generated (S1).

그리고 트리내에서 검색 및 삽입될 위치를 가리키는 현재경로(currentPath)와 삽입포인트(insertPointer)를 생성한 후, 각각 루트(Root)노드를 가리키도록 초기화한다(S2).After generating a current path and an insertion point indicating a location to be searched and inserted in the tree, the path is initialized to point to a root node (S2).

트리 구축 단계에서는 XML Tokenizer에 의해서 XML문서의 각 구성요소 (element)를 추출한다. 추출하는 방법은 XML 문서안의 태그(tag)를 분석한다. 분석하여 시작태그(start tag), 종료(end tag) 및 PCDATA에 해당하는 토큰을 추출하는 것이다(S3).In the tree construction phase, each element of the XML document is extracted by the XML Tokenizer. The extraction method analyzes a tag in an XML document. Analysis is to extract the token corresponding to the start tag (end tag), end (end tag) and PCDATA (S3).

추출된 구성요소(element)에 대하여 전달된 구성요소(element)와 같은 이름을 가지는 트리 노드가 존재하는 지 검색한다(S4). 이름의 트리노드가 없으면 새로운 노드를 추가하거나(S5-1) 혹은 존재하는 노드의 속성을 변경한다(S5-2). 먼저 주어진 구성요소(element)의 이름을 바탕으로 트리에서 검색을 실시하게 된다. 추가되어질 위치를 나타내는 현재경로 (currentPath)와 삽입포인터 (insertPointer)의 설정정보, 시작포인터 (startPointer)의 설정정보를 바탕으로 트리노드를 새로이 생성하여 트리에 추가하거나 아니면 기존의 존재하는 트리노드의 속성(attribute)들을 갱신하는 상기 S3내지 S5과정을 모든 구성요소(element)에 대하여 수행한다(S6).It is searched whether a tree node having the same name as the delivered element exists for the extracted element (S4). If there is no tree node of the name, a new node is added (S5-1) or an attribute of an existing node is changed (S5-2). First, the search is performed in the tree based on the name of a given element. Based on the current path, insertPointer setting information, and start pointer setting information indicating the location to be added, a new tree node is created and added to the tree, or existing tree node properties Steps S3 to S5 for updating the attributes are performed for all elements (S6).

트리 구축 단계에 의해 구성된 트리는 상당한 복잡도를 갖는 형태가 될 것이다. 트리 수정 및 보완 단계에서는 추출되어질 DTD의 가독성을 높이기 위해 구축되어진 트리를 보다 간략화 하는 작업이 수행된다. 트리 수정 및 보완 단계에서는 구축되어진 트리에서 임시노드 중 isOR속성이 True인 노드들에 대하여 간략화 작업을 수행한다. 즉 OR관계로 설정된 두 하부트리(Subtree) 중 공통된 노드를 추출 및 이들의 병합을 수행한다.The tree constructed by the tree building phase will be in a form of significant complexity. In the tree modification and supplementation phase, a simplified tree is constructed to improve the readability of the DTD to be extracted. In the tree modification and supplementation phase, the simplified operation is performed on nodes whose isOR attribute is True among temporary nodes in the constructed tree. That is, a common node is extracted and merged among two subtrees set in an OR relationship.

예를 들어 다음과 같은 xml 문서를 처리하는 것을 살펴보기로 하자.For example, consider processing the following xml document:

<test><test>

<a>....</a><a> .... </a>

<b>....</b><b> .... </ b>

<c>....</c><c> .... </ c>

</test></ test>

<test><test>

<b>....</b><b> .... </ b>

<c>....</c><c> .... </ c>

</test></ test>

도 4는 이러한 트리 수정 및 보완 단계에서 isOR속성이 True인 노드들의 간략화를 보여주고 있다. 위의 예제 XML문서는 트리 구축 단계까지를 거치면서 첫번째 트리를 구축하게 될 것이다. 여기서 OR관계로 설정되어진 두 Subtree에는 공통되는 부분(b, c)이 존재하지만 이것을 하나로 묶지 못하고 분리시켜 트리를 구축하였다(S7). 트리 편집장치(Tree Modifier)는 구축되어진 원본 트리노드 테이블을 입력으로 테이블의 각 원소를 순회하며 각 원소의 자식노드들 중에서 OR관계로 구축되어진 두 개의 Subtree중 공통된 노드들을 추출한 후, 더 간략화 된 트리를 구축하게 된다(S8).4 shows the simplification of the nodes whose isOR attribute is True in this tree modification and enhancement phase. The above example XML document will build the first tree through the tree construction phase. Here, there are common parts (b, c) in the two subtrees set in the OR relationship, but the tree is constructed by separating them into one (S7). The tree modifier traverses each element of the table by inputting the constructed original tree node table, extracts common nodes among two subtrees constructed in OR relationship among the child nodes of each element, and then further simplified tree It will be built (S8).

이와 같은 과정을 통해 형성된 통합 트리에서 DTD 문법을 추출한다. 추출된 DTD를 이용하여 XML문서를 매핑하여 상업용 데이터베이스에 저장하게 된다. 이와 같이 XML 파일을 처음부터 끝까지 한 번만 읽어들여서 처리하게 된다. 두 번을 읽어야 하는 방식인 종래 기술에 비해 본 발명에 따른 1-Path 방식은 I/O 시간이 그 만큼 적기 때문에 프로그램의 효율성(속도면)이 증가한다.The DTD grammar is extracted from the integration tree formed through this process. Using the extracted DTD, the XML document is mapped and stored in the commercial database. In this way, the XML file is read and processed only once from the beginning to the end. Compared to the prior art, which requires reading twice, the 1-Path method according to the present invention increases the efficiency (speed) of the program because the I / O time is so small.

이상에서 설명한 바와 같이, 본 발명에 따른 DTD 추출방법은 XML문서에서 정보를 추출하기 위한 2 단계 알고리즘의 단점을 보완하여 1 단계 알고리즘으로 XML문서의 구조를 트리로 표현함으로써 보다 효율적이고 신속한 방법으로 여러 XML데이터를 위한 단일 DTD를 추출하는 것이 가능하도록 해준다.As described above, the DTD extraction method according to the present invention compensates for the shortcomings of the two-stage algorithm for extracting information from the XML document and expresses the structure of the XML document as a tree in a one-stage algorithm. It makes it possible to extract a single DTD for XML data.

Claims (1)

인터넷을 통해 쇼핑몰로부터 제공되는 문서구조정보(Document Type Definition: DTD)가 제공되지 않는 XML(Extensible Markup Language) 문서에서 문서구조정보(DTD)를 추출하는 방법에 있어서:In a method of extracting document structure information (DTD) from an XML (Extensible Markup Language) document that does not provide document type definition (DTD) provided from a shopping mall via the Internet: XML 문서의 루트(Root) 트리노드(tree node)를 생성하는 제1과정과;A first step of generating a root tree node of an XML document; 트리내에서 검색 및 삽입될 위치를 가리키는 현재경로(current path)와 삽입포인터(insert pointer)를 생성하여 상기 루트 노드를 가리키도록 초기화하는 제2과정과;Generating a current path and an insert pointer indicating a location to be searched and inserted in the tree and initializing the pointer to point to the root node; XML 문서의 각 구성요소(element)를 추출하는 제3과정과;Extracting each element of the XML document; 추출된 구성요소(element)에 대하여 전달된 구성요소(element)와 같은 이름을 가진 트리노드를 검색하는 제4과정과;A fourth step of searching for a tree node having the same name as the delivered element with respect to the extracted element; 구성요소(element)와 같은 이름의 트리노드가 존재하는 경우에는 구성요소(element) 단계에 입각한 트리노드의 속성을 갱신하고, 존재하지 않는 경우에는 추가될 위치를 가리키는 현재경로(current path)와 삽입포인터(insert pointer)의 설정정보, 시작 포인터(start pointer)의 설정정보를 바탕으로 트리노드를 생성하는 제5과정과;If there is a tree node with the same name as the element, it updates the attributes of the tree node based on the element level, and if it does not exist, it indicates the current path and A fifth process of generating a tree node based on setting information of an insertion pointer and setting information of a start pointer; 제3과정 내지 제5과정을 처리되지 않은 구성요소가 없도록 XML 문서의 모든 구성요소에 대하여 반복하는 제6과정과;A sixth step of repeating steps 3 to 5 for all components of the XML document such that there are no unprocessed elements; 모든 서브트리(subtree)에 대하여 OR 관계로 설정된 두 서브트리(subtree)중 공통된 노드를 추출하여 병합(merge)하는 제7과정과;A seventh step of extracting and merging a common node among two subtrees set in an OR relationship with respect to all subtrees; 더 이상 서브트리(subtree)가 존재하지 않는 상태의 통합트리에서 DTD 문법을 추출하는 제8과정을 포함하여 이루어지는 문서구조정보 추출방법.And an eighth step of extracting the DTD grammar from the unified tree in a state where a subtree no longer exists.
KR1020020035368A 2002-06-24 2002-06-24 A Method of Extracting a Document Type Definition KR20040000194A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020020035368A KR20040000194A (en) 2002-06-24 2002-06-24 A Method of Extracting a Document Type Definition

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020020035368A KR20040000194A (en) 2002-06-24 2002-06-24 A Method of Extracting a Document Type Definition

Publications (1)

Publication Number Publication Date
KR20040000194A true KR20040000194A (en) 2004-01-03

Family

ID=37312243

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020020035368A KR20040000194A (en) 2002-06-24 2002-06-24 A Method of Extracting a Document Type Definition

Country Status (1)

Country Link
KR (1) KR20040000194A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100493882B1 (en) * 2002-10-23 2005-06-10 삼성전자주식회사 Query process method for searching xml data
KR100580198B1 (en) * 2004-04-02 2006-05-16 삼성전자주식회사 XML processor having function for filtering tree path, method for filtering tree path and recording medium storing a program to implement thereof
KR100712717B1 (en) * 2005-10-19 2007-05-04 동양기전 주식회사 Motor assembly for driving wiper
KR100762712B1 (en) * 2005-12-13 2007-10-02 한국과학기술정보연구원 Method for transforming of electronic document based on mapping rule and system thereof
KR100908301B1 (en) * 2007-06-05 2009-07-17 성균관대학교산학협력단 List-based maximum frequent subtree extraction method and apparatus

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100493882B1 (en) * 2002-10-23 2005-06-10 삼성전자주식회사 Query process method for searching xml data
KR100580198B1 (en) * 2004-04-02 2006-05-16 삼성전자주식회사 XML processor having function for filtering tree path, method for filtering tree path and recording medium storing a program to implement thereof
KR100712717B1 (en) * 2005-10-19 2007-05-04 동양기전 주식회사 Motor assembly for driving wiper
KR100762712B1 (en) * 2005-12-13 2007-10-02 한국과학기술정보연구원 Method for transforming of electronic document based on mapping rule and system thereof
KR100908301B1 (en) * 2007-06-05 2009-07-17 성균관대학교산학협력단 List-based maximum frequent subtree extraction method and apparatus

Similar Documents

Publication Publication Date Title
US8935267B2 (en) Apparatus and method for executing different query language queries on tree structured data using pre-computed indices of selective document paths
US7293018B2 (en) Apparatus, method, and program for retrieving structured documents
US20040163041A1 (en) Relational database structures for structured documents
US6658624B1 (en) Method and system for processing documents controlled by active documents with embedded instructions
US9361398B1 (en) Maintaining a relational database and its schema in response to a stream of XML messages based on one or more arbitrary and evolving XML schemas
US7403940B2 (en) Optimal storage and retrieval of XML data
Rys Bringing the Internet to your database: Using SQL Server 2000 and XML to build loosely-coupled systems
US7877400B1 (en) Optimizations of XPaths
US7953742B2 (en) Three-phase single-pass efficient processing of Xquery update
US20090307187A1 (en) Tree automata based methods for obtaining answers to queries of semi-structured data stored in a database environment
KR20040000194A (en) A Method of Extracting a Document Type Definition
Paradis et al. A virtual document interpreter for reuse of information
CN114003231B (en) SQL syntax parse tree optimization method and system
Vercoustre et al. A descriptive language for information object reuse through virtual documents
Hsu et al. UCIS-X: an updatable compact indexing scheme for efficient extensible markup language document updating and query evaluation
Abdel-Aziz et al. Mapping XML DTDs to relational schemas
Lim et al. Extracting structures of html documents
KR100290665B1 (en) Method for storing and managing structured document in relational database
JP2002297601A (en) Method and device for structured document management, and program
JP5374456B2 (en) Method of operating document search apparatus and computer program for causing computer to execute the same
Jayanthi Vector based labeling method for dynamic XML documents
Seng et al. An analytic study of XML database techniques
Kim et al. Efficient processing of regular path joins using PID
Al Hamad Catalog-based Conversion from Relational Database into XML Scheme (XSD)
Vercoustre et al. Reuse of linked documents through virtual document prescriptions

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E601 Decision to refuse application