Xquery

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite & 1 Group

    Xquery - Presentation Transcript

    1. Master 2 ISI CARDOSO Jose & AMZANI Samir
      • Introduction
      • - Présentation Xquery
      • - Structure du langage
      • Modèle de données
      • Type d’expressions
      • - expression de chemin
      • - expression FLOWR
      • - constructeur d’éléments
      • - expression conditionnelles (if then else)
      • - expression d’operateur
      • Conclusion
    2. Présentation: -XQuery est à XML ce que SQL est aux bases de données -XQuery est basé sur l'écriture d'expressions Xpath -Supporté par les SGBD les plus courants Ce n'est pas encore un standard (recommandation W3C) Introduction:
    3. Structure du langage
      • La base du langage est l’expression
      • Plusieurs types d’expressions existent:
      • - Expression de chemin
      • - Constructeur d’élements
      • - Expression FLWR
    4. Modèles de données (XDM)
      • On a besoin d’un modèle de données pour définir la sémantique des expressions XQuery:
      • Le même modèle de donnée de Xpath
      • Séquence : collection ordonnée d’items
      • Item : Une valeur atomique ou un nœud
      • Valeur atomique : instance de type (String, integer…)
      • Nœud : 7 types (élément, attribut, texte, document, commentaire, ordre d’exécution, namespace)
      • Valeur typée : Séquence de valeur atomiques
    5. Modèles de données (XDM) Item Séquence Item Noeud Valeur atomique (0,n)
    6. Utilisation de Xquery
      • Webservices : Extraction d’informations
      • Générer des sommaires de rapports XML
      • XML to XHTML
      • Recherche dans les document Web
      • Web sémantique
    7. Type d’expressions books.xml
      • <bookstore>
      • <book category=&quot;COOKING&quot;>
        • <title lang=&quot;en&quot;>Everyday Italian</title>
        • <author>Giada De Laurentiis</author>
        • <year>2005</year>
        • <price>30.00</price>
      • </book>
      • <book category=&quot;CHILDREN&quot;>
        • <title lang=&quot;en&quot;>Harry Potter</title>
        • <author>J K. Rowling</author>
        • <year>2006</year>
        • <price>29.99</price>
      • </book>
      • <book category=&quot;WEB&quot;>
        • <title lang=&quot;en&quot;>XQuery Kick Start</title>
        • <author>James McGovern</author>
        • <author>Per Bothner</author>
        • <author>Kurt Cagle</author>
        • <author>James Linn</author>
        • <author>Vaidyanathan Nagarajan</author>
        • <year>2003</year> <price>49.99</price>
      • </book>
      • <book category=&quot;WEB&quot;>
      • <title lang=&quot;en&quot;>Learning XML</title>
      • <author>Erik T. Ray</author>
      • <year>2003</year>
      • <price>39.95</price>
      • </book>
      • </bookstore>
    8. Types d’expressions Expression de chemin
      • Basée sur la syntaxe Xpath
        • Titres des chapitres de document books.xml:
          • doc(&quot;books.xml&quot;)/bookstore/book/title
      • <title lang=&quot;en&quot;>Everyday Italian</title>
        • <title lang=&quot;en&quot;>Harry Potter</title>
        • <title lang=&quot;en&quot;>XQuery Kick Start</title>
        • <title lang=&quot;en&quot;>Learning XML</title>
      Permet d’ouvrire le document XML en lecture Collection() : une autre fonction qui Qui permet de se connecter aux bases De données
      • Avec des prédicats
        • Tous les livres avec un prix inférieur à 30 €
          • doc(&quot;books.xml&quot;)/bookstore/book[price<30]
      Types d’expressions Expression de chemin
      • <book category=&quot;CHILDREN&quot;>
          • <title lang=&quot;en&quot;>Harry Potter</title>
          • <author>J K. Rowling</author>
          • <year>2005</year>
          • <price>29.99</price>
      • </book>
    9. Types d’expressions Expression FLWOR
      • FLWOR (For, Let, Where, Order By, Return)
        • Tous les livres triés avec un prix supérieur à 30 €
          • for $x in doc(&quot;books.xml&quot;)/bookstore/book
            • where $x/price>30
            • order by $x/title
            • return $x/title
      <title lang=&quot;en&quot;>Learning XML</title> <title lang=&quot;en&quot;>XQuery Kick Start</title>
      • On peux reconstruire des document XML
        • Le nombre de livres apparus en 2003
          • For $x in document( “ books.xml “)//book
          • let $livre := $b/book
          • where $x/year=2003
          • return <bookset nbbooks= “{count($livre)}“>
          • { $livre/title }
          • </bookset>
      Types d’expressions Expression FLWOR <bookset nbbook=“2”> <title lang=&quot;en&quot;>Learning XML</title> <title lang=&quot;en&quot;>XQuery Kick Start</title> </ bookset >
    10. Types d’expressions If-then-else
      • Tous les livres récents
        • < bookset >
          • { for $x in document( “ books.xml “)//book
          • return
          • if ($x/year = 2006)
          • then
          • <livre recent=‘oui’> { $x/title } </livre>
          • else <livre> { $x/title } </livre>
          • </bookset >
      <bookset> <title recent=“oui”> Everyday Italian </title> <title recent=“oui”>Harry Potter</title> <title lang=&quot;en&quot;>XQuery Kick Start</title> <title lang=&quot;en&quot;>Learning XML</title> </ bookset >
    11. Jointures <authors> <author> <name>Giada De Laurentiis </name> <age>38</age> </author> <author> <name> J K. Rowling </name> <age>63</age> </author> <author> <name> Erik T. Ray </name> <age>48</age> </author> <author> <name> Erik T. Ray </name> <age>86</age> </author> </authors> authors.xml
      • les livres avec l’age des auteurs
      • <books>
      • { FOR $i IN doc(&quot;book.xml&quot;)//book     $j IN doc(&quot;authors.xml&quot;)//author WHERE $j/name = $i/author RETURN
      • <book>
      • <name> { $j/title } </name>
      • <author>{ $j/name }</author>
      • <age> { $j/age } </age>
      • </book>
      • }
      • </books>
    12. Processeurs Xquery
      • XQJ (XQuery API for Java)
        • En développement
        • Analogique avec JDBC
      • OJXQI (Oracle Java
      • SAXON (Java/.NET)
        • processeur XSLT & Xquery
        • Outil standlone (cmd)
    13. Processeurs Xquery XQJ © http://www.xquery.com
    14. Processeurs Xquery XQJ XQConnection conn = XQDS.getConnection(); XQExpression expr = conn.createExpression(); String es = &quot;for $n in fn:doc('catalog.xml')// item return fn:data($n/name)&quot;; XQResultSequence result = expr.executeQuery(es); while (result.next()) { String str = result.getString(); System.out.println(&quot;Product name: &quot; + str); } result.close(); expr.close(); conn.close();

    + samirsamir, 4 years ago

    custom

    3088 views, 1 favs, 3 embeds more stats

    Prsentation de Xquery

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 3088
      • 2975 on SlideShare
      • 113 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 0
    Most viewed embeds
    • 111 views on http://www.amzani.com
    • 1 views on http://64.233.167.104
    • 1 views on http://www.wmaker.net

    more

    All embeds
    • 111 views on http://www.amzani.com
    • 1 views on http://64.233.167.104
    • 1 views on http://www.wmaker.net

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Tags

    Groups / Events