repair of xml documents
play

Repair of XML documents (w.r.t. given DTD) Robert Surwka 1 - PowerPoint PPT Presentation

Repair of XML documents (w.r.t. given DTD) Robert Surwka 1 Outline of the problem Convert given xml such that it


  1. Repair ¡of ¡XML ¡documents (w.r.t. ¡given ¡DTD) Robert ¡Surówka 1

  2. Outline ¡of ¡the ¡problem � ������������������������������ � Convert ¡given ¡xml ¡such ¡that ¡it ¡will ¡be ¡valid ¡w.r.t ¡to ¡ given ¡DTD? � Should ¡the ¡conversion ¡have ¡some ¡other ¡features? � Should ¡it ¡use ¡minimum ¡possible ¡number ¡of ¡operations? � What ¡operations ¡do ¡we ¡allow? ¡How ¡important ¡this ¡ decision ¡is? � ������������������������������������������������ repair? Robert ¡Surówka 2

  3. Why ¡this ¡problem ¡is ¡important? � Integrating ¡XML ¡databases � ����������������������������������� � Putting ¡into ¡existing ¡XML ¡database ¡XML ¡ documents ¡found ¡in ¡the ¡Web � ����������������������������������������� � ������������������������������������������ crawling ¡(to ¡give ¡structure ¡to ¡the ¡data, ¡to ¡make ¡it ¡ more ¡usable ¡ � easier ¡to ¡search ¡through, ¡combine, ¡ aggregate) Robert ¡Surówka 3

  4. Sample ¡repairs A <!ELEMENT ¡A ¡((((A ¡| ¡CC), ¡B)*) ¡| ¡C)> Input ¡ <!ELEMENT ¡B ¡(C)> B document <!ELEMENT ¡C ¡(C?)> C Possible ¡repairs A A A A A B C C B C C C C Robert ¡Surówka 4

  5. Sample ¡repairs <!ELEMENT ¡A ¡((B, ¡(T ¡| ¡F))*)> A <!ELEMENT ¡B ¡(#PCDATA)> Input ¡ <!ELEMENT ¡T ¡(#PCDATA)> document B T F B T F B T F <!ELEMENT ¡F ¡(#PCDATA)> 3n ¡times Even ¡when ¡considering ¡only ¡shorterst ¡repair paths there ¡is ¡2 n of ¡repairs Robert ¡Surówka Robert ¡Surówka 5 5

  6. Operations ¡-­‑ basics A A Add ¡a ¡leaf B C B C D A Delete ¡a ¡ A B C B C leaf D A A Rename ¡a ¡ B C B E node D D Robert ¡Surówka 6

  7. Operations ¡-­‑ subtrees Add ¡a ¡ A A minimal ¡ B C B subtree D E A Delete ¡a ¡ A B C D subtree B D E Robert ¡Surówka Robert ¡Surówka 7 7

  8. Operations ¡-­‑ nodes Add ¡a ¡ A A B E node B C D C D Delete ¡ A A B C D B E D a ¡node E Robert ¡Surówka Robert ¡Surówka 8 8

  9. Operations ¡-­‑ shifts Shift ¡a ¡ A A B C B D E node D E C A Shift ¡a ¡ A B D B C D subtree C E F E F Robert ¡Surówka Robert ¡Surówka Robert ¡Surówka 9 9 9

  10. Sample ¡existing ¡algorithms ����������������� Nobutaka ¡Suzuki PhD ¡dissertation IPSJ ¡Digital ¡Courier ¡Vol. ¡2 May ¡2007 December ¡2006 Operations ¡used: Operations ¡used: -­‑ Add ¡a ¡subtree -­‑ Add ¡a ¡node -­‑ Delete ¡ ¡a ¡subtree -­‑ Delete ¡a ¡node -­‑ Rename ¡a ¡node -­‑ Rename ¡a ¡node Approximate ¡Complexity: Approximate ¡Complexity: O(|t| � (|S| 2 ��� � |R|+|S| � |R| � lg(|S| � |R|))) ¡ ����� 2 w 4 |t| 2 r 2 ) ¡ t � set of nodes of the given tree, S � parameter bounded by size of the DTD, R -­‑ maximum number of siblings in given tree, � -­‑ set of labels in the DTD, w � maximum degree of a node in the given tree, r � maximum length of a regular expression in the DTD Robert ¡Surówka 10

  11. ������������������� 1. We ¡have ¡algorithms ¡that ¡find ¡some ¡shortest ¡repair ¡ path ¡of ¡given ¡XML ¡document. 2. Operations ¡that ¡algorithm ¡allows ¡have ¡a ¡crucial ¡ impact ¡on ¡the ¡repair. ¡ � If ¡2 ¡algorithms ¡have ¡sets ¡of ¡supported ¡operations ¡such ¡that ¡neither ¡ of ¡them ¡includes ¡the ¡other ¡then ¡neither ¡of ¡the ¡algorithms ¡always ¡ finds ¡a ¡shorter ¡repair ¡than ¡the ¡other. 3. Complexity ¡of ¡already ¡known ¡algorithms ¡is ¡ sufficiently ¡fast ¡for ¡most ¡uses. 4. ������������������������������������������� already ¡have? Robert ¡Surówka 11

  12. Understanding ¡an ¡XML ¡document <!ELEMENT ¡Department ¡(Dean?, ¡Employees?)> ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡<!ELEMENT ¡Staff ¡(Name*)> <!ELEMENT ¡Dean ¡(Name?)> <!ELEMENT ¡Faculty ¡(Name*)> <!ELEMENT ¡Employees ¡(Faculty?, ¡Staff?, ¡Name*)> ¡ ¡ ¡<!ELEMENT ¡Name ¡(#PCDATA)> Department Department Dean Employees Employees Foo ������������������������������������������ There ¡is ¡a ¡dean, ¡whose ¡ ������������������������������������������� ��������� Foo ���������� been ¡elected ¡yet) department Robert ¡Surówka 12

  13. An ¡unwelcomed ¡repair ¡ � data ¡corruption <!ELEMENT ¡Department ¡(Dean?, ¡Employees?)> ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡<!ELEMENT ¡Staff ¡(Name*)> <!ELEMENT ¡Dean ¡(Name?)> <!ELEMENT ¡Faculty ¡(Name*)> <!ELEMENT ¡Employees ¡(Faculty?, ¡Staff?, ¡Name*)> ¡ ¡ ¡<!ELEMENT ¡Name ¡(#PCDATA)> Operations: ¡1. ¡Add ¡a ¡node 2. ¡Delete ¡a ¡node 3. ¡Rename ¡a ¡node Department Department Employees Employees Repair Dean Moreover ¡it ¡seems ¡that ¡no ¡matter ¡what ¡ Foo operations ¡algorithm ¡would ¡support, ¡ always ¡a ¡data ¡corruption ¡may ¡happen 13

  14. ������������������������������ ����������������������������������������������������������������������������������� Realization Idea 1. ¡User ¡imposes ¡constraints ¡on ¡ possible ¡repairs ¡(e.g. ¡a ¡constraint ¡ ����������������������������� 1. ¡An ¡appropriate ¡ and ¡any ¡subtree ¡rooted ¡at ¡Dean ¡ constraint ¡language ¡needs ¡ ������������������������������� to ¡be ¡defined. prevent ¡the ¡erroneous ¡repair ¡ 2. ¡A ¡repair ¡algorithm ¡must ¡ from ¡previous ¡example). be ¡developed ¡that ¡would ¡ 2. ¡Repair ¡attempt ¡is ¡undertaken, ¡ be ¡able ¡to ¡work ¡with ¡those ¡ and ¡either ¡valid ¡(w.r.t. ¡given ¡ constraints. constraints) ¡repair ¡is ¡done ¡or ¡ information ¡than ¡no ¡such ¡repair ¡ exists ¡is ¡returned. ¡ ¡ ¡ Robert ¡Surówka 14

  15. Alternative ¡solution A ¡lot ¡of ¡work ¡is ¡done ¡in ¡solving ¡a ¡problem ¡stated ¡like ¡this: ������������������� 1 , ¡update ¡script ¡S ¡changing ¡it ¡to ¡DTD ¡D 2 and ¡XML ¡document ¡Xin ¡D 1 ��������������������������������� 2 � So one could just define some source ����� and edit scripts transforming them to DTD in the database. Then ��������� transformation of given ����� will be far more probable E.g. ¡Nobutaka Suzuki: ¡On ¡Inferring ¡K ¡Optimum ¡Transformations ¡of ¡XML ¡Document ¡ from ¡Update ¡Script ¡to ¡DTD. ¡COMAD ¡2008: ¡210-­‑221 Robert ¡Surówka 15

  16. Choosing ¡language Creating ¡a ¡new ¡ Use ¡an ¡existing ¡ language language: � The ¡language ¡will ¡be ¡well ¡ � Many ¡of ¡users ¡will ¡be ¡ tailored ¡to ¡needs ¡(and ¡ already ¡familiar ¡with ¡the ¡ therefore ¡it ¡may ¡be ¡more ¡ language compact ¡and ¡convenient) � If ¡for ¡our ¡needs ¡some ¡ � More ¡work ¡would ¡be ¡ small ¡tweaks ¡to ¡the ¡ needed ¡to ¡create ¡that ¡ language ¡would ¡be ¡ language ¡as ¡well ¡as ¡tools ¡ needed ¡it ¡may ¡confuse ¡the ¡ for ¡it users � The ¡language ¡can ¡evolve ¡ �������������������������� Robert ¡Surówka 16

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend