[35 points] Consider the XML data instance Mondial, avaialable
here
(at the bottom of the page). Write XQueries to answer the
following questions. In formulating your questions, you need to
understand how various elements are nested: e.g. what is under a
country, under which element is a city etc. For that
it helps if you inspect the DTD (ignore the warning that the data is
not valid), or inspect the data directly. For each question below
turn in the XQuery, and the result of running the query on the XML
data (which should be an XML document).
- Retrieve all the names of all cities located in Peru, sorted
alphabetically.
- Find all countries with more than 20 provinces.
- Find all ethnic groups that live in more than more than 10
countries.
- Find the countries adjacent to the 'Pacific Ocean' sea.
- Find the names of all countries that have at least 5
mountains over 2000m high, and list the names and heights of all
mountains in these countries (regardless of their height). Note:
the height attribute is in meters, so you don't have to do
any conversions.
- One user is interested in long rivers. Produce the following
view of the data, containing only rivers longer than 2000 (all
units are in km), in the format described below:
- The root element is user and contains several
river elements
- Each rivercontains a name element with the
river's name, and several country elements, one for
each country through which it flows. (Note: some rivers may
not have any country, due to noise in the data. It is OK to
include these rivers, even if they look as they flow through
no country at all.)
- Each country element contains only the name of
the country (a string).
For this question you need to run galax. For that you need
to download it from here. Here is a brief example on how
to run Galax.
Due Date:April 21.