Presentation is loading. Please wait.

Presentation is loading. Please wait.

Wrapper : 프로그래밍 언어 연구실 석사 2 학기, 이 혜 수 - W4F, XWRAP 의 architecture 와 demo 중심으로 데이터베이스 99’2 학기 프로젝트.

Similar presentations


Presentation on theme: "Wrapper : 프로그래밍 언어 연구실 석사 2 학기, 이 혜 수 - W4F, XWRAP 의 architecture 와 demo 중심으로 데이터베이스 99’2 학기 프로젝트."— Presentation transcript:

1 Wrapper : 프로그래밍 언어 연구실 석사 2 학기, 이 혜 수 - W4F, XWRAP 의 architecture 와 demo 중심으로 데이터베이스 99’2 학기 프로젝트

2 2 Contents Motivation Motivation Wrapper 소개 Wrapper 소개 W4F wrapper W4F wrapper  architecture overview  HEL (HTML Extraction language), regular expression  W4F 의 mappings, templates  실행환경, GUI Wizard XWRAP XWRAP  architecture overview  Xwrap toolkit 의 walk through 결론 - Web wrappers 비교 결론 - Web wrappers 비교 참고문헌 참고문헌

3 3 Motivation (1/2) 인터넷과 웹의 성장  쉽고 값싼 전자 문서 출판, 배포 가속화 인터넷과 웹의 성장  쉽고 값싼 전자 문서 출판, 배포 가속화  회사 : 온라인 카탈로그, 연간 리포트, 마케팅 브로셔, 제품 사양  정부 : 새로운 규칙, 세법, 서비스 정보  기구. 단체 : 최근의 연구 결과  개인 : 전문적인 특기, 취미 등을 올림 But how to do you But how to do you  filter hundreds of results from an AltaVista query  compare dozens of products from an on-line catalogue  “join” information from multiple Web sources ex) on-line bookstore 에서 US dollars 가 아닌, 원화로 가격을 알고 싶을 때

4 4 Motivation (2/2) New Challenges New Challenges  human-browsing  application-friendly  전체 과정의 자동화  웹 서비스간의 웹 -awareness : 또 다른 서비스 활용  상호 운용성 (interoperability) : 웹 소스와 기존의 데이터베이스

5 5 Web wrapper Wrapper : Wrapper :  한 모델에서 다른 모델로 데이터와 쿼리를 전환해 줄 수 있는 s/w 컴포넌트  웹 환경에서 wrapper 의 목적 :  wrapper 를 통해서 semi-structured 데이터에 대해서 데이터베이스의 SQL 과 같은 쿼리를 제공 HTML 문서에 implicitly 정보 구조적 형태의 explicitly 정보로 변환

6 6 How to build a wrapper Wrapper Construction Wrapper Construction manual semi-automatic automatic manual semi-automatic automatic wizard by example wizard by example W4F : 전문가 필요 (by manual) - wysiwyg 인터페이스 제공 - path-expression 제공 - machine-learning(ML) 사용 : 더 욱 나은 path-expression 제공 Xwrap : (by semi-automatic) - 다양한 wizard 제공 - HTML 구조를 display - 사용자가 단순히 click 함으로써

7 7 W4F wrapper architecture Retrieval Rules Extraction Rules NSL String String[] Actor[] DOM tree HTML page title genre cast Casablanca Drama, War, Romance Humphrey Bogart Ingrid Bergman... Mapping to Java objects Mapping to XML The Java objects can now be used by any Java application. Retrieval wizard Extraction Wizard Mapping wizard Mapping Rules Extraction Engine Retrieval Agent World Wide Web XML document Parser Mapper

8 8 W4F(1/2) W4F is not W4F is not  query language  mediator system W4F is W4F is  a toolkit to generate wrappers for Web information sources W4F’s key Features   light-weight components   rapid design and generation   fully declarative specifications   robustness   direct integration into Java programs and re-usability

9 9 it consists of: it consists of:  retrieval layer : 웹 데이터 소스로부터 HTML 내용을 fetch  extraction layer : 문서로부터 정보를 추출  mapping layer : 그 데이터를 어떻게 export 할 것인지를 명세  HTML parser : HTML 페이지를 트리로 parse 하는 역할  compiler : 각각의 레이어를 Java code 로 번역  다양한 visual wizards W4F (2/2)

10 10 HTML Extraction Language Tree-based data-model Tree-based data-model  HTML 페이지는 labeled tree 로써 표현 (DOM tree 로 변형 )  root, internal node, leaf node 로 구성 extraction rule 은 트리를 따라 nevigation 했을 때의 paths 로 표현 extraction rule 은 트리를 따라 nevigation 했을 때의 paths 로 표현  path extraction 은 항상 텍스트 값을 리턴함 Regular expression 사용 : match, split => 복합 구조 Regular expression 사용 : match, split => 복합 구조 Shady Grove Aeolian Over the River, Charlie Dorian HTMLTree à la DOM

