Presentation is loading. Please wait.

Presentation is loading. Please wait.

CXQuery를 사용하는 STREAM XML Filter

Similar presentations


Presentation on theme: "CXQuery를 사용하는 STREAM XML Filter"— Presentation transcript:

1 CXQuery를 사용하는 STREAM XML Filter
WEB DATABASE 이민영

2 목차 연구배경 기본 아이디어 구조도 프로그램

3 연구배경 Data stream Data changed constantly
Mostly only freshest data used User/Application Result Query Query Result Loader

4 연구 배경 기존 Stream XML data 질의 처리 문제점 대표적으로 Yfilter가 가장 많이 쓰임
Yfilter는 XPath를 사용 문제점 같은 데이터 혹은 비슷한 도메인의 데이터를 표현하는 데 있어 다양한 DTD가 존재 가능 사용자가 문서의 구조를 모두 알고 있어야 질의 가능

5 DTD example people customers customer city address customer name name
Xpath로 질의시 /customers/customer/name /people/customer/name customer street @name 사용자가 문서의 구조를 모르더라도 질의가 가능 CXQuery 로 질의시 Select name

6 기본 아이디어 XML stream이 수천개가 들어오더라도 그에 해당하는 DTD는 XML 문서에 비해 극히 적음
DTD문서를 이용하여 CXQuery를 Xpath로 변환 순차 1) 사용자가 CXQuery 로 질의 2) DTD 파일을 parsing 하여 CXQuery를 Xpath로 변환 3) Stream으로 들어오는 XML 파일은 자신의 DTD에 맞는 Xpath를이용

7 구조도 CXQuery를 사용자 input Xquery로 변환 DTD Parse (CXQuery) DB Stream XML
Query Process (Yfilter) DTD DB에 없는 새로운 DTD Stream XML Query 결과 저장

8 DTD File <!-- XML DTD "customers.dtd":
(Dimitrio Malheiro, Juli 2002) This DTD contains the describtion for customers.xml file --> <!ELEMENT customers (customer+)> <!ELEMENT customer (name, address, sales)> <!ELEMENT name (#PCDATA)> <!ELEMENT address (street, city, country)> <!ELEMENT street (#PCDATA)> <!ELEMENT city (#PCDATA)> <!ELEMENT country (#PCDATA)> <!ELEMENT sales (#PCDATA)> <!-- XML DTD "artists.dtd": (Dimitrio Malheiro, Juli 2002) This DTD contains the describtion for artists.xml file --> <!ELEMENT artists (artist+)> <!ELEMENT artist (name, born_in, age)> <!ATTLIST artist idnr ID #REQUIRED> <!ELEMENT name (#PCDATA)> <!ELEMENT born_in (#PCDATA)> <!ELEMENT age (#PCDATA)> <!-- XML DTD "artists.dtd": (Dimitrio Malheiro, Juli 2002) This DTD contains the describtion for artists.xml file --> <!ELEMENT artists (artist+)> <!ELEMENT artist (name, born_in, age)> <!ATTLIST artist idnr ID #REQUIRED> <!ELEMENT name (#PCDATA)> <!ELEMENT born_in (#PCDATA)> <!ELEMENT age (#PCDATA)>

9 DTD File (Cont.) <!-- XML DTD "mondial-cities.dtd":
(Dimitrio Malheiro, Juli 2002) This DTD contains the describtion for cities-xxx.xml files --> <!ELEMENT cities (city+)> <!ELEMENT city (name, country, province* ,longitude? ,latitude? ,population* ,located_at*)> <!ELEMENT name (#PCDATA)> <!ELEMENT population (#PCDATA)> <!ELEMENT longitude (#PCDATA)> <!ELEMENT latitude (#PCDATA)> <!ELEMENT located_at EMPTY> <!ELEMENT country EMPTY> <!ELEMENT province EMPTY> <!ATTLIST city is_country_cap CDATA #IMPLIED is_state_cap CDATA #IMPLIED > <!ATTLIST population year CDATA #IMPLIED > <!ATTLIST located_at watertype (river|sea|lake) #REQUIRED river IDREFS #IMPLIED sea IDREFS #IMPLIED lake IDREFS #IMPLIED > <!ATTLIST country xmlns:xlink CDATA #FIXED " xmlns:dbxlink CDATA #FIXED " xlink:type (simple|extended|locator|arc) #FIXED "simple" xlink:href CDATA #IMPLIED dbxlink:transparent IDREFS #IMPLIED > <!ATTLIST province xmlns:xlink CDATA #FIXED "

10 DTD Parse $Java mylee/mysql parsing할_dtd_file_name

11 CXQuery to XPATH $Java mylee/Test CXQuery가_저장된_파일
-- query.txt-- select name select name where country='seoul' select year where name='mylee' select year where name='mylee' and located_at='korea' Select 결과에 해당하는 Xpath를 출력 Where 절이 있는 경우 Xpath의 조건절로 표현 =>[]사용

12 결론 DTD를 Parsing하고 CXQuery를 Xpath로 전환하는데 추가 시간과 비용이 들것이라 예상
하지만 XML 파일이 수천개 이상일때, 시용자에게 편의를 제공하고 각 DTD에 해당하는 Xpath를 쓰지 않더라도 최대한의 결과를 찾아낼거라 예상 됨


Download ppt "CXQuery를 사용하는 STREAM XML Filter"

Similar presentations


Ads by Google