Hello, dear friend, you can consult us at any timeif you have any questions, add WeChat: daixieit

COMPSCI 752

Big data management
Assignment 1 / Semester 1, 2026
Web Data Modelling and Access
Student ID:
Name:

Comments

The maximum mark achievable is 25. The assignment contributes up to 6.25% to your total marks for the course.

Submission

Please submit your solutions as a single pdf file on CANVAS by Sunday, 29 March 2026.

Penalty Dates

The assignment will not be accepted after the last penalty date unless there are special circumstances (e.g., sickness with certificate). Penalties will be calculated as follows as a percentage of the mark for the assignment.

By
11:59pm, Sun 29 March 2026 No penalty
11:59pm, Mon 30 March 2026 25% penalty
11:59pm, Tue 32 March 2026 50% penalty

1. XML and XPath [12 marks]

Consider the tree in Figure 1, with the element root on top. Element nodes are labelled by the upper-case letter E. The tags of a node are indicated as lower-case letters a or b.

The context node for Question 1(b) is marked pink.

Figure 1: Tree for Question 1. The pink node is the context node for part (b).

(a) For each node of the tree, write down the corresponding pre- and post-identifier. [3 marks]

(b) With respect to the given context node, marked in pink, evaluate the following axes on the tree. List the pre-identifier of each node that each axis returns. [3 marks]

i. self::*
ii. descendant::*
iii. ancestor::*
iv. preceding::*
v. following::*

(c) Convert each of the following English language queries into the corresponding XPath expression, and evaluate it on the tree by listing the pre-identifier of the nodesreturned. [3 marks]

i. Return b-element nodes that are grandchildren of some element node

ii. Return element nodes which have the same number of b-element ancestors and a-element descendants

iii. Return the b-element nodes that are the third child of some b-element node

(d) Convert each of the following XPath expressions into an English language query that is as simple as possible, and return the pre-identifier of all nodes in the answer to the query on the given tree. [3 marks]

i. //*[2]
ii. //*[a and //b[2]]
iii. //b[b[preceding-sibling::a]]

2. XQuery [13 marks]

Consider the following XML document (the prologue has been omitted).

< store >
< app title = " Cosmic ␣ Defender " >
< category > Games </ category >
< price > 4.99 </ price >
< rating >5 </ rating >
< language > English </ language >
< language > Spanish </ language >
< language > Japanese </ language >
</ app >
< app title = " Word ␣ Master " >
< category > Education </ category >
< price > 2.99 </ price >
< rating >4 </ rating >
< language > English </ language >
< language > French </ language >
</ app >
< app title = " Pixel ␣ Quest " >
< category > Games </ category >
< price > 7.99 </ price >
< rating >4 </ rating >
< language > English </ language >
< language > German </ language >
< language > Korean </ language >
</ app >
< app title = " Budget ␣ Tracker " >
< category > Finance </ category >
< price > 0.99 </ price >
< rating >3 </ rating >
< language > English </ language >
</ app >
< app title = " Galaxy ␣ Runner " >
< category > Games </ category >
< price > 12.99 </ price >
< rating >5 </ rating >
< language > English </ language >
< language > French </ language >
< language > Chinese </ language >
< language > Arabic </ language >
</ app >
</ store >
Write down the following English language queries in XQuery, and show the result of evaluating the XQuery query on the given XML document.

(a) Return each distinct category for which every app of that category has no rating lower than 4 and is supported by at least two languages. [4 marks]

(b) For each language supported by at least one app, return the title of each app that supports the language. [4 marks]

(c) Return the average price of all apps in the category Games that are supported by at least three languages and are priced under 10, together with the title for each of those apps. [5 marks]