• No results found

In this section, we present the query workload. The semantics of each query is provided.

Query category 1 (complex predicate) XPath queries in the first category all have a complex predicate that requests for a comparison of descendants with other descendants or other elements. We specify the semantics of this category as follows:

Query 1.1: requests the title of all movies m for which an actor of m is also director of m. return //movie[(.//actor/name/string() = .//director/string())]/title

Query 1.2: requests the title of all movies m for which an actor of m is also director. return //movie[(.//actor/name/string() = //director/string())]/title

Query 1.3: requests the title of all movies m for which an director of m is also actor. return //movie[(.//director/string() = //actor/name/string())]/title

Query 1.4: requests the title of all movies m for which an actor of m is also director and a director of m is also actor.

let $p := //movie[(.//actor/name/string() = //director/string())]/title let $q := //movie[(.//director/string() = //actor/name/string())]/title return $p intersect $q

Query 1.5: requests the title of all movies m for which the genre of m is ‘Comedy’ and there does not exists a possible world in which m has the genre ‘Comedy’ and ‘Family’.

let $p := //movie[./genres/genre/string() = "Comedy"]/title let $q := //movie[./genres/genre/string() = "Family"]/title return $p except possible ($p intersect $q)

Query 1.6:requests the title of all movies m for which an director or actor of m are also director or actor in another movie m0 that has the title ‘Aventuras de las hermanas X’.

let $m_title := ’Aventuras de las hermanas X’ let $m := //movie[./title/string() = $m_title]

let $p := $m//actor/name; let $q := $m//director; let $pq := $p | $q return //movie[(.//actor/name | .//director)/string() = $pq/string()]

[compare(./title/string(), $m_title) != 0]/title

Query category 2 (foll/prec sibling) Each following XPath query in the second category increases the number of location steps that involve the following-siblining/preceding-sibling axis. We specify the semantics of this category as follows:

let $genre := ’Horror’

Query 2.1: requests for all occurrences of the genre ‘Horror’. return //movie/descendant::genre[string() = $genre]

Query 2.2: requests for all occurrences of a genre that is a following-sibling of the genre ‘Horror’. return //movie/descendant::genre[string() = $genre]/following-sibling::genre

Query 2.3: requests for all occurrences of a genre g that is a following-sibling of the horror genre g0 for which holds that the preceding-sibling of g is also of the horror genre g00. Note that queries 2.2 and 2.3 have the same result.

return //movie/descendant::genre[string() = $genre]/following-sibling::genre [./preceding-sibling::genre[string() = $genre]]

Query 2.4: requests for all occurrences of a genre g that is a following-sibling of the horror genre g0 for which holds that the preceding-sibling of g is also of the horror genre g00and the following-sibling of genre g00is the same genre as g .

return //movie/descendant::genre[string() = $genre]/following-sibling::genre

146 C.1. QUERY WORKLOAD

[./preceding-sibling::genre[string() = $genre]/ following-sibling::genre/string() = ./string()]

Query category 3 (anc/desc) Each following XPath query in the third category increases the number of location steps that involve the ancestor/descendant axis. We specify the semantics of this category as follows:

let $genre := ’Comedy’

Query 3.1: requests for all movies that have the genre ‘Comedy’. return //genre[./string() = $genre]/ancestor::movie

Query 3.2: requests for all titles of movies that have the genre ‘Comedy’.

return //genre[./string() = $genre]/ancestor::movie/descendant::title

Query 3.3:requests for all movies that have a title of a movie with the genre ‘Comedy’. Note that queries 3.1 and 3.3 have the same result if all movies in the result of 3.2 have a title.

return //genre[./string() = $genre]/ancestor::movie/descendant::title /ancestor::movie

Query 3.4: requests for all titles of movies that have a title of a movie with the genre ‘Comedy’. Note that queries 3.2 and 3.4 have the same result.

return //genre[./string() = $genre]/ancestor::movie/descendant::title /ancestor::movie/descendant::title

Query category 4 (par/child) Each following XPath query in the fourth category increases the number of location steps that involve the parent/child axis. We specify the semantics of this category as follows:

let $actor_name := ’Solomon, Regina’

Query 4.1: requests for the role of all actors a of which the name of a is ‘Solomon, Regina’. return //actor[name/string()=$actor_name]/child::role

Query 4.2: requests for the parent of the role of all actors a of which the name of a is ‘Solomon, Regina’. Since the parent of a role is the actor, query 4.2 requests for actors a of which the name of a is ‘Solomon, Regina’

return //actor[name/string()=$actor_name]/child::role/parent::*

Query 4.3: requests for the child of the parent of the role of all actors a of which the name of a is ‘Solomon, Regina’. Query 4.3 requests for the same result as query 4.1.

return //actor[name/string()=$actor_name]/child::role/parent::*/child::role

Query 4.4: requests for the parent of the child of the parent of the role of all actors a of which the name of a is ‘Solomon, Regina’. Query 4.4 requests for the same result as query 4.2.

return //actor[name/string()=$actor_name]/child::role/parent::*/child::role/parent::*

Query category 5 (simple predicate) XPath queries in the fifth category all have a simple predicate that requests for the existence of some element in one axis. We specify the semantics of this category as follows:

Query 5.1: requests the title of movies m in which a director ‘Thomas, Ralph (I)’ directs and the genre of m is ‘Comedy’.

//genre[./string() = ’Comedy’]/ancestor::movie[directors/director /string() = ’Thomas, Ralph (I)’]/descendant::title

Query 5.2: requests all ancestors of an actor a of which the name of a is ‘Mehaffey, Blanche’. //actor[name/string()=’Mehaffey, Blanche’]/ancestor::*

Query 5.3: requests all horror genres g that are following-sibling of a comedy genre g0. //movie/genres/genre[string() = ’Comedy’]

/following-sibling::genre[string() = ’Horror’]

Query 5.4: requests all descendants of movie m for which the title is ‘Trials of a Movie Cartoonist, The’. //movie[title/string() = ’Trials of a Movie Cartoonist, The’]/descendant::*

Query 5.5: requests the title of all movies in which a director d has a name that starts with an ‘A’. //director[substring(./string(),1,1) = ’A’]/ancestor::movie/title

APPENDIX C. BENCHMARK DETAILS 147

Related documents