This document is also available in these non-normative formats: XML.
Copyright © 2014 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved. W3C liability, trademark and document use rules apply.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.
This is a Working Group Note as described in the Process Document. It was developed by the W3C XML Query Working Group, which is part of the XML Activity.
This document provides a number of use cases designed to evaluate XQuery 3.0, the requirements for which are specified in [XQuery 3.0 Requirements].
This document incorporates changes made against the previous publication of the Working Draft. Changes to this document since the previous publication of the Working Draft are detailed in B Change Log.
Please report errors in this document using W3C's public Bugzilla system (instructions can be found at http://www.w3.org/XML/2005/04/qt-bugzilla). If access to that system is not feasible, you may send your comments to the W3C XSLT/XPath/XQuery public comments mailing list<EMAIL_ADDRESS>It will be very helpful if you include the string “[XQuery30UC]” in the subject line of your report, whether made in Bugzilla or in email. Please use multiple Bugzilla entries (or, if necessary, multiple email messages) if you have more than one comment to make. Archives of the comments and responses are available at http://lists.w3.org/Archives/Public/public-qt-comments/.
Publication as a Working Group Note does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
1 Use Cases for XML Query
3.0
2 Shopping Scenario: Schema and Data
2.1 Schema
2.2 Sample
Data
3 Use Case "Group By" - Queries which require
value-based grouping
3.1 Schema and Sample
Data
3.1.1 Schema Q7-Q8
3.1.2 Sample Data Q7-Q8
3.2 Queries and Results
3.2.1 Q1
3.2.2 Q2
3.2.3 Q3
3.2.4 Q4
3.2.5 Q5
3.2.6 Q6
3.2.7 Q7
3.2.8 Q8
4 Use Case "Windowing" - Queries which require
windowing
4.1 Schema and Sample
Data
4.1.1 XML Schema for Q1
4.1.2 Sample Data for Q1
4.1.3 XML Schema for Q2
4.1.4 Sample Data for Q2
4.1.5 XML Schema for Q3
4.1.6 Sample Data for Q3
4.1.7 XML Schema for Q4-Q6
4.1.8 Sample Data for Q4-Q6
4.1.9 XML Schema for Q7-Q13
4.1.10 Sample Data for Q7-Q13
4.1.11 XML Schema for Q14-Q16
4.1.12 Sample Data for Q14-Q16
4.1.13 XML Schema for Q17-Q19
4.1.14 Sample Data for Q17-Q19
4.2 Queries and Results
4.2.1 Q1
4.2.2 Q2
4.2.3 Q3
4.2.4 Q4
4.2.5 Q5
4.2.6 Q6
4.2.7 Q7
4.2.8 Q8
4.2.9 Q9
4.2.10 Q10
4.2.11 Q11
4.2.12 Q12
4.2.13 Q13
4.2.14 Q14
4.2.15 Q15
4.2.16 Q16
4.2.17 Q17
4.2.18 Q18
4.2.19 Q19
5 Use Case "Count" - Queries which
require output numbering
5.1 Schema and Sample
Data
5.2 Queries and Results
5.2.1 Q1
5.2.2 Q2
5.2.3 Q3
6 Use Case "Outer For" - Queries which
require outer joins
6.1 Schema and Sample
Data
6.2 Queries and
Results
6.2.1 Q1
6.2.2 Q2
7 Use Case "Try-Catch" - Queries
which require to recover from errors
7.1 Sample
Data
7.2 Queries and
Results
7.2.1 Q1
7.2.2 Q2
7.2.3 Q3
A Acknowledgements
(Non-Normative)
B Change Log (Non-Normative)
B.1 30 Mar
2011
B.2 30 January
2008
B.3 17 November
2008
C References (Non-Normative)
The use cases listed below were created by the XML Query Working Group to illustrate important applications for the new features in XQuery 3.0. Each use case is focused on a specific application area, and contains a XML Schema and example input data. Each use case specifies a set of queries that might be applied to the input data, and the expected results for each query. Since the English description of each query is concise, the expected results form an important part of the definition of each query, specifying the expected output format.
Most of the listed use cases are based on a simple shopping scenario described in section Schema and Data. Use cases which require special data have a seperate subsection describing the XML Schema and input data. All use cases assume that input is provided in the form of one or more documents with specific names. For instance, the products in a document may be accessed with expressions like this:
doc("products.xml")//product
Several implementors have asked us to make the queries from these use cases available in a separate file in order to make it easier for them to test their parsers. These queries may be found in [Use Case Sample Queries]
To make output more readable, the output of queries has been formatted using whitespace which may not be returned by a query processor. This whitespace should not be considered normative for the correctness of results.
These queries were tested with a dynamic implementation of XQuery. Some queries may require additional type declarations to be used with an implementation that implements the Static Typing feature.
If not stated otherwise all use cases in this document are based on a simplified shopping scenario containing three documents. The first document, products.xml, contains a list of products, whereas stores.xml includes a list of stores, and sales-records.xml contains the list of sales.
The document product.xml uses the following XML Schema:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="products"> <xs:complexType> <xs:sequence> <xs:element name="product" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="category" type="xs:string"/> <xs:element name="price" type="xs:double"/> <xs:element name="cost" type="xs:double"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
The sales-records.xml document follows this XML Schema:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="sales"> <xs:complexType> <xs:sequence> <xs:element name="record" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="product-name" type="xs:string"/> <xs:element name="store-number" type="xs:integer"/> <xs:element name="qty" type="xs:integer"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
The stores.xml document is valid to this XML Schema:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="stores"> <xs:complexType> <xs:sequence> <xs:element name="store" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="store-number" type="xs:byte"/> <xs:element name="state" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
The content of the document products.xml is:
<products> <product> <name>broiler</name> <category>kitchen</category> <price>100</price> <cost>70</cost> </product> <product> <name>toaster</name> <category>kitchen</category> <price>30</price> <cost>10</cost> </product> <product> <name>blender</name> <category>kitchen</category> <price>50</price> <cost>25</cost> </product> <product> <name>socks</name> <category>clothes</category> <price>5</price> <cost>2</cost> </product> <product> <name>shirt</name> <category>clothes</category> <price>10</price> <cost>3</cost> </product> </products>
The content of sales-records.xml is:
<sales> <record> <product-name>broiler</product-name> <store-number>1</store-number> <qty>20</qty> </record> <record> <product-name>toaster</product-name> <store-number>2</store-number> <qty>100</qty> </record> <record> <product-name>toaster</product-name> <store-number>2</store-number> <qty>50</qty> </record> <record> <product-name>toaster</product-name> <store-number>3</store-number> <qty>50</qty> </record> <record> <product-name>blender</product-name> <store-number>3</store-number> <qty>100</qty> </record> <record> <product-name>blender</product-name> <store-number>3</store-number> <qty>150</qty> </record> <record> <product-name>socks</product-name> <store-number>1</store-number> <qty>500</qty> </record> <record> <product-name>socks</product-name> <store-number>2</store-number> <qty>10</qty> </record> <record> <product-name>shirt</product-name> <store-number>3</store-number> <qty>10</qty> </record> </sales>
The content of stores.xml is:
<stores> <store> <store-number>1</store-number> <state>CA</state> </store> <store> <store-number>2</store-number> <state>CA</state> </store> <store> <store-number>3</store-number> <state>MA</state> </store> <store> <store-number>4</store-number> <state>WA</state> </store> </stores>
This use case contains several sample queries in which value based grouping is needed.
Queries 1-6 are based on a simplified shop scenario with products, sales records and different shop locations. The schema and data can be found in section Schema and Data. Queries 7 and 8 are based on a bibliography document shown below:
Q7 and Q8 use an input document named "books.xml", with the following XML Schema:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="bib"> <xs:complexType> <xs:sequence> <xs:element name="book" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="author" type="xs:string" maxOccurs="unbounded"/> <xs:element name="title" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
Here are the contents of books.xml:
<bib> <book> <author>Jim Melton</author> <author>Alan Simon</author> <title>SQL:1999</title> </book> <book> <author>Jim Melton</author> <title>Advanced SQL:1999</title> </book> <book> <author>Alan Simon</author> <title>Strategic Database Technology</title> </book> <book> <author>Jim Melton</author> <author>Andrew Eisenberg</author> <title>Understanding SQL and Java Together</title> </book> <book> <author>Jim Melton</author> <author>Stephen Buxton</author> <title>Querying XML</title> </book> </bib>
Group sales by product, list name and total quantity of each product.
Solution in XQuery:
<sales-qty-by-product>{ for $sales in doc("sales-records.xml")/*/record let $pname := $sales/product-name group by $pname order by $pname return <product name="{$pname}">{ sum($sales/qty) }</product> }</sales-qty-by-product>
Expected Result:
<sales-qty-by-product> <product name="blender">250</product> <product name="broiler">20</product> <product name="shirt">10</product> <product name="socks">510</product> <product name="toaster">200</product> </sales-qty-by-product>
Group sales by state (a property of the store) and category (a property of the product). Order groups by the grouping keys. For each group, show the total quantity sold.
Solution in XQuery:
<result>{ for $sales in doc("sales-records.xml")/*/record let $state := doc("stores.xml")/*/store[store-number = $sales/store-number]/state let $category := doc("products.xml")/*/product[name = $sales/product-name]/category group by $state, $category order by $state, $category return <group> <state>{$state}</state> <category>{$category}</category> <total-qty>{sum($sales/qty)}</total-qty> </group> }</result>
Expected Result:
<result> <group> <state>CA</state> <category>clothes</category> <total-qty>510</total-qty> </group> <group> <state>CA</state> <category>kitchen</category> <total-qty>170</total-qty> </group> <group> <state>MA</state> <category>clothes</category> <total-qty>10</total-qty> </group> <group> <state>MA</state> <category>kitchen</category> <total-qty>300</total-qty> </group> </result>
Group sales by state (a property of the store) and category (a property of the product). Order groups by the grouping keys. For each group, show the total revenue (defined as sales/qty * product/price).
Solution in XQuery:
<result>{ for $sales in doc("sales-records.xml")/*/record let $state := doc("stores.xml")/*/store[store-number = $sales/store-number]/state, $product := doc("products.xml")/*/product[name = $sales/product-name], $category := $product/category, $revenue := $sales/qty * $product/price group by $state, $category order by $state, $category return <group> <state>{$state}</state> <category>{$category}</category> <total-revenue>{sum($revenue)}</total-revenue> </group> }</result>
Expected Result:
<result> <group> <state>CA</state> <category>clothes</category> <total-revenue>2550</total-revenue> </group> <group> <state>CA</state> <category>kitchen</category> <total-revenue>6500</total-revenue> </group> <group> <state>MA</state> <category>clothes</category> <total-revenue>100</total-revenue> </group> <group> <state>MA</state> <category>kitchen</category> <total-revenue>14000</total-revenue> </group> </result>
Combine the input documents into a three-level hierarchy based on state, category, and product. At the product level, show the total quantity sold of each product. List items alphabetically at each level of the hierarchy.
Solution in XQuery:
<result>{ for $store in doc("stores.xml")/*/store let $state := $store/state group by $state order by $state return <state name="{$state}">{ for $product in doc("products.xml")/*/product let $category := $product/category group by $category order by $category return <category name="{$category}">{ for $sales in doc("sales-records.xml")/*/record[store-number = $store/store-number and product-name = $product/name] let $pname := $sales/product-name group by $pname order by $pname return <product name="{$pname}" total-qty="{sum($sales/qty)}" /> }</category> }</state> }</result>
Expected Result:
<result> <state name="CA"> <category name="clothes"> <product name="socks" total-qty="510"/> </category> <category name="kitchen"> <product name="broiler" total-qty="20"/> <product name="toaster" total-qty="150"/> </category> </state> <state name="MA"> <category name="clothes"> <product name="shirt" total-qty="10"/> </category> <category name="kitchen"> <product name="blender" total-qty="250"/> <product name="toaster" total-qty="50"/> </category> </state> </result>
List all stores in ascending order by store number. For each store, list the products sold in that store, in descending order by quantity sold. Illustrates ordering among and within groups.
Solution in XQuery:
<result>{ for $sales in doc("sales-records.xml")/*/record let $storeno := $sales/store-number group by $storeno order by $storeno return <store number = "{$storeno}">{ for $s in $sales order by xs:int($s/qty) descending return <product name = "{$s/product-name}" qty = "{$s/qty}"/> }</store> }</result>
Expected Result:
<result> <store number="1"> <product name="socks" qty="500"/> <product name="broiler" qty="20"/> </store> <store number="2"> <product name="toaster" qty="100"/> <product name="toaster" qty="50"/> <product name="socks" qty="10"/> </store> <store number="3"> <product name="blender" qty="150"/> <product name="blender" qty="100"/> <product name="toaster" qty="50"/> <product name="shirt" qty="10"/> </store> </result>
List all stores whose total profit is greater than 100, in descending order by total profit. Note: total profit for a store is the sum over all sales in that store, of the quantity sold times the difference between price and cost for the item sold. Illustrates cross-document computation, filtering of groups, ordering by a non-grouping key.
Solution in XQuery:
<result>{ for $sales in doc("sales-records.xml")/*/record let $storeno := $sales/store-number, $product := doc("products.xml")/*/product[name = $sales/product-name], $prd := $product, $profit := $sales/qty * ($prd/price - $prd/cost) group by $storeno let $total-store-profit := sum($profit) where $total-store-profit > 100 order by $total-store-profit descending return <store number = "{$storeno}" total-profit = "{$total-store-profit}"/> }</result>
Expected Result:
<result> <store number="3" total-profit="7320"/> <store number="2" total-profit="3030"/> <store number="1" total-profit="2100"/> </result>
Group books by author. Create a group for each individual author. A book with multiple authors should appear in the groups for each of its authors. Alphabetize the authors and the book titles within each author group.
Solution in XQuery:
<result>{ for $book in doc("books.xml")/*/book for $author in $book/author group by $author order by $author return <author name="{$author}">{ for $b in $book order by $b/title return <title> {fn:data($b/title)} </title> }</author> }</result>
Expected Result:
<result> <author name="Alan Simon"> <title>SQL:1999</title> <title>Strategic Database Technology</title> </author> <author name="Andrew Eisenberg"> <title>Understanding SQL and Java Together</title> </author> <author name="Jim Melton"> <title>Advanced SQL:1999</title> <title>Querying XML</title> <title>SQL:1999</title> <title>Understanding SQL and Java Together</title> </author> <author name="Stephen Buxton"> <title>Querying XML</title> </author> </result>
Group books by author. Create a group for each distinct ordered list of authors. Each book should be grouped with other books that have the same ordered list of authors. Alphabetize the book titles within each group.
Solution in XQuery:
<result>{ for $book in doc("books.xml")/*/book let $author-list := fn:string-join($book/author, ', ') group by $author-list order by $author-list return <author-list names="{$author-list}">{ for $b in $book order by $b/title return <title> {fn:data($b/title)} </title> }</author-list> }</result>
Expected Result:
<result> <author-list names="Alan Simon"> <title>Strategic Database Technology</title> </author-list> <author-list names="Jim Melton"> <title>Advanced SQL:1999</title> </author-list> <author-list names="Jim Melton, Alan Simon"> <title>SQL:1999</title> </author-list> <author-list names="Jim Melton, Andrew Eisenberg"> <title>Understanding SQL and Java Together</title> </author-list> <author-list names="Jim Melton, Stephen Buxton"> <title>Querying XML</title> </author-list> </result>
This use case covers queries that require windowing or positional grouping, which can be seen as a special form of windowing. Windowing means that the queries require selecting subsequences based on certain characterisics of an underlying sequence.
Windowing is required in various scenarios from formatting up to streaming applications. The listed queries try to cover different scenarios and require therefore also various types of input data. The following sections describe for every query the used data and the according schema.
Q1 uses an input document named arrange_rows.xml, with the following XML Schema arrange_rows.xsd:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="doc"> <xs:complexType> <xs:sequence> <xs:element name="data" type="xs:string" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
The content of arrange_rows.xml is:
<doc> <data>Green</data> <data>Pink</data> <data>Lilac</data> <data>Turquoise</data> <data>Peach</data> <data>Opal</data> <data>Champagne</data> </doc>
Q2 uses an input document named head_para.xml, with the following XML Schema named head_para.xsd:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="body"> <xs:complexType> <xs:sequence> <xs:sequence maxOccurs="unbounded"> <xs:element name="h2" type="xs:string"/> <xs:element name="p" type="xs:string" maxOccurs="unbounded"/> </xs:sequence> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
The content of head_para.xml is:

heading1

para1

para2

heading2

para3

para4

para5

Q3 uses an input document named term_def_list.xml, with the following XML Schema named term_def_list.xsd:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="doc"> <xs:complexType> <xs:sequence> <xs:sequence maxOccurs="unbounded"> <xs:element name="dt" type="xs:string" maxOccurs="unbounded"/> <xs:element name="dd" type="xs:string" maxOccurs="unbounded"/> </xs:sequence> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
The content of term_def_list.xml is:
<doc>
XML

Extensible Markup Language

XSLT

XSL Transformations

A language for transforming XML

A specification produced by W3C
 </doc>
Q4 - Q6 use an input document named temp_events.xml, with the following XML Schema named temp_events.xsd:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="stream"> <xs:complexType> <xs:sequence> <xs:element name="event" maxOccurs="unbounded"> <xs:complexType> <xs:attribute name="time" type="xs:integer" use="required"/> <xs:attribute name="temp" type="xs:double" use="required"/> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
The content of temp_events.xml is:
<stream> <event temp="10" time="1"/> <event temp="8" time="2"/> <event temp="6" time="3"/> <event temp="13" time="4"/> <event temp="32" time="5"/> <event temp="9" time="6"/> <event temp="10" time="7"/> </stream>
Q7 - Q13 use an input document named person_events.xml, with the following XML Schema named person_events.xsd:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="stream"> <xs:complexType> <xs:sequence> <xs:element name="event" maxOccurs="unbounded"> <xs:complexType> <xs:sequence minOccurs="0"> <xs:element name="person" type="xs:string"/> <xs:element name="direction" type="xs:string"/> </xs:sequence> <xs:attribute name="time" type="xs:dateTime" use="required"/> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
The content of person_events.xml is:
<stream> <event time="2006-01-01T01:00:00-00:00"/> <event time="2006-01-01T10:30:00-00:00"> <person>Anton</person> <direction>in</direction> </event> <event time="2006-01-01T11:00:00-00:00"> <person>Barbara</person> <direction>in</direction> </event> <event time="2006-01-01T11:15:00-00:00"> <person>Clara</person> <direction>in</direction> </event> <event time="2006-01-01T12:15:00-00:00"> <person>Clara</person> <direction>out</direction> </event> <event time="2006-01-01T14:00:00-00:00"> <person>Barbara</person> <direction>out</direction> </event> <event time="2006-01-01T15:00:00-00:00"> <person>Anton</person> <direction>out</direction> </event> <event time="2006-01-01T23:00:00-00:00"/> <event time="2006-01-02T01:00:00-00:00"/> <event time="2006-01-02T11:00:00-00:00"> <person>Anton</person> <direction>in</direction> </event> <event time="2006-01-02T12:00:00-00:00"> <person>Clara</person> <direction>in</direction> </event> <event time="2006-01-02T12:10:00-00:00"> <person>Clara</person> <direction>out</direction> </event> <event time="2006-01-02T12:15:00-00:00"> <person>Clara</person> <direction>in</direction> </event> <event time="2006-01-02T12:20:00-00:00"> <person>Clara</person> <direction>out</direction> </event> <event time="2006-01-02T12:25:00-00:00"> <person>Clara</person> <direction>in</direction> </event> <event time="2006-01-02T12:40:00-00:00"> <person>Clara</person> <direction>out</direction> </event> <event time="2006-01-02T14:00:00-00:00"> <person>Clara</person> <direction>in</direction> </event> <event time="2006-01-02T16:00:00-00:00"> <person>Anton</person> <direction>out</direction> </event> <event time="2006-01-02T16:15:00-00:00"> <person>Clara</person> <direction>out</direction> </event> <event time="2006-01-02T23:00:00-00:00"/> </stream>
Q14 - Q16 use as input document a slightly modified RSS document named rss.xml. It mainly differs from RSS 2.0 in the way dates are expressed in the data. The XML Schema, rss.xsd, is as follows:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="rss"> <xs:complexType> <xs:sequence> <xs:element name="channel"> <xs:complexType> <xs:sequence> <xs:element name="title" type="xs:string"/> <xs:element name="link" type="xs:anyURI"/> <xs:element name="description" type="xs:string"/> <xs:element name="language" type="xs:string"/> <xs:element ref="item" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="item"> <xs:complexType> <xs:sequence> <xs:element name="title" type="xs:string"/> <xs:element name="category" type="xs:string"/> <xs:element name="author" type="xs:string"/> <xs:element name="pubDate" type="xs:dateTime"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
The content of rss.xml is:
<rss> <channel> <title>DBIS RSS</title> <link>http://www.dbis.ethz.ch</link> <description>The windowing dummy RSS.</description> <language>en-us</language> <item> <title>Why use cases are important Part 1.</title> <category>Workshop</category><EMAIL_ADDRESS><pubDate>2003-06-03T09:00:00</pubDate> </item> <item> <title>Why use cases are important Part 2.</title> <category>Workshop</category><EMAIL_ADDRESS><pubDate>2003-06-03T09:00:00</pubDate> </item> <item> <title>Why use cases are important Part 3.</title> <category>Workshop</category><EMAIL_ADDRESS><pubDate>2003-06-03T10:00:00</pubDate> </item> <item> <title>Extending XQuery with Window Functions</title> <category>Talk</category><EMAIL_ADDRESS><pubDate>2003-06-03T11:00:00</pubDate> </item> <item> <title>XQueryP: A new programming language is born</title> <category>Talk</category><EMAIL_ADDRESS><pubDate>2003-06-03T12:00:00</pubDate> </item> <item> <title>Why use cases are annoying to write.</title> <category>Talk</category><EMAIL_ADDRESS><pubDate>2003-06-04T10:00:00</pubDate> </item> </channel> </rss>
Q17-Q19 use an input document named cxml.xml. The structure of this document is inspired by the Commerce XML Resource standard (cXML). The document contains a sequence of events, where an event corresponds to a simplified message of the cXML standard or an timeclock event. The XML Schema with the file-name cxml.xsd is as follows:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="sequence"> <xs:complexType> <xs:sequence> <xs:choice maxOccurs="unbounded"> <xs:element name="time" type="TimeEvent"/> <xs:element name="OrderRequest" type="OrderRequest" maxOccurs="unbounded"/> <xs:element name="ConfirmationRequest" type="ConfirmationRequest"/> <xs:element name="ShipNotice" type="ShipNotice" maxOccurs="unbounded"/> </xs:choice> </xs:sequence> </xs:complexType> </xs:element> <xs:complexType name="TimeEvent"> <xs:attribute name="date" type="xs:dateTime" use="required"/> </xs:complexType> <xs:complexType name="OrderRequest"> <xs:sequence> <xs:element name="Item" maxOccurs="unbounded"> <xs:complexType> <xs:attribute name="unitPrice" type="xs:byte" use="required"/> <xs:attribute name="quantity" type="xs:byte" use="required"/> <xs:attribute name="partID" type="xs:string" use="required"/> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="type" type="xs:string" use="required"/> <xs:attribute name="total" type="xs:short" use="required"/> <xs:attribute name="shipTo" type="xs:string"/> <xs:attribute name="orderID" type="xs:string" use="required"/> <xs:attribute name="date" type="xs:dateTime" use="required"/> <xs:attribute name="billTo" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="ConfirmationRequest"> <xs:attribute name="status" type="xs:string" use="required"/> <xs:attribute name="orderID" type="xs:string" use="required"/> <xs:attribute name="date" type="xs:dateTime" use="required"/> <xs:attribute name="confirmID" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="ShipNotice"> <xs:attribute name="orderID" type="xs:string" use="required"/> <xs:attribute name="date" type="xs:dateTime" use="required"/> </xs:complexType> </xs:schema>
The content of cxml.xml is:
<sequence> <time date="2006-01-01T00:00:00-00:00"/> <OrderRequest billTo="ACME1" date="2006-01-01T10:00:00-00:00" orderID="OID01" shipTo="ACME1" total="1100" type="new"> <Item partID="ID1" quantity="10" unitPrice="100"/> <Item partID="ID2" quantity="10" unitPrice="10"/> </OrderRequest> <OrderRequest billTo="ACME2" date="2006-01-01T11:00:00-00:00" orderID="OID02" total="100" type="new"> <Item partID="ID2" quantity="10" unitPrice="10"/> </OrderRequest> <ConfirmationRequest confirmID="C1" date="2006-01-01T18:00:00-00:00" orderID="OID02" status="reject"/> <time date="2006-01-02T00:00:00-00:00"/> <ConfirmationRequest confirmID="C1" date="2006-01-02T08:00:00-00:00" orderID="OID01" status="accept"/> <OrderRequest billTo="ACME1" date="2006-01-02T14:00:00-00:00" orderID="OID03" shipTo="ACME1" total="10000" type="new"> <Item partID="ID3" quantity="100" unitPrice="100"/> </OrderRequest> <ConfirmationRequest confirmID="C1" date="2006-01-02T16:00:00-00:00" orderID="OID03" status="accept"/> <time date="2006-01-03T00:00:00-00:00"/> <time date="2006-01-04T00:00:00-00:00"/> <time date="2006-01-05T00:00:00-00:00"/> <ShipNotice date="2006-01-05T08:00:00-00:00" orderID="OID01"/> <ShipNotice date="2006-01-05T09:00:00-00:00" orderID="OID03"/> <time date="2006-01-06T00:00:00-00:00"/> <OrderRequest billTo="ACME2" date="2006-01-06T08:00:00-00:00" orderID="OID04" total="100" type="new"> <Item partID="ID2" quantity="10" unitPrice="10"/> </OrderRequest> <time date="2006-01-07T00:00:00-00:00"/> </sequence>
Arrange a sequence of items as a table with three columns (using as many rows as necessary).
Solution in XQuery:
declare variable $seq := fn:doc("arrange_rows.xml");
{ for tumbling window $w in $seq/doc/* start at $x when fn:true() end at $y when $y - $x = 2 return
{ for $i in $w return {data($i)}	 }
 }

Expected Result:

 Green	 Pink	 Lilac

 Turquoise	 Peach	 Opal

 Champagne

Convert a structure with implicit sections to a structure with explicit sections.
Solution in XQuery:
declare variable $seq := fn:doc("head_para.xml"); <chapter>{ for tumbling window $w in $seq/body/* start previous $s when $s[self::h2] end next $e when $e[self::h2] return
{ for $x in $w return <para>{data($x)}</para> }
 }</chapter>
Expected Result:
<chapter>
 <para>para1</para> <para>para2</para>

 <para>para3</para> <para>para4</para> <para>para5</para>
 </chapter>
Within a glossary in HTML, a defined term
 can be followed by a definition
. The task is to group these together within a <term> element, where a group can consist of one or more
 elements followed by one or more
 elements.
Solution in XQuery:
declare variable $seq := fn:doc("term_def_list.xml"); <doc>{ for tumbling window $w in $seq/doc/* start $x when $x[self::dt] end $y next $z when $y[self::dd] and $z[self::dt] return <term>{ $w }</term> }</doc>
Expected Result:
<doc> <term>
XML

Extensible Markup Language
 </term> <term>
XSLT

XSL Transformations

A language for transforming XML

A specification produced by W3C
 </term> </doc>
Calculate the moving average of temperature values for the 3 last seconds.
Solution in XQuery:
declare variable $timesequence := fn:doc("temp_events.xml"); let $MAX_DIFF := 2 for sliding window $w in $timesequence/stream/event start $s_curr at $s_pos previous $s_prev when ($s_curr/@time ne $s_prev/@time) or (empty($s_prev)) only end next $e_next when $e_next/@time - $s_curr/@time gt $MAX_DIFF return avg( $w/@temp )
Expected Result:
8 9 17 18
Single exponential smoothing (3 last values and smoothing factor 0.2)
Solution in XQuery:
declare variable $timesequence := fn:doc("temp_events.xml"); let $SMOOTH_CONST := 0.2 for sliding window $w in $timesequence/stream/event start at $s_pos when true() only end at $e_pos when $e_pos - $s_pos eq 2 return round-half-to-even($SMOOTH_CONST * data($w[3]/@temp) + (1 - $SMOOTH_CONST) * ( $SMOOTH_CONST * data($w[2]/@temp) + (1 - $SMOOTH_CONST) * data($w[1]/@temp) ), 2)
Expected Result:
8.88 8.68 12.32 15.24 23.92
Detect outliers (current value is two times higher (lower) than the average of the previous three values) in a sequence of temp values.
Solution in XQuery:
declare variable $seq := fn:doc("temp_events.xml"); for sliding window $w in $seq/stream/event start $s_curr when fn:true() only end next $next when $next/@time > $s_curr/@time + 3 return let $avg := fn:avg($w/@temp) where $avg * 2 lt xs:double($next/@temp) or $avg div 2 gt xs:double($next/@temp) return <alarm>Outlier detected. Event id:{data($next/@time)}</alarm>
Expected Result:
<alarm>Outlier detected. Event id:5</alarm>
Notify when Barbara enters the building within 1 hour after Anton
Solution in XQuery:
declare variable $seq := fn:doc("person_events.xml"); <result>{ for tumbling window $w in $seq/stream/event start $s when $s/person eq "Anton" and $s/direction eq "in" only end $e next $n when xs:dateTime($n/@time) - xs:dateTime($s/@time) gt xs:dayTimeDuration("PT1H") or ($e/person eq "Barbara" and $e/direction eq "in") or ($e/person eq "Anton" and $e/direction eq "out") where $e/person eq "Barbara" and $e/direction eq "in" return <warning time="{ $e/@time }">Barbara: Anton arrived 1h ago</warning> }</result>
Expected Result:
<result> <warning time="2006-01-01T11:00:00-00:00">Barbara: Anton arrived 1h ago</warning> </result>
Measure the working time of each person
Solution in XQuery:
declare variable $seq := fn:doc("person_events.xml"); <result>{ for sliding window $w in $seq/stream/event start $s when $s/direction eq "in" only end $e when $s/person eq $e/person and $e/direction eq "out" return <working-time> {$s/person} <time>{ xs:dateTime($e/@time) - xs:dateTime($s/@time)}</time> </working-time> }</result>
Expected Result:
<result> <working-time> <person>Anton</person> <time>PT4H30M</time> </working-time> <working-time> <person>Barbara</person> <time>PT3H</time> </working-time> <working-time> <person>Clara</person> <time>PT1H</time> </working-time> <working-time> <person>Anton</person> <time>PT5H</time> </working-time> <working-time> <person>Clara</person> <time>PT10M</time> </working-time> <working-time> <person>Clara</person> <time>PT5M</time> </working-time> <working-time> <person>Clara</person> <time>PT15M</time> </working-time> <working-time> <person>Clara</person> <time>PT2H15M</time> </working-time> </result>
Measure the overall working time for each person.
Solution in XQuery:
declare variable $seq := fn:doc("person_events.xml"); <result>{ for sliding window $w in $seq/stream/event start $s when $s/direction eq "in" only end $e when $s/person eq $e/person and $e/direction eq "out" let $person := $s/person let $workingTime := xs:dateTime($e/@time) - xs:dateTime($s/@time) group by $person order by $person return <working-time> <person>{ $person }</person> <time>{ sum($workingTime) }</time> </working-time> }</result>
Expected Result:
<result> <working-time> <person>Anton</person> <time>PT9H30M</time> </working-time> <working-time> <person>Barbara</person> <time>PT3H</time> </working-time> <working-time> <person>Clara</person> <time>PT3H45M</time> </working-time> </result>
Display a warning if Barbara does not come to work.
Solution in XQuery:
declare variable $seq := fn:doc("person_events.xml"); <result>{ for tumbling window $w in $seq/stream/event[direction eq "in"] start $s when fn:true() end next $e when xs:date( xs:dateTime($s/@time) ) ne xs:date( xs:dateTime($e/@time) ) let $date := xs:date(xs:dateTime($s/@time)) where not($w[person eq "Barbara"]) return <alert date="{ $date }">Barbara did not come to work</alert> }</result>
Expected Result:
<result> <alert date="2006-01-02Z">Barbara did not come to work</alert> </result>
Identify every person who enters the building before Clara withing a 15 minute timeframe (Clara's arrival time - 15 minutes).
Solution in XQuery:
declare variable $seq := fn:doc("person_events.xml"); <results>{ for tumbling window $w in $seq/stream/event[direction eq "in"] start when true() only end next $x when $x/person eq "Clara" return <result time="{ $x/@time }">{ distinct-values(for $y in $w where (xs:dateTime($y/@time) + xs:dayTimeDuration("PT15M") ) ge xs:dateTime($x/@time) return $y/person) }</result> }</results>
Expected Result:
<results> <result time="2006-01-01T11:15:00-00:00">Barbara</result> <result time="2006-01-02T12:00:00-00:00"/> <result time="2006-01-02T12:15:00-00:00">Clara</result> <result time="2006-01-02T12:25:00-00:00">Clara</result> <result time="2006-01-02T14:00:00-00:00"/> </results>
Notify when both Anton and Barbara enter the office within 30 minutes of one another.
Solution in XQuery:
declare variable $seq := fn:doc("person_events.xml"); <result>{ for tumbling window $w in $seq/stream/event[direction eq "in"] start $x when $x/person = ("Barbara", "Anton") end next $y when xs:dateTime($y/@time) - xs:dateTime($x/@time) gt xs:dayTimeDuration("PT30M") where $w[person eq "Anton"] and $w[person eq "Barbara"] return <alert time="{ xs:dateTime($y/@time) }">Anton and Barbara just arrived</alert> }</result>
Expected Result:
<result> <alert time="2006-01-01T11:15:00Z">Anton and Barbara just arrived</alert> </result>
Inform when a person enters the building at least 3 times within 1 hour
Solution in XQuery:
declare variable $seq := fn:doc("person_events.xml"); <result>{ for sliding window $w in $seq/stream/event start $s when true() end next $e when xs:dateTime($e/@time) - xs:dateTime($s/@time) gt xs:dayTimeDuration("PT1H") where count($w[person eq $s/person and direction eq "in"]) ge 3 return <alert time="{ $e/@time }">{fn:data($s/person)} is suspicious</alert> }</result>
Expected Result:
<result> <alert time="2006-01-02T14:00:00-00:00">Clara is suspicious</alert> </result>
Find all annoying authors who have posted three consecutive items in the RSS feed.
Solution in XQuery:
declare variable $rssfeed := fn:doc("rss.xml"); <result>{ for tumbling window $w in $rssfeed/rss/channel/item start $first when fn:true() end next $lookAhead when $first/author ne $lookAhead/author where count($w) ge 3 return <annoying-author>{ $w[1]/author }</annoying-author> }</result>
Expected Result:
<result> <annoying-author><EMAIL_ADDRESS></annoying-author> </result>
Every day, provide a list of interesting topics in the RSS feed. In our example, interesting means that the title of the item contains the specific word XQuery.
Solution in XQuery:
declare variable $rssfeed := fn:doc("rss.xml"); <result>{ for tumbling window $w in $rssfeed/rss/channel/item start $s_curr when true() end next $e_next when fn:day-from-dateTime(xs:dateTime($e_next/pubDate)) ne fn:day-from-dateTime(xs:dateTime($s_curr/pubDate)) return <item> <date>{xs:date(xs:dateTime($s_curr/pubDate))}</date> { for $item in $w where fn:contains( xs:string($item/title), 'XQuery') return $item/title } </item> }</result>
Expected Result:
<result> <item> <date>2003-06-03</date> <title>Extending XQuery with Window Functions</title> <title>XQueryP: A new programming language is born</title> </item> <item> <date>2003-06-04</date> </item> </result>
Every day, provide a summary of the RSS feed grouped by author.
Solution in XQuery:
declare variable $rssfeed := fn:doc("rss.xml"); <result>{ for tumbling window $w in $rssfeed/rss/channel/item start $s_curr when true() end next $e_next when fn:day-from-dateTime(xs:dateTime($e_next/pubDate)) ne fn:day-from-dateTime(xs:dateTime($s_curr/pubDate)) return <item> <date>{xs:date(xs:dateTime($s_curr/pubDate))}</date> { for $a in fn:distinct-values($w/author) return <author name="{$a}"> <titles> { $w[author eq $a]/title } </titles> </author> } </item> }</result>
Expected Result:
<result> <item> <date>2003-06-03</date> <author<EMAIL_ADDRESS><titles> <title>Why use cases are important Part 1.</title> <title>Why use cases are important Part 2.</title> <title>Why use cases are important Part 3.</title> </titles> </author> <author<EMAIL_ADDRESS><titles> <title>Extending XQuery with Window Functions</title> </titles> </author> <author<EMAIL_ADDRESS><titles> <title>XQueryP: A new programming language is born</title> </titles> </author> </item> <item> <date>2003-06-04</date> <author<EMAIL_ADDRESS><titles> <title>Why use cases are annoying to write.</title> </titles> </author> </item> </result>
At the end of a day, list the most valuable customers.
Solution in XQuery:
declare variable $seq := fn:doc("cxml.xml"); <result>{ for sliding window $w in $seq/sequence/* start $cur previous $prev when day-from-dateTime($cur/@date) ne day-from-dateTime($prev/@date) or empty($prev) end $end next $next when day-from-dateTime(xs:dateTime($end/@date)) ne day-from-dateTime(xs:dateTime($next/@date)) return <mostValuableCustomer endOfDay="{xs:dateTime($cur/@date)}">{ let $companies := for $x in distinct-values($w/@billTo ) return <amount company="{$x}">{sum($w[@billTo eq $x]/@total)}</amount> let $max := max($companies) for $company in $companies where $company eq xs:untypedAtomic($max) return $company }</mostValuableCustomer> }</result>
Expected Result:
<result> <mostValuableCustomer endOfDay="2006-01-01T00:00:00Z"> <amount company="ACME1">1100</amount> </mostValuableCustomer> <mostValuableCustomer endOfDay="2006-01-02T00:00:00Z"> <amount company="ACME1">10000</amount> </mostValuableCustomer> <mostValuableCustomer endOfDay="2006-01-03T00:00:00Z"/> <mostValuableCustomer endOfDay="2006-01-04T00:00:00Z"/> <mostValuableCustomer endOfDay="2006-01-05T00:00:00Z"/> <mostValuableCustomer endOfDay="2006-01-06T00:00:00Z"> <amount company="ACME2">100</amount> </mostValuableCustomer> <mostValuableCustomer endOfDay="2006-01-07T00:00:00Z"/> </result>
Calculate the time needed to process an order from the request up to the shipping.
Solution in XQuery:
declare variable $seq := fn:doc("cxml.xml"); <result>{ for sliding window $w in $seq/sequence/* start $s when $s[self::OrderRequest] end $e when $e/@orderID eq $s/@orderID and ($e[self::ConfirmationRequest] and $e/@status eq "reject" or $e[self::ShipNotice]) where $e[self::ShipNotice] return <timeToShip orderID="{ $s/@orderID}">{xs:dateTime($e/@date) - xs:dateTime($s/@date) }</timeToShip> }</result>
Expected Result:
<result> <timeToShip orderID="OID01">P3DT22H</timeToShip> <timeToShip orderID="OID03">P2DT19H</timeToShip> </result>
At the moment of the shipping notification, calculate if an open request exists that can be shipped to the same address.
Solution in XQuery:
declare variable $seq := fn:doc("cxml.xml"); <result>{ for sliding window $w in $seq/sequence/* start previous $wSPrev when $wSPrev[self::OrderRequest] end next $wENext when $wENext/@orderID eq $wSPrev/@orderID and ($wENext[self::ConfirmationRequest] and $wENext/@status eq "reject" or $wENext[self::ShipNotice]) where $wENext[self::ShipNotice] return <bundleWith orderId="{$wSPrev/@orderID}">{ for sliding window $bundle in $w start $bSCur when $bSCur[self::OrderRequest] and $bSCur/@shipTo eq $wSPrev/@shipTo end $bECur next $bENext when $bECur/@orderID eq $bSCur/@orderID and ($bECur[self::ConfirmationRequest] and $bECur/@status eq "reject" or $bECur[self::ShipNotice]) where empty($bENext) return $bSCur }</bundleWith> }</result>
Expected Result:
<result> <bundleWith orderId="OID01"> <OrderRequest billTo="ACME1" date="2006-01-02T14:00:00-00:00" orderID="OID03" shipTo="ACME1" total="10000" type="new"> <Item partID="ID3" quantity="100" unitPrice="100"/> </OrderRequest> </bundleWith> <bundleWith orderId="OID03"/> </result>
The described queries in this section all require tuple numbering. The numbering is either required in the final result or might also be required at some point in the middle when the tuple stream gets generated.
The "Count" use cases are all based on the shopping scenario which can be found in the section Shopping Scenario Schema and Data.
List all products in alphabatical order with a continously increasing number.
Solution in XQuery:
<products>{ for $product in doc("products.xml")/*/product order by $product/name count $number return <product number="{$number}">{$product/*}</product> }</products>
Expected Result:
<products> <product number="1"> <name>blender</name> <category>kitchen</category> <price>50</price> <cost>25</cost> </product> <product number="2"> <name>broiler</name> <category>kitchen</category> <price>100</price> <cost>70</cost> </product> <product number="3"> <name>shirt</name> <category>clothes</category> <price>10</price> <cost>3</cost> </product> <product number="4"> <name>socks</name> <category>clothes</category> <price>5</price> <cost>2</cost> </product> <product number="5"> <name>toaster</name> <category>kitchen</category> <price>30</price> <cost>10</cost> </product> </products>
Arrange a sequence of items as a table with three columns (using as many rows as necessary) like in Q1 from the windowing use cases.Additionally, number every row continuously.
Solution in XQuery:
declare variable $seq := fn:doc("arrange_rows.xml");
{ for tumbling window $w in $seq/doc/* start at $x when fn:true() end at $y when $y - $x = 2 count $rowNumber return
 {$rowNumber}	{ for $i in $w return {data($i)}	 }
 }

Expected Result:

 1	 Green	 Pink	 Lilac

 2	 Turquoise	 Peach	 Opal

 3	 Champagne

Top-K query: Return the three best-selling products (by quantity).
Solution in XQuery:
<result>{ for $sales in doc("sales-records.xml")/*/record let $name := $sales/product-name group by $name let $qty := sum($sales/qty) order by $qty descending count $count where $count <= 3 return <sale product="{$name}" qty="{$qty }"/> }</result>
Expected Result:
<result> <sale product="socks" qty="510"/> <sale product="blender" qty="250"/> <sale product="toaster" qty="200"/> </result>
This use case demonstrate how the new "outer for" clause can help to express outer joins in XQuery.
The "Outer For" use case is based on the shopping scenario which can be found in the section Shopping Scenario Schema and Data.
Report all the store sales including stores which have not sold anything.
Solution in XQuery:
<result>{ for $store in doc("stores.xml")/*/store for $sale allowing empty in doc("sales-records.xml")/*/record[ store-number eq $store/store-number] return <store number="{$store/store-number}" product="{$sale/product-name}" state="{$store/state}" sold="{$sale/qty}" /> }</result>
Expected Result:
<result> <store number="1" state="CA" product="broiler" sold="20"/> <store number="1" state="CA" product="socks" sold="500"/> <store number="2" state="CA" product="toaster" sold="100"/> <store number="2" state="CA" product="toaster" sold="50"/> <store number="2" state="CA" product="socks" sold="10"/> <store number="3" state="MA" product="toaster" sold="50"/> <store number="3" state="MA" product="blender" sold="100"/> <store number="3" state="MA" product="blender" sold="150"/> <store number="3" state="MA" product="shirt" sold="10"/> <store number="4" state="WA" product="" sold=""/> </result>
List all the sales records. Include also all the items which were not sold in a store.
Solution in XQuery:
<result>{ for $store in doc("stores.xml")/*/store for $product in doc("products.xml")/*/product for $sale allowing empty in doc("sales-records.xml")/*/record[ store-number eq $store/store-number and product-name eq $product/name] return <store number="{$store/store-number}" state="{$store/state}" product="{$sale/product-name}" sold="{$sale/qty}" /> }</result>
Expected Result:
<?xml version="1.0" encoding="UTF-8"?> <result> <store number="1" state="CA" product="broiler" sold="20"/> <store number="1" state="CA" product="toaster" sold=""/> <store number="1" state="CA" product="blender" sold=""/> <store number="1" state="CA" product="socks" sold="500"/> <store number="1" state="CA" product="shirt" sold=""/> <store number="2" state="CA" product="broiler" sold=""/> <store number="2" state="CA" product="toaster" sold="100"/> <store number="2" state="CA" product="toaster" sold="50"/> <store number="2" state="CA" product="blender" sold=""/> <store number="2" state="CA" product="socks" sold="10"/> <store number="2" state="CA" product="shirt" sold=""/> <store number="3" state="CA" product="broiler" sold=""/> <store number="3" state="MA" product="toaster" sold="50"/> <store number="3" state="MA" product="blender" sold="100"/> <store number="3" state="MA" product="blender" sold="150"/> <store number="3" state="MA" product="socks" sold=""/> <store number="3" state="MA" product="shirt" sold="10"/> <store number="4" state="MA" product="broiler" sold=""/> <store number="4" state="MA" product="toaster" sold=""/> <store number="4" state="MA" product="blender" sold=""/> <store number="4" state="MA" product="socks" sold=""/> <store number="4" state="MA" product="shirt" sold=""/> </result>
This use case covers queries that require to recover from errors.
Q1 and Q2 are based on a errornous version of product.xml from Shopping Scenario Schema and Data, whereas Q3 does not require any input data. Sample data for Q1 and Q2 named product-err.xml are shown below:
<products> <product> <name>broiler</name> <category>kitchen</category> <price>100</price> <cost>"70"</cost> </product> <product> <name>toaster</name> <category>kitchen</category> <price>30</price> <cost>10</cost> </product> <product> <name>blender</name> <category>kitchen</category> <price>50</price> <cost>25</cost> </product> <product> <name>socks</name> <category>clothes</category> <price>5</price> <cost>2</cost> </product> <product> <name>shirt</name> <category>clothes</category> <price>10</price> <cost>3</cost> </product> </products>
Calculate the margin of every product. If an error occurs, report a user-friendly message.
Solution in XQuery:
try { <result>{ for $product in fn:doc("product-err.xml")//product return <product>{$product/name} <margin>{$product/price - $product/cost}</margin> </product> }</result> } catch * { "An error occured, please ask your consultant for help." }
Expected Result:
An error occured, please ask your consultant for help.
Report the margin in procent of every product. If an error occurs the failure should be listed, but the query should still continue to report the other values.
Solution in XQuery:
<result>{ for $product in fn:doc("product-err.xml")//product return try { <product>{$product/name} <margin>{$product/price div $product/cost}</margin> </product> } catch * { <product>{ ($product/name, "Error:", $err:code) }</product> } }</result>
Expected Result:
<?xml version="1.0" encoding="UTF-8"?> <result> <product> <name>broiler</name> Error: FORG0001 </product> <product> <name>toaster</name> <margin>3</margin> </product> <product> <name>blender</name> <margin>2</margin> </product> <product> <name>socks</name> <margin>2.5</margin> </product> <product> <name>shirt</name> <margin>3.3333333333333333</margin> </product> </result>
For a sequence of inputs the n-th fibonacci number has to be calculated using a pre-defined function. The function is built to avoid long running times and therefore rejects high values by throwing a user-defined error. If such an error occurs during calculation, a warning should be displayed, but the processing should continue.
Solution in XQuery:
declare namespace foo='http://foo.com'; declare function local:fib-recur($n as xs:integer) as xs:integer? { if ($n <0) then () else if ($n > 100) then fn:error(fn:QName('http://foo.com', 'ValueToBig'), 'Value too big') else if ($n = 0) then 0 else if ($n=1) then 1 else local:fib-recur($n - 1) + local:fib-recur($n - 2) }; <result>{ for $x in (3,1,1030,5) return try{ <fib input="{$x}">{local:fib-recur($x)}</fib> }catch foo:ValueToBig { <fib input="{$x}">Number to big</fib> } }</result>
Expected Result:
<?xml version="1.0" encoding="UTF-8"?> <result> <fib input="3">2</fib> <fib input="1">1</fib> <fib input="1030">Number to big</fib> <fib input="5">5</fib> </result>
The Working Group thanks the following individuals for their contributions:
| Peter M. Fischer, Donald Kossmann, Rokas Tamosevicius | Use Case "windowing" |
Removed xsi
declaration and
xsi:noNamespaceSchemaLocation
attributes in input
documents. Resolves BZ
11757.
Corrected input file name in Windowing Q7. Resolves BZ 11756.
Corrected Clara's working time in Windowing Q8. Resolves BZ 11758.
Added order by $person
to Windowing Q9. Resolves
BZ
11759.
Corrected Clara's working time in Windowing Q9. Resolves BZ 11853.
Corrected result of Windowing Q12. Resolves BZ 11761.
Added parentheses to correct solutions in Windowing Q18 and Q19. Resolves BZ 11762.
The following references are some of the works considered by the WG in deriving its use cases.


About G20.
We are a team passionate about web design, seo,
mobile apps and creating software to help businesses succeed.
The Founders.
It all started in a garage. Not we are the #1 leaders in our industry with thousands of customers world wide.
Lorem ipsum dolor sit am consectetur adipisicing elit. Vel odit eius maiores voluptatibus officia, quo recusandae ipsam alias dolorum culpa odio ducimus numquam maxime facilis modi quae consectetur ea eveniet id. In neque adipisci eius saepe tempora soluta ratione inventore?
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Ratione obcaecati, maiores cupiditate exercitationem mollitia quo magni cum libero molestiae quibusdam itaque inventore quas veritatis velit?
gilbert
This is a custom excerpt so you can write something unique for your entry for your staff members.
elnino
This is a custom excerpt so you can write something unique for your entry for your staff members.


WITNESS LIST Public Health Committee April 24, 1997-8:00A HB 2099 For: Uher, D.R.(Tom) (Self, Representative) HB 2556 For: Kuempel, Edmund (Self, Representative) Richey, Don (Guadalupe Valley Hosp.) On: Magers, Bonnie (TDH) HB 2932 For: Gumbert, Jim (Hermann Hospital) HB 2957 For: Farrar, Jessica (Self, Representative) Harmison, Joe (TPA) Mayorca, Gustavo (Self) Wood, Chriss (United Drugs) HB 3265 For: Caruthers, Bob (Self) Craddick, Tom (Self, Representative) Evans, Wendy (Self) Against: Wall, Matthew (THA) Willmann, James (TNA) HB 3410 For: Gossom, Stephanie (Self) Young, Barbara (Self) HCR 168 On: Dyck, Walter (TAMUHSC) Guckian, James (UT System) SB 952 For: Lewis, Glenn (Self, Representative) Shafer, Teresa (Self, TMA, STOB)


Warehouse Keeper Haprock: Welcome! Our Iron Gate Guild will safely store your items at a price so low you'll wonder how we can make a living! With our services, you can travel without the slightest worry for the items you leave behind. Isn't that peace of mind truly priceless?


This is the one of the components of my final year dissertation: the slightly modified spring boot example.
The rest of the components of this project are:
The modified native application, developed in python, which works kind of the same way as
the original C++ native application, but using eID certificate files instead of eID smart cards. It also adds the functionality
of storing eID usages in local json files and sending the record posts to the eID record server to store them remotely.
This modified spring boot example, only modified to accept spanish AC-FNMT Usuarios and
seg-social ACGISS eID certificates.
The modified Web eID extension, only modified to fit the new structure with the record server added.
The eID record server, a new web application made from the original Web eID spring boot example which will
track all the activity made with eID certificates and allows users to see a list of usages, download them and receive email
notifications when their certificates are used. This component has been developed to add secure digital signature delegation.
Check it out here.
Modifications
As said, this has been modified as little as possible, to show that this component is easily extensible to other countries and functionalities.
The modifications are:
The keystore has been regenerated with these certificates.
To fit the new signing process, instead of the hash of the example data to sign, the whole data is sent, because the data being hashed
is like a little metadata file.
There was a problem with Digidoc when signing and validating OCSP response, so in order to solve it:
The whole digidoc4j library had to be included, and that line was commented to check what happens.
Due to the fact that the problem was in relation with OCSP response and no request was being sent when signing
(checked with wireshark), the OCSP request functionality has been extracted from the authtoken validation library and
then included in the CertificateValidationService, so it's called when signing too. However, and even
with Estonian certificates, the desktop won't fully recognize the signature.
To try to solve the above problem, there was an attempt to make the container building and signing process with the @firma
library, but hasn't work yet. Further research is needed.
Therefore, you can try this app the same way as the original one, and even with some Spanish certificate files (if you use the
modified native app and extension). No changes were needed to integrate the eID record server.
The following content remains the same as the original project and the web eid test page.
Web eID: electronic ID smart cards on the Web
The Web eID project enables usage of European Union electronic identity (eID) smart cards for
secure authentication and digital signing of documents on the web using public-key cryptography.
Estonian, Finnish, Latvian, Lithuanian and Croatian eID cards are supported in the first phase, but only
Estonian eID card support is currently enabled in the test application below.
Please get in touch by email at<EMAIL_ADDRESS>in case you need support with adding Web eID to your project
or want to add support for a new eID card to Web eID.
Instructions for installing and testing in Firefox, Chrome or Edge (support for Safari has been already
added as well, but it is not yet published):
Download and run the Web eID native app and browser extension installer:
for Ubuntu Linux 20.04 from here,
install it with either the Ubuntu Software Center or from the console with sudo apt install ./web-eid_<IP_ADDRESS>_amd64.deb
The installer will install the browser extension for all supported browsers automatically.
The extension must be manually enabled from either the extension installation pop-up that appears in
the browser
or from the browser extensions management page and may need browser restart under certain
circumstances.
Attach a smart card reader to the computer and insert the eID card into the reader.
Click Authenticate below.
Uninstallation
Ubuntu Linux
Uninstall Web eID either using the Ubuntu Software Center or from the console with sudo apt purge web-eid
The uninstaller will remove the browser extension from all supported browsers automatically.
The uninstaller will remove the browser extension from all supported browsers automatically.
Debugging and logs
To debug the extension, open the extension page and select
Inspect to open browser developer tools in extension mode. You can examine extension
logs in the Console tab, put breakpoints in extension code in the Debugger tab
and inspect extension network communication in the Network tab.
The native app logs are stored in
~/.local/share/RIA/web-eid/web-eid.log in Linux
~/Library/Application Support/RIA/web-eid/web-eid.log in macOS
C:/Users/<USER>/AppData/Local/RIA/web-eid/web-eid.log in Windows.
Documentation
Technical overview of the solution is available in the project
system architecture document.
Overview of authentication token validation implementation in the back end is available in the
web-eid-authtoken-validation-java Java library
README.
Security analysis of the solution is available
in this document.
For developers
Currently the Web eID back-end libraries are available for Java web applications.
To implement authentication and digital signing with Web eID in a Java web application,
you need to
use the web-eid.js JavaScript library in the front end of the web application
according to the instructions
here,
for authentication, use the web-eid-authtoken-validation-java Java library in
the back end of the web application according to the instructions
here,
for digital signing, use the digidoc4j Java library in the back end of the web
application according to the instructions
here.
The full source code of an example Spring Boot web application that uses Web eID for authentication
and digital signing is available
here.


TABLE OF CONTENT
A. GS1 Related Art and Culture 1. Kerala boat races off to colourful start B. GS2 Related Polity 1. Panel calls for ‘light regulation’ of NGOs 2. Coming: direct to home coaching for students, IIT aspirants International Relations 1. PMO, NSA tracking impact of Chinese FDI in South Asia 2. 122 nations adopt first treaty banning nuclear weapons C. GS3 Related Economics 1. IMF, World Bank and WTO call for removing trade barriers to boost growth Science And Technology 1. Cocoa: A tonic for cognition and memory retention 2. Cloud seeding: expensive, but no guarantees 3. Using AI to achieve development goals D. GS4 Related E. Concepts-in-News: Related Concepts to Revise/Learn F. Bills/Acts/Schemes/Orgs in News G. Practice Questions for UPSC Prelims Exam
UPSC Current Affairs 2017: News Analysis
A. GS1 Related
1. Kerala boat races off to colourful start
In news:
- Hundreds of oarsmen take part in the Champakulam event, the season’s first
History and its cultural significance:
- The history of the race dates back to the 15th century when the erstwhile Travancore State was ruled by the Chembakassery dynasty.
- The Moolam boat race commemorates an episode associated with the installation of the idol of Lord Krishna at the Ambalappuzha Sri Krishna temple.
- The idol was brought from Kurichi near Kottayam by boat.
- The boat carrying the idol had a halt at Mappilasseri, a traditional Christian home at Champakulam. It was given a reception by people of all communities and the voyage to Ambalappuzha was marked by festivities.
- The annual race falls on Moolam star in the month of Mithunam in the Malayalam calendar.
C. GS2 Related
1. Panel calls for ‘light regulation’ of NGOs
In news:
- A high-power committee appointed by the Central government on the orders of the Supreme Court has recommended several steps to ensure the “light regulation” of non-governmental organisations (NGOs) so as to reduce their harassment.
- The committee is headed by S. Vijay Kumar, a former Secretary in the Ministry of Rural Development.
Major recommendations of the Committee:
- Registration procedures be modernised so as to facilitate the seamless operation of the applicable provisions of the IT (Income Tax) Act and FCRA (Foreign Contribution Regulation Act) with respect to NGOs, without the need for cumbersome and intrusive processes.
- Steps must be taken to “reduce the need for a physical interface between NGOs and public officials acting under the IT Act and the FCRA, along with reduction in mutual distrust and scope for misuse.
- The committee has drawn up a framework of guidelines for the accreditation of NGOs, audit of their accounts, and procedures to initiate action for recovering grants in case of misappropriation.
- A nodal body to oversee the various interfaces between NGOs and the government, and has recommended that NITI Aayog be vested with the power
- It has recommended an overarching legislation with best practices that would replace various State-level and existing Central laws.
- Details of NGOs should be available as searchable database information.
2. Coming: direct to home coaching for students, IIT aspirants
Swayam Prabha:
- The Union government will formally launch Swayam Prabha — a project for telecasting “high-quality educational programmes” through 32 DTH channels —at a National Convention on Digital Initiatives for Higher Education.
Features:
- The project envisages 24X7 access to educational content.
- Every day, there will be content of four hours that will be repeated six times, thus covering all 24 hours of the day. This will allow the student to choose a time of his own convenience.
The DTH Channels shall cover the following:
- Higher Education: Curriculum-based course contents at post-graduate and under-graduate level covering diverse disciplines such as arts, science, commerce, performing arts, social sciences and humanities, engineering, technology, law, medicine, agriculture, etc.
- School education (9-12 levels): modules for teacher’s training as well as teaching and learning aids for children of India to help them understand the subjects better and also help them in preparing for competitive examinations for admissions to professional degree programmes.
- Curriculum-based courses that can meet the needs of life-long learners of Indian citizens in India and abroad.
- Assist students (class 11th & 12th) prepare for competitive exams.
- The content would also include IIT-PAL modules, aimed at helping students of Classes 11 and 12 prepare for the IITs by developing a strong conceptual understanding.
Category: INTERNATIONAL RELATIONS
1. PMO, NSA tracking impact of Chinese FDI in South Asia
Context: India’s tense border stand-off in Sikkim with China
In news:
- The Union Government of India has begun its first ever in-depth assessment of Chinese investments in India’s neighbouring countries.
- The move has been initiated by the Prime Minister’s Office and the National Security Adviser.
Chinese FDI in the Indian subcontinent:
- Trends show that there have been an increasing influence of China in the Indian sub-continent and South Asia
- Pakistan government data shows that FDI from China jumped from $256.8 million in 2014-15 to $878.8 million in 2016-17 (July-May).
Chinese investments and threats to India’s national security:
- The study will analyse the impact of these Chinese investments — including those being made as part of the Belt and Road Initiative (BRI, also known as One Belt One Road or OBOR) — on India’s national security.
- In addition to assessing the nature and impact of Chinese FDI in Bangladesh, Bhutan, Myanmar, Nepal, Pakistan and Sri Lanka, the study will track Chinese investments in Afghanistan and Maldives too.
- The major challenge in the study will be the lack of detailed, country-wise data on overall FDI (year-wise) and Chinese FDI, in particular.
Economic market threats:
- Chinese investments in countries like Pakistan could, in turn, set the stage for Pakistan to make inroads into markets in Bangladesh, Sri Lanka and Nepal and challenge the presence of Indian firms in these markets, where India is currently the major player.
- The CPEC(China – Pakistan Economic Corridor)/OBOR projects can also better link Pakistan with the Central Asian Republics (CAR) and help the country establish a footprint in those markets
2. 122 nations adopt first treaty banning nuclear weapons
In news:
- More than 120 countries approved the first-ever treaty to ban nuclear weapons at a UN meeting boycotted by all nuclear-armed nations.
- None of the nine countries known or believed to possess nuclear weapons – the United States, Russia, Britain, China, France, India, Pakistan, North Korea and Israel – is supporting the treaty. Many of their allies also did not attend the meeting.
C. GS3 Related
1. IMF, World Bank and WTO call for removing trade barriers to boost growth
In News
- IMF, World Bank and WTO suggested for removing trade barriers and expediting economic reforms to boost global growth and employment, at G-20 Summit
Reason behind low employment
According to all the three organisations, technology is the prime reason for job losses in some regions
Way forward:
- Deeper trade integration and supportive domestic policies is required by the leaders of the grouping(G-20)
- Deeper trade integration twinned with supportive domestic policies can help boost incomes and accelerate global growth
Basic Information:
Economic or Trade Integration
- Economic integration is the unification of economic policies between different states through the partial or full abolition of tariff and non-tariff restrictions on trade taking place among them prior to their integration
- This is meant in turn to lead to lower prices for distributors and consumers with the goal of increasing the level of welfare, while leading to an increase of economic productivity of the states
- The trade stimulation effects intended by means of economic integration are part of the contemporary economic Theory of the Second Best: where, in theory, the best option is free trade, with free competition and no trade barriers whatsoever
- Free trade is treated as an idealistic option, and although realized within certain developed states, economic integration has been thought of as the “second best” option for global trade where barriers to full free trade exist
Category: SCIENCE AND TECHNOLOGY
1. Cocoa: A tonic for cognition and memory retention
Cocoa and health benefits:
- Cocoa and chocolates are good for cognition. Of particular interest is a paper
- The family of flavonoids (catechins, quercetin, anthocyanidins) present in cocoa not only act as antioxidants and cell protectants just as tea does, but they protect human cognition, counteract cognitive decline and memory loss as well.
- Cocoa and cognition: they may protect neurons against damage, reduce inflammation, promote and even generate new connections between nerve cells.
2. Cloud seeding: expensive, but no guarantees
In news:
The Karnataka State government’s proposal for cloud seeding is gathering steam even as many meteorologists warn that the costly ‘experiment’ may end up yielding little.
Basic Information:
Cloud seeding:
- Cloud seeding is a form of weather modification, a way of changing the amount or type of precipitation that falls from clouds, by dispersing substances into the air that serve as cloud condensation or ice nuclei, which alter the microphysical processes within the cloud.
- The usual intent is to increase precipitation (rain or snow), but hail and fog suppression are also widely practiced in airports.
- The most common chemicals used for cloud seeding include silver iodide, potassium iodide and dry ice (solid carbon dioxide). Liquid propane, which expands into a gas, has also been used.
- This can produce ice crystals at higher temperatures than silver iodide. After promising research, the use of hygroscopic materials, such as table salt, is becoming more popular.
3. Using AI to achieve development goals
Context:
How AI can provide solutions to human and social development challenges?
Health and nutrition
- High level of malnutrition and stunted growth in pre-school children in India is alarming
- AI-based systems can be used to improve delivery of child nutrition programmes
How AI can help?
- AI-based systems collect and examine data about children and track the progress of an individual child in terms of their cognitive development and health.
- Image-recognition techniques can help in early identification of stunted growth, epidemics and other health issues.
- It assist in diagnosis of problems being faced—from drought to poor sanitation and inadequate supplies
Agriculture
- US have used AI to develop “precision farming” practices, which lead to a more efficient use of inputs and higher yields.
How it works?
- Sensors gather information about the condition and colour of foliage and soil moisture content.
- This information is fed to the system, which determines the amount of water, and fertilizer to be provided.
- It also specifies which part of the plant needs to be provided with these inputs.
- These systems have reported higher yields and reduction in agricultural inputs.
- Education
- Learning outcomes of young minds are notoriously poor in our current education system.
AI-based systems can assist students with their learning experience.How?
- Changing the form and nature of content to suit the student.
- “Smart content” is generated with text summaries, supported with related videos and simulations.
- Intelligent tutor systems are an example of the same (see Carnegielearning.com).
- MIT’s Media Labs has also developed “personal robots” which work and interact with humans as peers.
- Some of them are even capable of identifying and correcting misconceptions of a student as they learn the material.
- Provides timely feedback to students and teachers.
Concerns about AI?
- Expensive today.
- Ethical issues of privacy of data, equity and liability of actions.
D. GS4 Related
Nothing here for Today!!!
PIB Articles Editorials Roundup
E. Concepts-in-News: Related Concepts to Revise/Learn
Nothing here for Today!!!
F. Bills/Acts/Schemes/Orgs in News
Nothing here for Today!!!
G. Practice Questions for UPSC Prelims Exam
Question 1: Consider the following statements:
- The Moolam boat race commemorates an episode associated with the installation of the idol of Lord Krishna .
- The annual Moolam boat race falls on Moolam star in the month of Mithunam in the Malayalam calendar.
Choose the correct Answer.
- 1 only
- 2 only
- Both 1 and 2
- Neither 1 nor 2
Question 2: Consider the following statements with reference to Swayam Prabha:
- It is a project for telecasting “high-quality educational programmes” through 32 DTH channels.
- The project also has teacher training modules in it.
Choose the correct Answer
- 1 only
- 2 only
- Both 1 and 2
- Neither 1 nor 2
Question 3: Consider the following statements Chemicals:
- Silver Iodide
- Potassium nitrite
- Potassium nitrate
- Solid carbon dioxide
- Liquid Carbon dioxide
- Liquid propane
The most common chemicals used for cloud seeding is/are?
- 1 only
- 1,2,4 and 6
- 1,4and 6
- 1,2,3,4,5 and 6
Question 4: Which among the following ministry implements a program called ‘Swayam
Prabha’?
- Ministry of Information and Broadcasting
- Ministry of Human Resource and development
- Ministry of Communications
- Ministry of Skill development and Entrepreneurship
Question 5: The Fair and Remunerative Price (FRP) of sugarcane is approved by the
- Cabinet Committee on Economic Affairs
- Commission for Agricultural Costs and Prices.
- Agricultural Produce Market Committee.
- Directorate of Marketing and Inspection, Ministry of Agriculture
“Proper Current Affairs preparation is the key to success in the UPSC- Civil Services Examination. We have now launched a comprehensive ‘Online Current Affairs Crash Course’. Limited seats available. Click here to Know More.”
Practice More: Enroll for India’s Largest All-India Test Series


Young man who lost family at Radio 1's Big Weekend killed himself hours later
The inquest heard how Isaac Powner had previously reported low mood and other incidents had concerned his family before his death
by Samuel JonesA 23-year-old man who killed himself after struggling to find his family at Radio 1's Big Weekend has been described as a "very funny, kind considerate and loving young man".
An inquest was held to determine the circumstances of Isaac Powner's death at Teeside Coroner's Court on Friday.
The NHS Trust officer jumped from a bridge after leaving the festival in Stewart Park, Middlesbrough on May 25.
Mr Powner had been to the festival with his family for a packed Saturday schedule including performances from Stormzy and Lewis Capaldi, reports Teeside Live .
Evidence from his cousin, James Hardman, described how the pair had headed to Toby Carvery on Marton Road for breakfast before walking to the event when he "seemed fine".
They had enjoyed watching performances in the packed yellow tent in a group before Mr Powner got separated.
Issues with significant delays to text messages being received and the 4G network slowing down due to the volume of people in the park meant Mr Hardman was unable to locate his cousin.
He told the hearing that while Mr Powner had consumed a few pints "it would not affect him, that", mentioning how he was very tall.
A family statement compiled by his sister Robyn Powner, mum Suzie Henderson-Thynne and girlfriend Bethany Golden, explained how similar issues with text messages had occurred as he tried to meet up with other family members.
He sent one at 7.20pm trying to find them - around two hours before his death.
"We think something must have happened in those last two hours to make him do what he did," the statement said.
It added: "Isaac was a very funny, kind, considerate and loving young man.
"He was very close and loved by all his family.
"He was well liked by all his friend and collegues."
The inquest also heard from evidence from PC Matthew Kenning, who was stationed on Stokesley Road near the former Marton Country Club.
A statement read out at the inquest said it was around 9.25pm when he saw Mr Powner walking towards him where the road crosses over the A174.
The officer leaned over the bridge to see Mr Powner "laid on the ground".
His statement described how a white BMW had stopped metres from where Mr Powner had landed, only for a "loud bang" to follow as a silver Mazda slammed into the stationary vehicle.
Police officers in the area attempted CPR for around 25 minutes before a doctor pronounced Mr Powner dead.
CCTV footage reviewed by PC Lee Benson said there was no third party involvement in the death.
A post mortem found he died from multiple injuries and had a blood alcohol level of 202 milograms, meaning he would have been around two to three times over the drink drive limit, senior coroner for Teesside Clare Bailey said.
The hearing also heard how Mr Powner had previously reported low mood and other incidents had concerned his family.
In July 2018 he sent his girlfriend a text "which seemed like a suicide note".
Ms Golden urged him to get medical help and speak to his family about his emotions, but he was described as a private person who kept things to himself.
On January 1 this year he had been to watch Middlesbrough FC play before heading for a meal at Uno Momento on Linthorpe Road to celebrate his grandma's birthday.
The day continued as the family headed to Swatter's Carr pub nearby where Mr Powner ordered two bottles of Budweiser.
But he barely touched the drinks and unexpectedly ordered a taxi to his home on Oxford Road home in Linthorpe.

She discovered what appeared to be indications of a suicide attempt.
He claimed to have been "messing around" and his mother kept checking on him all night and the following morning he seemed to be "in good spirits".
His death in May came as a "huge shock" to those who knew him.
He had attended work all week, had put petrol in his car and had booked a holiday to Benidorm to see his dad Paul Powner.
His family said he had concerns about job security and had been diagnosed at the age of 11 with high functioning Asperger's.
Coroner Clare Bailey said she was satisfied the necessary standard of proof had been met and recorded a verdict of suicide.
A former Ormesby School pupil, Mr Powner had spent time working in Benidorm with his dad who runs a bar in the Spanish town with his stepmum Janet.
He was also a huge Boro fan and as a youngster was invited to be a mascot and is pictured beaming with the players.
At the time of his death, a spokeswoman for the BBC said: "We are shocked and saddened to hear the news and our thoughts go out to his family and friends at this difficult time."
The Mirror has contacted BBC for a comment.
* Samaritans (116 123) operates a 24-hour service available every day of the year. If you prefer to write down how you’re feeling, or if you’re worried about being overheard on the phone, you can email Samaritans at jo@samaritans.org


--- layout: post status: publish published: true title: We lost a bet. See you Monday. author: display_name: Corey Fineran login: Corey email<EMAIL_ADDRESS>url: '' author_login: Corey author_email<EMAIL_ADDRESS>wordpress_id: 3800 wordpress_url: http://ivyenvy.com/?p=3800 date: '2011-02-10 11:32:27 +0000' date_gmt: '2011-02-10 17:32:27 +0000' categories: - General Baseball tags: - Joey Votto - Reds - '2010' - Chris Sabo's Goggles - Cincinnati - Bronson Arroyo - Bet - Aaron Harang comments: - id: 2588 author: Ryan author_email<EMAIL_ADDRESS>author_url: '' date: '2011-02-16 19:55:09 +0000' date_gmt: '2011-02-17 01:55:09 +0000' content: "It was a fair bet...and congrats to the Reds for shocking the world and winning the division even when no one picked them to and despite the fact that they got knocked out in the first round. \r\n\r\nMeehan" ---
Last year, we rounded up some bloggers for other teams in the NL Central for our division preview episode on the podcast. I didn’t know any bloggers for other teams, so I just started browsing baseball blogs. There was one site that caught my eye purely because of the name.  Brian is a Reds fan that lives in Chicago. It must be tough to live in the belly of the beast of the team you dislike the most.
Entering the 2010 season, we made a little wager with Chris. The winner of the bet would be determined by whose team won the head-to-head record. I don’t remember what the final tally was, but I’ll tell you that it wasn’t close….and the Cubs didn’t win. I thought we had a chance to win the bet. I thought the Cubs would be better than they were. I looked at a pitching rotation that included Aaron Harang and Bronson Arroyo and though, “We’ll win this bet.” Plus, I didn’t know much about this fellow named Joey Votto.
The wager was this: The loser of the bet has to re-direct their site to the winner’s site for 3 days. So Friday – Sunday, if you go to www.ivyenvy.com, you will see a “C” with a slightly different shape and a whole lot of red.
I should have paid up on this bet in November or December, when there was very little going on. But I’m a procrastinator and now I’m trying to squeeze it in right before pitchers and catchers report to Spring Training.
So, farewell for a few days…. Go Cubs!


Home
1
2
Enter integers in the range (-50, 50) for the top and left side of the multiplication table.
Top starting number
Top ending number
Must be larger than the Top starting number
Left starting number
Left ending number
Must be larger than the Left starting number
Submit


When signing up for an account please be aware that you are agreeing to our
Terms ofService.
Passwords must be a minimum of eight (8) characters and contain at least one (1) character from the following
categories: uppercase and lowercase letter, digit, special character.


Wedding Photography Chief
John Dongi
This free website template is the first step to get you started with your personal photography website.
Who doesn't want to share their camera art with friends and family on social media? But why not share them on your own personal photography website and showcase your camera art to the world!
This free website template is the first step to get you started with your personal photography website. Learn the game and get some fame. Don't restrict your photography viewership to your close circle.
This quality free website template is the best way to save money and time to get started with your photography website. The minimal things that you need are a little personalization in terms of color theme.
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words.
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words.
Wedding Photography Chief
John Dongi
This free website template is the first step to get you started with your personal photography website.
Festival Photography Chief
John Donga
Learn the game and get some fame. Don't restrict your photography viewership to your close circle.
Photography Template Designer
Johhny D.
Go beyond and make it public on your photography website.
Photography Template Developer
J. Dongian
This week's free website template by Frittt is a photography website.
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words.
11 Sep
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
02 Oct
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
18 Oct
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.


{{Infobox prepared food | name = Tavukgöğsü | image = | caption = | alternate_name = Tavuk göğsü | country = Turkey | region = | creator = | course = Dessert | type = Pudding | served = | main_ingredient = Chicken, milk, sugar, rice flour | variations = | calories = | other = }} Tavuk göğsü ({{lang-tr|tavukgöğsü}}, {{IPA-tr|taˈvuk ɟøːˈsy|}}, "chicken breast") is a Turkish dessert (milk pudding) made with chicken meat. It became one of the most famous delicacies served to the Ottoman sultans in the Topkapı Palace. It is today considered a 'signature' dish of Turkey.
The traditional version uses white chicken breast meat, preferably freshly slaughtered capon. The meat is softened by boiling and separated into very fine fibers or rillettes. Modern recipes often pound the meat into a fine powder instead. The meat is mixed with milk, sugar, cracked rice and/or other thickeners, and often some sort of flavoring such as cinnamon. The result is a thick pudding often shaped for presentation.
The dish is more or less identical to the medieval "white dish", blancmange that was common in the upper-class cuisine of Europe.<ref>Coe (1994), pg. 231; "Before his arrival in Mexico City he was entertained with ... some manjar blanco [blanc manger] ... a dish served in Turkey today as a dessert and called tavuk gögsü."</ref><ref>Humes (2009); "In the fourteenth century, Western Europe couldn't get enough of tavuk göğsü. Known in England as blanc-manger, or 'white dish', the pallid chicken pudding appears in English, Italian, and German cookbooks of the period."</ref>
Contents |
{{reflist|group=Note}}
{{reflist}}
{{Cuisine of Turkey|dessert}} {{puddings}} {{Chicken}}
{{DEFAULTSORT:Tavuk gogsu}}
{{dessert-stub}} {{Turkey-cuisine-stub}}


{% extends 'webapp/base.html' %} {% block content %}
You do not have any diet plans. Create one by clicking "Create new diet plan"


Air-mode gives clearer interface with hidden toolbar.
To reveal toolbar, select a text where you want to shape up. Simply turn on airMode
and just focus on text.
This is an Air-mode editable area.
End of air-mode area
You can edit content on the fly.
Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean.


I'm A Celeb fans unimpressed as Jacqueline and Nadine refuse to do challenge
They weren't keen on doing it!
by Rebecca CarterViewers of I'm A Celebrity have branded Jacqueline Jossa and Nadine Coyle "snakes" for refusing to participate in a challenge.
The campmates had to pick two stars to join newbies Andy Whyment and Cliff Parisi as Outlaws in the Jungle Jailhouse.
Kate Garraway read out a message in camp which said: "Outlaws caught wanted for their crime of late entry. The two new campmates Andy and Cliff have been sent to Jungle Jailhouse on basic rations.
Read more: I'm A Celebrity viewers all making the same joke about Dec Donnelly's appearance
"Before entering the Jailhouse they took part in today’s Bushtucker Trial – The Frontier of Fear and they won 8 stars for camp.
"You now have the opportunity to be good, bad or downright ugly.
"So we can keep all the food ourselves, or we can choose to feed the outlaws with our share of food, however if we choose to feed them we will have to send two campmates to join them as outlaws in the Jailhouse."
Andrew Maxwell and James Haskell said they were both happy to go as well as Kate and Ian Wright.
Former footballer Ian then suggested they draw straws.
Referring to drawing names, Jacqueline said: "I think that's scary."
When Ian said she didn't have to go, Jacqueline said: "Yeah but it’s not very heroic," to which Andrew said: "I don't think it's fair to count yourself out, I think the ordeal has to be shared."
James Haskell hit back: "If she doesn’t want to do it, she doesn't have to do it."
Tensions began to rise as Jacqueline and Nadine Coyle admitted they didn't want to take part and would prefer to stay in camp.
Speaking in the Bush Telegraph, Andrew said: "Jacqueline and Nadine said they didn’t want to go and that’s the end of that."
The campmates then picked named water bottles out of a bag and the last two remaining were the two to go to the Jailhouse – they were Kate and Andrew.
Kate and Andrew left camp to join Andy and Cliff at the Jungle Jailhouse.
Viewers weren't impressed with Jacqueline and Nadine for refusing to put their names in the bag.
One person said: "Don’t think Jacqueline and Nadine refusing is gonna do them any good is it one of them is gonna get voted."
Another wrote: "Just used all my votes for Jaqueline & Nadine.
 One goes you all Go!"
Leave us a comment on our Facebook page @EntertainmentDailyFix and let us know what you think of this story.


This page demos the use of a websocket for various tasks. To start Connect the websocket. To create an async timer on the server click on the create timer. To send messages to other people connected to the server type in your name, a message and send!


SYSTEM-SETUP-KEYBOARD
Section: User Commands (1)Updated:
Index Return to Main Contents
NAME
system-setup-keyboard - HAL keyboard layout calloutSYNOPSIS
system-setup-keyboard
DESCRIPTION
system-setup-keyboard is a HAL keyboard layout callout. When a keyboard is plugged into the system, system-setup-keyboard reads the system-wide keyboard configuration from /etc/sysconfig/keyboard and merges the appropriate XKB options into the HAL description of the device.
AUTHORS
Adel Gadllah<EMAIL_ADDRESS>Peter Hutterer<EMAIL_ADDRESS>SEE ALSO
xorg.conf(5)
Index
This document was created by man2html, using the manual pages.
Time: 05:29:11 GMT, December 24, 2015


Marvel Resurrects Force Works for Iron Man 2020 Tie-In
by Jon ArvedonForce Works is returning in February 2020, courtesy of Matthew Rosenberg and Juanan Ramirez.
In Marvel's solicit information for product shipping February 2020, the publisher revealed Rosenberg and Ramirez will helm Force Works 2020, a three-issue miniseries that ties into the upcoming Iron Man 2020 event.
The original Force Works was created by Dan Abnett, Andy Lanning and Tom Tenney and debuted in 1994's Force Works #1. The team was formed by Iron Man as a replacement of sorts to the West Coast Avengers and the original lineup consisted of Scarlet Witch, Iron Man, Wonder Man, Spider-Woman, and U.S. Agent.
The cover art and solicitation text for Force Works 2020 is below:
2020 FORCE WORKS #1 (OF 3)
- MATTHEW ROSENBERG (W)
- JUANAN RAMIREZ (A)
- COVER BY CARLOS GOMEZ
- VARIANT COVER BY BEN OLIVER
- VARIANT COVER BY TBA
- The eruption of a violent robot revolution threatens all manner of biological life! Teetering on the precipice of extinction, there’s only one man with enough tactical skill, killer instinct and ruthless leadership to lead the rebellion: War Machine! Join War Machine and his elite paramilitary squad (U.S.Agent, Mockingbird, and Quake) in the final crusade for humanity’s fate!
- 32 pages/Rated T+ …$3.99
Force Works 2020 #1, by Matthew Rosenberg and Juanan Ramirez, goes on sale in February 2020 from Marvel Comics.
https://schema.orgBreadcrumbListListItem1Homehttps://www.cbr.com/ListItem2Comicshttps://www.cbr.com/category/comics/ListItem3Comic Newshttps://www.cbr.com/category/comics/news/ListItem4Marvel Resurrects Force Works for Iron Man 2020 Tie-Inhttps://www.cbr.com/marvel-force-works-2020-february/


Description: Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector.
selector: Selector A string containing a selector expression to match elements against.
Given a jQuery object that represents a set of DOM elements, the .prevAll()
method searches through the predecessors of these elements in the DOM tree and construct a new jQuery object from the matching elements; the elements are returned in order beginning with the closest sibling.
The method optionally accepts a selector expression of the same type that we can pass to the $()
function. If the selector is supplied, the elements will be filtered by testing whether they match it.
Consider a page with a simple list on it:

list item 1

list item 2

list item 3

list item 4

list item 5

If we begin at the third item, we can find the elements which come before it:
$('li.third-item').prevAll().css('background-color', 'red');
The result of this call is a red background behind items 1 and 2. Since we do not supply a selector expression, these preceding elements are unequivocally included as part of the object. If we had supplied one, the elements would be tested for a match before they were included.
<!DOCTYPE html>


Used to display user name on dashboard, matches information and user profile.
Used for sending emails about matches status to user.


|
|
def | Type_Name |
| |
|
def | __init__ |
| |
|
def | name |
| |
|
def | set_name |
| |
|
def | clear_name |
| |
|
def | has_name |
| |
|
def | type |
| |
|
def | set_type |
| |
|
def | clear_type |
| |
|
def | has_type |
| |
|
def | meaning |
| |
|
def | set_meaning |
| |
|
def | clear_meaning |
| |
|
def | has_meaning |
| |
|
def | MergeFrom |
| |
|
def | Equals |
| |
|
def | IsInitialized |
| |
|
def | ByteSize |
| |
|
def | ByteSizePartial |
| |
|
def | Clear |
| |
|
def | OutputUnchecked |
| |
|
def | OutputPartial |
| |
|
def | TryMerge |
| |
|
def | __str__ |
| |
|
|
| has_name_ |
| |
|
| name_ |
| |
|
| has_type_ |
| |
|
| type_ |
| |
|
| has_meaning_ |
| |
|
| meaning_ |
| |
|
|
int | STRING = 1 |
| |
|
int | INT32 = 2 |
| |
|
int | BOOLEAN = 3 |
| |
|
int | DOUBLE = 4 |
| |
|
int | POINT = 5 |
| |
|
int | USER = 6 |
| |
|
int | REFERENCE = 7 |
| |
|
tuple | Type_Name = classmethod(Type_Name) |
| |
|
int | has_name_ = 0 |
| |
|
string | name_ = "" |
| |
|
int | has_type_ = 0 |
| |
|
int | type_ = 0 |
| |
|
int | has_meaning_ = 0 |
| |
|
int | meaning_ = 0 |
| |
|
int | kname = 1 |
| |
|
int | ktype = 2 |
| |
|
int | kmeaning = 3 |
| |
The documentation for this class was generated from the following file:
- code/googleappengine-read-only/python/google/appengine/api/prospective_search/prospective_search_pb.py


Keyboard shortcuts to close and save current tab:
Linux: Ctrl + B
Mac: Option + S
Windows: Control + Shift + O
Created by Matthew Stein, Forest Tong, Damodar Sojka, and Tharald Solheim for Hack the Burgh, March 2015


Days without a civilian casualty: {{ days | number:'1.0-0' }}
Main vulnerability: {{ vulnerability }}


cookfs::fsindex - vfs::cookfs::fsindex
Cookfs fsindex provide a low level mechanism for storing mapping between files in cookfs archive and pages they correspond to.
This mechanism should only be used by advanced users and is only documented for reference.
Creates a new fsindex object. If exportedData is specified, index is imported from this data and error is thrown if data is not correct.
If exportedData is not provided, new fsindex is created.
The command returns a fsindex command that can be used to perform actions on index.
Export current index as binary data. This data can be stored in cookfs_pages object and later on imported using cookfs::fsindex command.
List all entries in specified path. Path should be separated by slashes. Specify empty path to list contents of main directory for archive.
Get information about specified entry. Path should be separated by slashes.
Method get returns file information as a list. For directories, this is a single-element list containing file modification time. For files, first element is modification time, second element is file size and third element is a list of block-offset-size triplets.
See BLOCK-OFFSET-SIZE INFORMATION for more details on block-offset-size triplets.
Get file modification about specified entry. Path should be separated by slashes.
Set information about specified entry. Path should be separated by slashes. If data is omitted, new entry is created as directory.
If data specified, entry is created as file and data is created as block-offset-size triplets.
See BLOCK-OFFSET-SIZE INFORMATION for more details on block-offset-size triplets.
Set file modification about specified entry. Path should be separated by slashes.
Deletes specified entry. Path should be separated by slashes.
Delete fsindex object. Frees up all memory associated with an index.
Get metadata with specified name from an index, if it exists. If metadata does not exist, defaultValue is returned if specified. If metadata does not exist and defaultValue is not specified, an error is thrown.
Set metadata with specified name to value. Overwrites previous value if it existed.
Removes metadata with specified name from index.
Files in cookfs are described storing block-offset-size triplets. These specify block (index of cookfs page), offset in the page and size of the data in a page. Each 3 elements of a list describe one part of a file.
For example {1 0 2048} specifies that page with index 1 should be used, data starts at offset 0 and that data is 2048 bytes. Index data of {0 0 65536 1 10240 40960} specifies that data is first stored in page 0 and uses 65536 bytes from this page. Next, data is stored in page 1 from 10240-th byte and uses up another 40960 bytes. This means that file's total size is 106496 bytes.
Cookfs index only stores block-offset-size triplets and calculates size based on all sizes of its elements. Therefore setting cookfs data only requires specifying list itself, not summed up size of the file.
cookfs_fsindex
cookfs, vfs
Copyright © 2010-2011 Wojciech Kocjan <wojciech@kocjan.org>


Functionality: Current temperature / weather, step by step directions, live road data, info graphics
Link to youtube videoHow to Use:
Sidenav
View Control
Clicking on the map:
Clicking once on the map will put down a marker.
Clicking again will find a path for you to take
Github link: https://github.com/prateekgarg/RightHereRightNow
Steps to download:
Option 1 - Click "Download ZIP" button on github. This will give you a static copy of our source code
Option 2 - Clone our git copying the clone Url "https://github.com/prateekgarg/RightHereRightNow.git"


runCommands = (context, commands, cb) ->
currentCommandNumber = 0
runCommand context, commands, currentCommandNumber, (err) ->
cb err if typeof cb is 'function'
Runs a list of commands in sequential order, then executes a callback function, if one is provided
@context {Object}
@commands {Array}
@cb {Function}
runCommands = (context, commands, cb) ->
currentCommandNumber = 0
runCommand context, commands, currentCommandNumber, (err) ->
cb err if typeof cb is 'function'
Runs a given command, and delegates the command result to the handler
@context {Object}
@commands {Array}
@currentCommandNumber {Number}
@cb {Function}
runCommand = (context, commands, currentCommandNumber, cb) ->
commandToRun = commands[currentCommandNumber]
context[commandToRun] (result) ->
context.libs.handler commands, currentCommandNumber, result, context, cb
attach = (libs) ->
libs.runner = {runCommands, runCommand}
Expose the attach function
module.exports = attach