11 11 Using regular expressions We want to extract the % change We want to extract the % change  table.tr[1].td[1].txt, match /[(](.*?)[)]/ We want to extract the day’s range for the stock: We want to extract the day’s range for the stock:  table.tr[2].td[0].txt, match/Day’s Range (.*)/, split /-/ regular expression operators can be used in cascade  Semantics – match /(.....)/ returns a string – match /(...) (...)/ returns a list of strings – split /...../ returns a list of strings

12 12 추출된 정보의 Mapping W4F 는 추출된 정보를 Nested String Lists 로 표현 W4F 는 추출된 정보를 Nested String Lists 로 표현  NSL::null |String |String |list (NSL) |list (NSL)  Leaf nodes 는 스트링을 생성  List 는 인덱스 연산자, forks 연산자에 의해 생성  Invalid paths 는 null 을 생성 NSLs can be manipulated via an API NSLs can be manipulated via an API 상위 레벨의 어플리케이션이 자유롭게 사용할 수 있도록 mapping 이 필요... 상위 레벨의 어플리케이션이 자유롭게 사용할 수 있도록 mapping 이 필요...

13 13 W4F Mappings W4F W4F  자바 기본 데이터 타입 (string, int, float) 과 확장된 배열 등으로 변환  좀 더 복잡한 구조를 사용하고자 할 경우는, 자신의 mapping 정의 XML mapping XML mapping  NSLs 을 어떻게 XML 앨리먼트로 생성할 것인지를 표현  선언적 규칙 (declarative rules) - templates 에 의해 XML mapping 정의  leaves, lists, records 로 이루어진 중첩된 구조  XML templates 의 구조는 extraction rules 과 비슷  Template DTD 추론

14 14 XML Templates Template:= Leaf | Record | List Leaf:=. Tag |. Tag ^ |. Tag ! Tag List:=. Tag Flatten Template Record:=. Tag ( TemplList ) Flatten:= * | * Flatten TemplList:= Template | Template # TemplList Tag := string List Templates List Templates .Portfolio*.templ … … … … Record Templates Record Templates .Stock ( T1 # … # Tn ) … … … … … … </Stock> Leaf Templates Leaf Templates .Ticker <Ticker>IBM</Ticker> .Ticker (.Symbol^ # `stuff ) `stuff `stuff .Ticker !Symbol

15 15 실행 환경 Windows NT 4.0 (SP3) with Java 1.2 Windows NT 4.0 (SP3) with Java 1.2 XML Parser for Java from IBM AlphaWorks XML Parser for Java from IBM AlphaWorks PAT (regular expression package) from Stevesoft PAT (regular expression package) from Stevesoft

16 16 Form Wizard  웹 form 에 대한 retrieval 명령을 사용할 경우 - CGI 프로그램의 URL, Method 종류, 이름, 타입, default 값을 포함한 입력 list 등의 정보 제공

17 17 Extraction Wizard 웹 문서에 대한 extraction 명령 사용 시 - 해당하는 extraction 명령 :”.” 만을 위한 HEL 언어로 구현 최선은 아니지만, good for starting

18 18 GUI support: Applet Wizard Motivation Motivation  all-in-one GUI Retrieval Extraction XML document

19 19 Xwrap 의 특징 두 단계의 코드접근 방식 두 단계의 코드접근 방식  1 단계 : - 상호작용 인터페이스 사용 - 소스에 대한 메타 데이터 knowledge 인코딩 - 정보 추출 규칙을 생성  2 단계 : 1 단계에서 생성된 정보 추출 규칙 + XWRAP 컴포넌트 라이브러 실행 가능한 Wrapper 프로그램 생성 1 단계에서 생성된 정보 추출 규칙 + XWRAP 컴포넌트 라이브러 실행 가능한 Wrapper 프로그램 생성 두 단계 코드 접근 방식의 장점 두 단계 코드 접근 방식의 장점  사용자에게 친근한 인터페이스 제공  정보 추출 의미론과 절차적 wrapper 생성의 분리 - 새로운 추출 규칙이 wrapper 에 점진적으로 통합  micro-feedback 접근방식을 사용

20 20 XWRAP Architecture

21 21 Wrapper generation process Content token nesting hierarchy Structure Analyzer Bookkeeping routine Source-specific XML Generator Error Handler XML_based Content Filter XML store Filter query XML document Source Documents (web page) Wrapper Program The wrapper Generator System XWrap

22 22 XWRAP 의 각 단계 Fetching and Repairing Source Document Generating Parse Tree Information Extraction XML_enabled Wrapper Code Generator Code Testing Software Packaging Extraction Rules Remote Doc. Fetch Rules Enter URLs Wrapper program Bookkeeping XWRAP Error Handler Retrieved source doc Syntatic token parse tree Extraction rule Wrapper Code

