Databases and Information Systems
Sie sind hier: Startseite Teaching Lehrangebot Frühere Semester Advanced Database Systems (Sensor Network Databases)

Advanced Database Systems (Sensor Network Databases)

Example XQueries for Testing the Implementation

In the following, we list a couple of example queries, a short explanation of their semantics (informally), and the expected query result on the input documents. If you are you are using the queries and results for testing, cannot verify the results proposed here and suggest that there's something wrong, please let us know about (either using the mailing list or by personal mail).

Example XQueries for Milestone 1

Here you can download the archive containing all queries and the input XML document. Further, for testing purposes there exists an archive containing the expected query results (obtained when evaluating the queries on the XML document that comes with the query archive). Please note that all these resources are also contained in your SVN repository .

Q1 Simple "Hello World" query, no document access. query ]
Q2 Extract all WWW from the document and enclose each document in <page> and </page> tags. query ]
Q3 Extract all titles from the document. query ]
Q4 Return a list of all URLs occurring in the document, followed by a list of all ISBN numbers in the document. query ]
Q5 Return for each proceedings document that has a "series" child its title (assuming that there is at most one series child, otherwise the title would be output several times). query ]
Q6 Return all persons that occur both as author of an incollection and an inproceedings document. If the person appears in multiple combinations (e.g. twice as incollection and once as inproceedings author) then it will be output several times (e.g. twice in the before-mentioned case). query ]
Q7 (formal description omitted, the query was primarily designed to test the implementation) query ]
Q8 For each empty element node in the data with label "pages" output <emptypages>detected</emptypages>. query ]
Q9 For each Masters Thesis in the database output first its title(s) and then the complete "mastersthesis" node. query ]
Q10 For each incollection document in the database create a fresh node with label "incoll". This node has several children, namely <start/>, the title(s) of the incollection, the author(s) of the incollection, and <end/>. query ]
Q11 Same description as Q3 (query uses wildcard node tests). query ]
Q12 Same description as Q6 (query uses wildcard node tests). query ]