TD Master VIM Multimedia – Syst`emes d`informations Corrigé

Transcription

TD Master VIM Multimedia – Syst`emes d`informations Corrigé
TD Master VIM Multimedia – Systèmes d’informations
Corrigé
Services Web Les services Web suivants sont disponibles en ligne :
– S1 : adresse -> idcinema
Étant donnée une adresse en entrée, donne l’identifiant du cinéma le plus proche ;
– S2 : titre -> idfilm
Étant donné un titre de film en entrée, donne son identifiant ;
– S3 : realisateur -> titre
Étant donné un nom de réalisateur en entrée, donne le titre d’un de ses films ;
– S4 : (titre, adresse, heure) -> idseance
Étant donnés un titre de film, une adresse et une heure, donne un identifiant de séance pour voir ce
film à proximité de cette adresse et à partir de cette heure (le jour même) ;
– S5 : (idfilm, idcinema, heure) -> idseance
Étant donnés un identifiant de film, un identifiant de cinéma et une heure, donne un identifiant de
séance pour voir ce film dans ce cinéma et à partir de cette heure (le jour même) ;
– S6 : (idseance, numcartebleu) -> numerobillet
Étant donnés un identifiant de séance et un numéro de carte bleue, donne les informations permettant
de fabriquer un billet de cinéma électronique.
1. On suppose posséder un programme Java appelant le service S1 :
int idcinema=S1.call("21 r Alfred de Musset 21000 DIJON");
Expliquez les différentes étapes effectuées par l’infrastructure Java pour exécuter cette ligne de code ;
2. Connaissant une adresse, un nom de réalisateur, une heure et un numéro de carte bleue, quelles sont
toutes les successions d’appels de services possibles pour obtenir un numerobillet ?
3. Si chaque service a une fiabilité de 1/2, quel est la fiabilité de chaque composition ?
Xquery
Soit les documents suivants, contenus dans le fichier doc/bib.xml, reviews.xml :
<?xml version="1.0" encoding="ISO-8859-1"?>
<bib>
<book year="1994">
<title>TCP/IP Illustrated</title>
<author><last>Stevens</last><first>W.</first></author>
<publisher>Addison-Wesley</publisher>
<price>65.95</price>
</book>
<book year="1992">
<title>Advanced Programming in the Unix environment</title>
<author><last>Stevens</last><first>W.</first></author>
<publisher>Addison-Wesley</publisher>
<price>65.95</price>
</book>
<book year="2000">
<title>Data on the Web</title>
<author><last>Abiteboul</last><first>Serge</first></author>
<author><last>Buneman</last><first>Peter</first></author>
<author><last>Suciu</last><first>Dan</first></author>
<publisher>Morgan Kaufmann Publishers</publisher>
<price>39.95</price>
</book>
<book year="1999">
<title>The Economics of Technology and Content for Digital TV</title>
1
<editor>
<last>Gerbarg</last><first>Darcy</first>
<affiliation>CITI</affiliation>
</editor>
<publisher>Kluwer Academic Publishers</publisher>
<price>129.95</price>
</book>
</bib>
<?xml version="1.0" encoding="ISO-8859-1"?>
<reviews>
<entry>
<title>Data on the Web</title>
<price>34.95</price>
<review>
A very good discussion of semi-structured database
systems and XML.
</review>
</entry>
<entry>
<title>Advanced Programming in the Unix environment</title>
<price>65.95</price>
<review>
A clear and detailed discussion of UNIX programming.
</review>
</entry>
<entry>
<title>TCP/IP Illustrated</title>
<price>65.95</price>
<review>
One of the best books on TCP/IP.
</review>
</entry>
</reviews>
<?xml version="1.0" encoding="ISO-8859-1"?>
<prices>
<book>
<title>Advanced Programming in the Unix environment</title>
<source>www.amazon.com</source>
<price>65.95</price>
</book>
<book>
<title>Advanced Programming in the Unix environment</title>
<source>www.bn.com</source>
<price>65.95</price>
</book>
<book>
<title>TCP/IP Illustrated</title>
<source>www.amazon.com</source>
<price>65.95</price>
</book>
<book>
<title>TCP/IP Illustrated</title>
<source>www.bn.com</source>
<price>65.95</price>
2
</book>
<book>
<title>Data on the Web</title>
<source>www.amazon.com</source>
<price>34.95</price>
</book>
<book>
<title>Data on the Web</title>
<source>www.bn.com</source>
<price>39.95</price>
</book>
</prices>
<chapter>
<title>Data Model</title>
<section>
<title>Syntax For Data Model</title>
</section>
<section>
<title>XML</title>
<section>
<title>Basic Syntax</title>
</section>
<section>
<title>XML and Semistructured Data</title>
</section>
</section>
</chapter>
Donnez les requêtes correspondant aux expressions suivantes :
1. List books published by Addison-Wesley after 1991, including their year and title.
2. Create a flat list of all the title-author pairs, with each pair enclosed in a ”result” element.
3. For each book in the bibliography, list the title and authors, grouped inside a ”result” element.
4. For each author in the bibliography, list the author’s name and the titles of all books by that author,
grouped inside a ”result” element.
5. For each book found at both bn.com and amazon.com, list the title of the book and its price from each
source.
6. For each book that has at least one author, list the title and first two authors, and an empty ”et-al”
element if the book has additional authors.
7. List the titles and years of all books published by Addison-Wesley after 1991, in alphabetic order.
8. Find books in which some element has a tag ending in ”or” and the same element contains the string
”Suciu” (at any level of nesting). For each such book, return the title and the qualifying element.
9. Find all section or chapter titles that contain the word ”XML”, regardless of the level of nesting.
10. In the document ”prices.xml”, find the minimum price for each book, in the form of a ”minprice”
element with the book title asits title attribute.
11. For each book with an author, return the book with its title and authors. For each book with an editor,
return a reference with the book title and the editor’s affiliation.
12. Find pairs of books that have different titles but the same set of authors (possibly in a different order).
13. Declare author function, which, given a book title, returns all authors of this book.
3