1 / 12

CXQuery 를 사용하는 STREAM XML Filter

CXQuery 를 사용하는 STREAM XML Filter. WEB DATABASE 2005.06.14 이민영. 목차. 연구배경 기본 아이디어 구조도 프로그램. Query. Result. Query …. Result …. 연구배경. Data stream Data changed constantly Mostly only freshest data used. User/Application. Loader. 연구 배경. 기존 Stream XML data 질의 처리

Download Presentation

CXQuery 를 사용하는 STREAM XML Filter

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

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

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

  5. DTD example people customers • CXQuery 로 질의시 • Select name customer city address customer name name Customers • 서로 다른 DTD이지만 비슷한 내용을 담고 있음 • Xpath로 질의시 • /customers/customer/name • /people/customer/name • /customers/customer/@name customer street @name • 사용자가 문서의 구조를 모르더라도 질의가 가능

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

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

  8. DTD File <!-- XML DTD "customers.dtd": (Dimitrio Malheiro, malheiro@informatik.uni-freiburg,de, 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, malheiro@informatik.uni-freiburg,de, 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, malheiro@informatik.uni-freiburg,de, 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, malheiro@informatik.uni-freiburg,de, 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 "http://www.w3.org/1999/xlink" • xmlns:dbxlink CDATA #FIXED "http://www.informatik.uni-freiburg.de/~malheiro/dbxlink" • xlink:type (simple|extended|locator|arc) #FIXED "simple" • xlink:href CDATA #IMPLIED • dbxlink:transparent IDREFS #IMPLIED > • <!ATTLIST province xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink" • xmlns:dbxlink CDATA #FIXED "http://www.informatik.uni-freiburg.de/~malheiro/dbxlink" • xlink:type (simple|extended|locator|arc) #FIXED "simple" • xlink:href CDATA #IMPLIED • dbxlink:transparent IDREFS #IMPLIED >

  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를 쓰지 않더라도 최대한의 결과를 찾아낼거라 예상 됨

More Related