針對xml資料之結構化合併的查詢處理與研究 query processing for structural join...

Click here to load reader

Upload: john-mckee

Post on 01-Jan-2016

63 views

Category:

Documents


4 download

DESCRIPTION

針對XML資料之結構化合併的查詢處理與研究 Query Processing for Structural Join against XML Data. 國立台灣海洋大學資訊科學系 指導教授:張雅惠 教授 研 究 生:謝璨隆. 大綱. 動機 問題描述 資料結構與索引 查詢處理 實驗數據 結論與未來工作. 動機. XML 一種樹狀結構的文字資料模型 可自定標籤來描述自身的資料內容 目的 索引內容與結構,以期能加速查詢處理 支援 W3C 所提出的 XPath 以及 XQuery 查詢句. 問題描述. XML 文件 文字檔案 樹狀結構 - PowerPoint PPT Presentation

TRANSCRIPT

  • XMLQuery Processing for Structural Join against XML Data

  • XMLW3CXPathXQuery

  • XMLDTD (Document Type Definition)DTD Tree

  • XML

    27 4 join Twig Joins Bruno Koudas twig Structural Joins Chien Numbering Scheme encode Storing and Querying Viglas Dewey

    ArticleSection

  • OIPVolumeNumberSectionSectionSectionNameArticleArticleSectionNameArticleTitleAuthorAuthorKeywordTitleAuthorKeywordTitleAuthorKeyword274Twig JoinsBrunoKoudastwigjoinStructural JoinsChienencodeStoring and QueryingViglasDeweyNumbering SchemeXML

  • (cont.)DTD TreeOIPVolumeNumberSection*SectionNameArticle*TitleAuthor*DTD Mapping TableKeyword*/OIP/Section/Article/TitleXPath1.-3.-2.1

    OIPVolume1Number2Section-3SectionSectionName1Article-2ArticleTitle1Author-2Keyword-3

  • (cont.)XPathXPathjoin

    OIPSection*SectionNameArticle*TitlejoinTwig Joins

    Structural Joins /OIP/Section[SectionName = join]/Article/Title

  • XML

    join Twig Joins Bruno Koudas twig Structural Joins Chien Numbering Scheme

  • (cont.)XQueryXQueryjoinOIPSection*SectionNameArticle*TitlejoinAuthorFor $s in input()/OIP/Section, $a in $s/ArticleLet $sn = $s/SectionNameWhere $sn/text() = 'join'Return $a/Title $a/Author

  • (cont.)

    Twig Joins Bruno

    Twig Joins Koudas

    Structural Joins Chien

    Twig Joins Bruno Koudas

    Structural Joins Chien

  • (cont.)XML()XMLXMLXPathXQueryXMLXQuery

  • (cont.)ArticleArticleArticleTitleAuthorAuthorTitleAuthorTitleAuthorTwig JoinsBrunoKoudasStructural JoinsChienStoring and QueryingViglasArticle*TitleAuthor*

  • (cont.) (cont.)DTD TreeXML

  • XML(Element ID)EidElement TupleEidElement TupleEidSibling Eid

  • OIPVolumeNumberSectionSectionSectionNameArticleArticleSectionNameArticleTitleAuthorAuthorKeywordTitleAuthorKeywordTitleAuthorKeyword274Twig JoinsBrunoKoudastwigjoinStructural JoinsChienencodeStoring and QueryingViglasDeweyNumbering Scheme

  • 0123(Section)14(Section)45(Article)10(Article)151667 (Author)8(Author)9111213171819Tid | 0 | [1, 2, 3, (-1)] 3 | [4, 5, (14)] 5 | [6, 7, 9, (10)] 7 | [(8)] 8 | [(-1)] 9 | [(-1)]10 | [11, 12, 13, (-1)]12 | [(-1)]13 | [(-1)]14 | [15, 16, (-1)]16 | [17, 18, 19, (-1)]18 | [(-1)]19 | [(-1)]

  • Element Tuple IndexElement Tuple IndexXMLElement TupleGetTuple(DocID, Tid)GetTuple(0, 3) = [4, 5, (14)]Tid | 0 | [1, 2, 3, (-1)] 3 | [4, 5, (14)] 5 | [6, 7, 9, (10)] 7 | [(8)] 8 | [(-1)] 9 | [(-1)]10 | [11, 12, 13, (-1)]12 | [(-1)]13 | [(-1)]14 | [15, 16, (-1)]16 | [17, 18, 19, (-1)]18 | [(-1)]19 | [(-1)]

  • Multiple Element IndexMultiple Element IndexEid()GetME(DocID, Eid)GetME(0, 4) = 3GetME(0, 8) = 5012314451015166789111213171819

  • Pos IndexPos IndexEidXMLEidPI(DocId, Eid)PI(0, 1) = [9, 27]XML927Eid127

  • Document IndexXMLEidDocIndex(ElementName, Keyword)DocIndex(SectionName, join) = {4}3(Section)4(SectionName)join

  • XMLDocument IndexEidQueryDecompositionRetrFromDocIndexMETBuildProjectionRetrievalDTDMapping TableDocument IndexPos indexMultiple Element IndexElement Tuple IndexResult XML Doc

  • (cont.)Supra Gluing Element (SGE)OIPSection*SectionNameArticle*Title/OIP/Section/Article/Title = 1.-3.-2.1/OIP/Section/Section = 1.-3.1SGE/OIP/Section/ = 1.-3SGE

  • XPath ExampleDecompositionOIPSection*SectionNameArticle*TitlejoinOIPSection*Article*Title1.-3.-2.1OIPSection*SectionNamejoin1.-3.1SGE

  • XPath Example cont.RetrFromDocIndex & METBuildOIPSection*SectionNamejoin4DocIndex(SectionName, join)Step 1SGEStep 2GetME(0, 4) = 33Step 3

  • XPath Example cont.ProjectionOIPSection*Article*Title6, 1135SGE/OIP/Section = 1.-3/OIP/Section/Article/Title = 1.-3.-2.1MapPtr = -2, 1GetTuple(0, 3) = [4, 5, (14)]GetTuple(0, 5) = [6, 7, 9, (10)]GetTuple(0, 10) = [11, 12, 13, (-1)]3(Section)14(Section)4(SectionName)15(SectionName)joinencodeStep 2Step 1InitSGE

  • XPath Example cont.Retrievaltitle6, 11PI(0, 6) = [129, 153]PI(0, 11) = [297, 327]XML DocsTwig Joins

    Structural Joins

  • XQuery ExampleDecompositionOIPSection*SectionNameArticle*TitlejoinOIPSection*Article*TitleOIPSection*SectionNamejoinSGEAuthorOIPSection*Article*Author

  • XQuery Example cont.RetrFromDocIndex & METBuildOIPSection*SectionNamejoin4DocIndex(SectionName, join)Step 1SGEStep 2GetME(0, 4) = 33Step 3

  • XQuery Example cont.ProjectionOIPSection*Article*Title33 | [4, 5, (14)]5 | [6, 7, 9, (10)]7 | [(8)]8 | [(-1)]10 | [11, 12, 13, (-1)]12 | [(-1)]14 | [15, 16, (-1)]Author33 53 103 5 63 10 113 5 6 73 5 6 83 10 11 12Section = 1.-3Article = 1.-3.-2Title = 1.-3.-2.1Author = 1.-3.-2.-2

    SectionArticleTitleAuthor

  • XQuery Example cont.RetrievalPI(0, 6) = [129, 153]PI(0, 8) = [164, 185]PI(0, 9) = [196, 218]PI(0, 11) = [297, 327]PI(0, 12) = [338, 359]XML DocsTwig JoinsBrunoKoudasStructural JoinsChien3 5 6 83 5 6 93 10 11 12

    SectionArticleTitleAuthor

  • DTD TreeDTD TreeElement Tuple

  • (cont.)SGE

  • Element TupleXMLXMLXMLElement Tuple//()XQuery

  • Related WorkShu-Yao Chien, Zografoula Vagena, Donghui Zhang, Vassilis J. Tsotras, Carlo Zaniolo, "Efficient Structural Joins on Indexed XML Documents", In Proceedings of the 28th VLDB Conference, Hong Kong, China, 2002Numbering SchemeXMLSibling Pointer

  • Related Work continueNicolas Bruno, Nick Koudas, Divesh Srivastava, "Holistic Twig Joins: Optimal XML Pattern Matching", In Proceedings of ACM SIGMOD, Madison,Wisconsin, USA, 2002.Numbering SchemeXMLXB-treeParent:[8,20], Child_1:[9, 12], Child_2:[29, 36]

    :XML XML XML XMLW3CXPathXQueryXMLDTD TreeXMLDTD Tree XML SectionArticleDTD Mapping Table DTD Tree DTD Mapping TableXPath []XML XPathjoin XPath []XPath SectionNamejoin XPath Title XPathXQueryjoin XQuery []XQuery XPath TitleAuthor TitleAuthor XMLArticleXQuery XML Article []XMLArticle []XML XMLXML XMLXMLXMLXMLXQueryXQuery DTD Tree TitleAuthorDTD TreeArticle [] [] DTD TreeXMLXML XML EidTupleSiblingTuple XML Eid Element Tuple EidXML Element TupleEid3Section 4 Element Tuple4Eid14SectionEid3SectionSibling Eid5Element TupleEid7Author Element TupleElement Tuple IndexElement TupleGetTupleElement TupleDocIDXML DocID0 Eid3Element Tuple GetTuple(0, 3)Multiple Element IndexEidGetME Eid4Eid3Eid8Eid3Multiple Element IndexXMLXML Pos IndexXML PIEid1 PI927 XML927Eid1 Eid1VolumeXML Document IndexEidDocIndexEleNameKeywordEidSectionNamejoin DocIndex(SectionName, join)EidXMLRetrFromDocIndex[] METBuildProjection[]

    XML[]DecompositionXML DTD Mapping TableXPath[]DocIndexEid[]METBuildProjectionXML[]RetrievalDTD Tree SGEDTD Tree/OIP/Section/Article/Title/OIP/Section/Section SGE/OIP/SectionXPath XPathprefixSGE1.-3.-2.11.-3.11.-3 /OIP/SectionXPathXPath DTD Mapping TableXPathSGESectionNamejoin DocIndexEid4SGESection GetME 4SectionEid3

    [] SGE Element Tuple

    [] Element Tuple IndexEid3Tuple 14Sibling [] 14Element TupleTuple2 5Article

    [] Element Tuple IndexEid5Tuple Sibling10 Tuple -1Tuple 611 Title

    SectionNamejoin DocIndexEid4SGESection GetME 4SectionEid3