The Query Language TQL - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

The Query Language TQL

Description:

... finds all tags where the string 'Serge' appears inside a element labelled 'first' ... Label comparison. Modal recursion (minimal and maximal fixpoint operators) ... – PowerPoint PPT presentation

Number of Views:34
Avg rating:3.0/5.0
Slides: 16
Provided by: diUn
Category:
Tags: tql | labelled | language | query

less

Transcript and Presenter's Notes

Title: The Query Language TQL


1
The Query Language TQL
WebDB Workshop on Web and Data Bases, Madison 2002
  • 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
The simplest query
from Bib .bib.book.year1991
And .titlet select titlet
WebDB Workshop on Web and Data Bases, Madison 2002
Giovanni Conforti
4
But, whats 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
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
  • .LA stands for there is an element labelled l
    whose content satisfies the subformula A
  • In tree logic this operator is an abbreviation
    for
  • LAT
  • LA a tree labelled L whose content satisfies A
  • T stands for true and matches every forest
  • AA 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
Data source Formula
titleIDB authorDate year1994 authora TitleIDB year1994
titleIDB authorDate year1994 authora T
authorDate authora T
In all these cases the variable a is 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.bookyear1992
  • EveryThingElse
  • select BookOf1992EveryThingElse
  • 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.firstSerge
  • select SergeTagtag
  • 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
Is title mandatory? bibNot .bookNot.titleT Or With path operators .bib!book.titleT
Does title appear twice? .bib.book.titleT .titleT
Is title a key for books? bibforeach X. Not (.book.titleX .book.titleX)
WebDB Workshop on Web and Data Bases, Madison 2002
Giovanni Conforti
13
Expressing types with formulas
Does bib contain only books? bibforeach x. .xT implies xbook
A DTD type formula for book A rec E. A E or A book year title author or editor (publisher or 0) price
Is the source a binary tree? rec Bin. Bin Bin or or 0
WebDB Workshop on Web and Data Bases, Madison 2002
Giovanni Conforti
14
From checking to extraction
  • from Bib bib
  • !book.titleT
  • And foreach X. Not
  • (.book.titleX
  • .book.titleX)
  • 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
Write a Comment
User Comments (0)
About PowerShow.com