1 / 15

The Query Language TQL

WebDB Workshop on Web and Data Bases, Madison 2002. The Query Language TQL. Speaker: Giovanni Conforti Joint work with: G. Ghelli, A. Albano, D. Colazzo, P. Manghi, and C. Sartiani Università di Pisa. What is TQL?. Yet another semi-structured data query language

Download Presentation

The Query Language TQL

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. WebDB Workshop on Web and Data Bases, Madison 2002 The Query Language TQL Speaker: Giovanni Conforti Joint work with: G. Ghelli, A. Albano, D. Colazzo, P. Manghi, and C. Sartiani Università di Pisa

  2. What is TQL? • Yet another semi-structured data query language • With classic match-filter-construct query structure • (obviously) It can be used to query XML files • Also capable to express regular path expressions and query on the structure WebDB Workshop on Web and Data Bases, Madison 2002 Giovanni Conforti

  3. Data source Matching structure and filtering Result construction The simplest query from $Bib |= .bib[.book[.year[1991] And .title[$t]]] select title[$t] WebDB Workshop on Web and Data Bases, Madison 2002 Giovanni Conforti

  4. But, what’s the difference?(The Tree Logic) • A tree (forest) unordered data model • Based on a modal tree logic, a variant of the ambient logic that allows: • Easy “declarative” way to express property of forests (such as constraints and types) • Powerful operators (such as quantification, negation and modal recursion) • Both horizontal and vertical primitive operators • Formal and sharp semantics definition WebDB Workshop on Web and Data Bases, Madison 2002 Giovanni Conforti

  5. $Bib = Bib[ Book[title[DB]|…] | Book[title[AI]|…] | … ] The data model Nested forests (multisets) of unordered labelled trees WebDB Workshop on Web and Data Bases, Madison 2002 Giovanni Conforti

  6. How is this logic used?(A different way to extract data) • A tree logic based pattern matching (the binding operation), that allows: • Binding of free variables in formulas • Property checking • Easy generalization from property checking to extraction of pieces of data that satisfy a property • As an example we can infer data structure as a generalization of checking types WebDB Workshop on Web and Data Bases, Madison 2002 Giovanni Conforti

  7. Some TQL primitive operators .L[A]stands for “there is an element labelled l whose content satisfies the subformula A” In tree logic this operator is an abbreviation for L[A]|T L[A] a tree labelled L whose content satisfies A T stands for true and matches every forest A|A’ vertical splitting of the forest into two subforests satisfying the corresponding formulas WebDB Workshop on Web and Data Bases, Madison 2002 Giovanni Conforti

  8. TQL binding and matchingexamples In all these cases the variable$ais bound to“Date”, but in general we can bound in the same formula different variables to different values WebDB Workshop on Web and Data Bases, Madison 2002 Giovanni Conforti

  9. Another simple example from $Bib |= .bib.book[year[1992] | $EveryThingElse ] select BookOf1992[$EveryThingElse] • In this query we show a possible use of the vertical splitting operator • Note that we bound a forest to the variable • In XQuery this kind of queries need external operators WebDB Workshop on Web and Data Bases, Madison 2002 Giovanni Conforti

  10. Label variables to query structure from $Bib |= .bib.book.$tag.first[Serge] select SergeTag[$tag] • Simply finds all tags where the string “Serge” appears inside a element labelled “first” • The reconstruction expression put this values one at time inside a SergeTag element WebDB Workshop on Web and Data Bases, Madison 2002 Giovanni Conforti

  11. Logic operators • Tree logic also includes classic logical operators: • A and A’ , A or A’ , not A • foreach $X. A, exists $X. A • Label comparison • Modal recursion (minimal and maximal fixpoint operators) • Rec $E. A, Maxrec $E. A • Derived (regular path expressions) and dual operators WebDB Workshop on Web and Data Bases, Madison 2002 Giovanni Conforti

  12. Expressing tree properties with formulas WebDB Workshop on Web and Data Bases, Madison 2002 Giovanni Conforti

  13. Expressing types with formulas WebDB Workshop on Web and Data Bases, Madison 2002 Giovanni Conforti

  14. from $Bib |= bib[ !book.$t[T] And foreach $X. Not (.book.$t[$X] | .book.$t[$X])] Select key[$t] From checking to extraction from $Bib |= bib[ !book.title[T] And foreach $X. Not (.book.title[$X] | .book.title[$X])] Select title_is_key WebDB Workshop on Web and Data Bases, Madison 2002 Giovanni Conforti

  15. Conclusions • TQL is a nice “declarative” query language • All queries we have seen and other in the paper are tested on the current implementation • Give a look at it (free download at http://tql.di.unipi.it/tql)  • Its implementation is far from obvious and it is based on a translation into an algebra of table and trees [IFIP TCS 2002] WebDB Workshop on Web and Data Bases, Madison 2002 Giovanni Conforti

More Related