23 23 Enter the URL Remote doc. Retrieval component Remote doc. Retrieval component : 주어진 웹 소스로부터 원거리 문서를 어떻게 fetch 해 가지고 오는지를 설명하는 규칙 Remote_Document_Fetch_Rules (XWRAP-weather.noaa.gov) :: GetURL(String location-code) { Protocol : HTTP; Method: GET; URL: http://weather.noaa.gov/cig-bin/currwx.pl?cccc=?loactoin-code;http://weather.noaa.gov/cig-bin/currwx.pl?cccc=?loactoin-code; ParaPattern: location-code, match(K[A-Z]{3}); }

24 24 Fetching a Web page Wrap 하려고하는 웹 페이지 Wrap 하려고 하는 웹 페이지

25 25 Normalization Xwrap 은 fetch 된 웹 페이지를 트리 구조로 normalization (source-specific parser 를 이용해서 ) Xwrap 은 fetch 된 웹 페이지를 트리 구조로 normalization (source-specific parser 를 이용해서 )

26 26 Region Extraction Wizard 중요한 regions 을 구별하기 위한 rules 을 명세화 중요한 regions 을 구별하기 위한 rules 을 명세화 region range : 노드에 대한 tree-path regular expression region range : 노드에 대한 tree-path regular expression

27 27 Region Extraction Rules 자동적으로 region extraction rules 생성 자동적으로 region extraction rules 생성 region range : 노드에 대한 tree-path regular expression region range : 노드에 대한 tree-path regular expression

28 28 Semantic Token Extraction 각 region 에 대한 semantic token 추출 각 region 에 대한 semantic token 추출 token extraction wizard token extraction wizard Token extraction rules 에 대한 semantic

29 29 Hierarchy Structure Extraction 관심 있는 정보의 hierarchy structure 유도 관심 있는 정보의 hierarchy structure 유도 XML template format 으로 구성 XML template format 으로 구성

30 30 모든 extraction rules 실행 가능한 wrapper program 으로 compile 모든 extraction rules 실행 가능한 wrapper program 으로 compile Release the Wrapper

31 31 Web Wrappers (1/2) W4F Xwrap 프로젝트 특 징 장 점 단 점 Wrapper 를 개발할 수 있도록 도와주 는 toolkit - DOM 객체 모델 - 풍부한 nevigation - Nested String Language(NSL) 사용 - 재사용성 두 단계 코드 생성 프레임워크 사용 - user friendly interface - 새로운 추출규칙이 wrapper 생성에 점진적 으로 통합가능 - 정보추출 의미와 절 차적 wrapper 생성 프 로그램의 완전한 분리 - 전문가 필요

32 32 Web Wrappers(2/2) 프로젝트 특 징 장 점 단 점 TSIMMIS logical template- based 접근방식  예제를 통해서 신속하 게 wrappers 를 생성  하나의 소스를 명세화하기 위해 서 다수의 예제 ARIADNE  semi automatic 생성 생성된 wrapper 는 mediator, s/w agent 에 통합 ( XWRAP 과 비슷 )  LEX : 관심 있는 토큰 을 찾기 위해서 사용  YACC : 페이지의 중 첩 구조를 추출하기 위 해서  feedback- 기반의 학습능력을 제공 하지 못함  복잡한 구조의 테이블 이 포함된 웹 페이지를 처리 하지 못함

33 33 참 고 문 헌참 고 문 헌 1. Web Echology: Recycling HTML pages as XML documents using W4F - Arnaud Shuguet, Fabien Azavant -WebDB 99' p.31~p.36 2. XWRAP : An XML_enabled Wrapper Construction System for Web Information Sources - ling Liu, Calton Pu, Wei Han Oregon Graduate Institute of Science and Technology, ACM SIGMod 99' 3. building light-weight wrappers for legacy Web data-source using W4F - international Conference on Very Large Database (VLDB98') 4. WysiWyg Web Wrapper Factory(W4F) - Arnaud Sahuguet, Fabien Azavant - Technical Report 5. Wrapper Generation for Web Accessible Data Sources - Jean-Robert Gruser, Louiqa Raschid, Maria Esther vidal, Laura Bright - University of maryland - CoopIs '98 proceedings 6. http://db.cis.upenn.edu/W4F 7. http://www.cc.gatech.edu/projects/disl/XWRAP/


Download ppt "Wrapper : 프로그래밍 언어 연구실 석사 2 학기, 이 혜 수 - W4F, XWRAP 의 architecture 와 demo 중심으로 데이터베이스 99’2 학기 프로젝트."

Similar presentations


Ads by Google