Presentation is loading. Please wait.

Presentation is loading. Please wait.

A Graphical Environment to Query XML Data with XQuery

Similar presentations


Presentation on theme: "A Graphical Environment to Query XML Data with XQuery"— Presentation transcript:

1 A Graphical Environment to Query XML Data with XQuery campi@elet.polimi.it

2 TCP/IP Illustrated Stevens W. Addison-Wesley 65.95 Advanced Programming in the Unix... Stevens W. Addison-Wesley 78.99 XML data from the W3C Use Cases

3 XQuery List books published by Addison-Wesley after 1991, including their year and title {for $b in document("www.bn.com/bib.xml")/bib/book where $b/publisher="Addison-Wesley" and $b/@year>1991 return { $b/title } }

4  XQBE, a visual dialect of XQuery inspired by QBE paradigm (Zloof 77).  The availability of simpler XQuery “dialects” could contribute to its success, especially for users with a very limited experience of query languages.  To fit the XML data model, XQBE uses hierarchical structures to denote the data taken in input and generated as output. Such structures are annotated to express selection predicates, while explicit bindings visualize the input/output mappings. XQBE (XQuery By Example)

5 Motivation and design principles XQBE was designed with the objectives of being –intuitive –easy to map directly to XQuery –capable of running on top of any existing XQuery engine XQBE includes most of the expressive power of XPath XQBE allows for arbitrarily deep nesting of XQuery FLWOR expressions XQBE supports the construction of new XML elements and permits to restructure existing documents

6 Visual querying paradigm  The left part describes the data to be matched to construct the result, the right one specifies which parts will be retained in the result, together with (optional) newly generated items.  A vertical line divides the source (left) part from the construct (right) part.  The query has a natural reading order from left to right. Data Flow Data Flow ResultdataSourcedata Bindings

7 XQBE

8 Element projection and renaming For each book in the bibliography, list the title and authors, grouped inside a result element

9 For each book list only the title and the surnames of the authors Element projection and renaming

10 For each book found at both www.bn.com and www.amazon.com, list the title of the book and its price from each source Join between two documents

11 Create a flat list of all the title-author pairs, with each pair enclosed in a result element Document restructuring

12 Make a list of all the books with their title, including the editors only if they are affiliated to CITI Filtering nodes in the construct part

13 List books published by Addison-Wesley after 1991, including their year and title, sorting the retrieved books in lexicographic order Sorting

14 List all the books not published by Addison-Wesley and with an author whose first name is Jack. Rename each of these books in, and only retain the title and the full name of the authors whose first name is Jack Nesting and negation

15 Translation principles A query translates to one XQuery FLWR expression It can be contained into an arbitrary number of node constructors The for clause of the outmost FLWR expression contains a list of variable bindings, each of which corresponds to a binding edge Where clauses have a fixed structure –existential quantifier ( some...satisfies )

16 The tool in action

17 Future works Extend the set of supported core functions and add the capability of querying the document order Specialize XQBE with capabilities specific to some applicative domain –An XQBE for digital libraries Produce the XQBE view of a given XQuery statement

18 Conclusions XQBE is a graphical query language that offers a visual interface to query XML documents. We have presented a prototype that implements our proposed interface and translates graphical queries into XQuery, so that it can be used in conjunction with any XQuery engine.


Download ppt "A Graphical Environment to Query XML Data with XQuery"

Similar presentations


Ads by Google