-- QR1: Select all elements with aSixtyFour = 2 (Return only the element in question) |
//eNest[@aSixtyFour=2]/@aUnique1
-- QR2: Select all elements with aSixtyFour = 2 (Return the element and all -- its immediate children) |
//eNest[@aSixtyFour=2]
-- QR3: Select all elements with aSixtyFour = 2 (Return the entire subtree) |
//eNest[@aSixtyFour=2]/@aUnique1
-- QR4: Select all elements with aSixtyFour = 2 and selected descendants with aFour = 1 |
//eNest[@aSixtyFour=2]/@aUnique1|//eNest[@aSixtyFour=2]//eNest[@aFour=1]/@aUnique1
-- QS1: Select elements with aString = 'Sing a song of oneB4' |
//eNest[@aString = 'Sing a song of oneB4']/@aUnique1
-- QS2: Select elements with aString = 'Sing a song of oneB1' |
//eNest[@aString = 'Sing a song of oneB1']/@aUnique1
-- QS3: Select elements with aLevel = 10 |
//eNest[@aLevel=10]/@aUnique1
-- QS4: Select elements with aLevel = 13 |
//eNest[@aLevel=13]/@aUnique1
-- QS5: Select nodes that have aSixtyFour between 5 and 8. |
//eNest[@aSixtyFour>=5][@aSixtyFour<=8]/@aSixtyFour
-- QS6: Select nodes with aLevel = a13 and have the returned nodes sorted by aSixtyFour attribute. |
//eNest[@aLevel=13] sortby(./@aSixtyFour)/@aSixtyFour
-- QS7: Select nodes with aSixteen = 1 and aFour = 1. |
//eNest[@aSixteen=1][@aFour=1]/@aUnique1
-- QS8: Selection based on the element name, eOccasional |
//eNest//eOccasional/@aRef
-- QS9: Select the second child of every node with aLevel = 7 |
//eNest[@aLevel=7]/eNest[position()=2]/@aUnique1
-- QS10: Select the second child of every node with aLevel = 9 |
//eNest[@aLevel=9]/eNest[position()=2]/@aUnique1
-- QS11: Get 'eOccasional' nodes that have element content -- contains "oneB4" |
//eOccasional[text()~="oneB4"]/@aRef
-- QS12: Get nodes that have element content contains "oneB4" |
//eNest[text()~="oneB4"]/@aUnique1
-- QS13: select all nodes with element content that the distance
-- between keyword "oneB5" and the keyword "twenty" is not more than four |
N/A
-- QS14: select all nodes with element content that the distance between
-- keyword "oneB2" and the keyword "twenty" is not more than four |
N/A
-- QS15: Local ordering. Select the second element with aFour = 1 below
-- each element with aFour = 1 if that second element also has aFour = 1 |
//eNest[@aFour=1]/eNest[@aFour=1][position()=2]/@aUnique1
-- QS16: Global ordering. Select the second element with aFour = 1 below
-- any element with aSixtyFour = 1 |
-- QS17: Reverse ordering. Among the children with aSixteen = 1 of the
-- parent element with aLevel = 13, select the last child |
//eNest[@aLevel=13]/eNest[@aSixteen=1][position()=last()]/@aUnique1
-- QS18: Moderate selectivity of both parent and child. Select nodes with
-- aLevel = 13 that have a child with attribute aSixteen = 3 |
//eNest[@aLevel=13][./eNest[@aSixteen=3]]/@aUnique1
-- QS19: High selectivity of parent and low selectivity of child.
-- Select nodes with aLevel = 15 that have a child with -- attribute aSixtyFour = 3 |
//eNest[@aLevel=15][./eNest[@aSixtyFour=3]]/@aUnique1
-- QS20: Low selectivity of parent and high selectivity of child.
-- Select nodes with aLevel = 11 that have a child with -- attribute aFour = 3 |
//eNest[@aLevel=11][./eNest[@aFour=3]]/@aUnique1
-- QS21: Moderate selectivity of both ancestor and descendant. Select
-- nodes with aLevel = 13 that have a descendant with aSixteen = 3 |
//eNest[@aLevel=13][.//eNest[@aSixteen=3]]/@aUnique1
-- QS22: High selectivity of ancestor and low selectivity of descendant
-- Select nodes with aLevel = 15 that have a descendant with -- aSixtyFour = 3 |
//eNest[@aLevel=15][.//eNest[@aSixtyFour=3]]/@aUnique1
-- QS23: Low selectivity of ancestor and high selectivity of descendant
-- Select nodes with aLevel = 11 that have a descendant with -- aFour = 3 |
//eNest[@aLevel=11][.//eNest[@aFour=3]]/@aUnique1
-- QS24: Moderate selectivity of both ancestor and descendant.
-- Select nodes with aSixteen = 3 that have a descendant with -- aSixteen = 5 |
//eNest[@aSixteen=3][.//eNest[@aSixteen=5]]/@aUnique1
-- QS25: High selectivity of ancestor and low selectivity of descendant
-- Select nodes with aFour = 3 that have a descendant with -- aSixtyFour= 3 |
//eNest[@aFour=3][.//eNest[@aSixtyFour=3]]/@aUnique1
-- QS26: Low selectivity of ancestor and high selectivity of descendant
-- Select nodes with aSixtyFour = 9 that have a descendant with -- aFour = 3 |
//eNest[@aSixtyFour=9][.//eNest[@aFour=3]]/@aUnique1
-- QS27: Low selectivity of ancestor and high selectivity of descendant
-- Select nodes with aSixtyFour = 9 that have a descendant with -- aFour = 3. Return a pair of ancestor and descendant nodes. |
//eNest[@aSixtyFour=9][.//eNest[@aFour=3]]/@aUnique1|//eNest[@aSixtyFour=9]//eNest[@aFour=3]/@aUnique1
-- QS28: One chain query with three parent-child joins with the selectivity
-- pattern: high-low-low-high, to test the choice of join order in -- evaluating a complex query. To achieve the desired selectivities, -- we use the following predicates: aFour = 3, aSixteen = 3, -- aSixteen = 5, and aLevel = 16 |
//eNest[@aFour=3][./eNest[@aSixteen=3]/eNest[@aSixteen=5]/eNest[@aLevel=16]]/@aUnique1
-- QS29: One twig query with two parent child selection, low seletivity of
-- parent aLevel = 11, high selectivity of left child aFour = 3, -- and low selectivity of right child aSixtyFour = 3 |
//eNest[@aLevel=11][./eNest[@aFour=3]][./eNest[@aSixtyFour=3]]/@aUnique1
-- QS30: One twig query with two parent child selection, low seletivity of
-- parent aLevel = 11, high selectivity of left child aFour = 3, -- and low selectivity of right child aSixtyFour = 3 |
//eNest[@aFour=1][./eNest[@aLevel=11]][./eNest[@aSixtyFour=3]]/@aUnique1
-- QS31: One chain query with three ancestor-descendant joins with the selectivity
-- pattern: high-low-low-high, to test the choice of join order in -- evaluating a complex query. To achieve the desired selectivities, -- we use the following predicates: aFour = 3, aSixteen = 3, -- aSixteen = 5, and aLevel = 16 |
//eNest[@aFour=3][.//eNest[@aSixteen=3]//eNest[@aSixteen=5]//eNest[@aLevel=16]]/@aUnique1
-- QS32: One twig query with two ancestor descendant selection, low selectivity
-- of ancestor aLevel = 11, high selectivity of one descendant aFour = 3, -- and low selectivity of another descendant aSixtyFour = 3 |
//eNest[@aLevel=11][.//eNest[@aFour=3]][.//eNest[@aSixtyFour=3]]/@aUnique1
-- QS33: One twig query with two ancestor descendant selection, low selectivity
-- of ancestor aFour = 1, low selectivity of one descendant aLevel = 11, -- and low selectivity of another descendant aSixtyFour = 3 |
//eNest[@aFour=1][.//eNest[@aLevel=11]][.//eNest[@aSixtyFour=3]]/@aUnique1
-- QS34: One twig query with two ancestor descendant selection, high selectivity
-- of ancestor aFour = 1, low selectivity of a child with aLevel = 11, -- and low selectivity of another descendant aSixtyFour = 3 |
//eNest[@aFour=1][./eNest[@aLevel=11]][.//eNest[@aSixtyFour=3]]/@aUnique1
-- QS35: Missing Elements. Find all BaseType elements that there is
-- no OccasionalType elements below them. -- 1) Find all BaseType elements that there is some OccasionalType -- elements below them. -- 2) Return elements that are not in 1) |
//eNest[count(./eOccasional)=0]/@aUnique1
-- QJ1: Low selectivity join: select nodes with aSixtyFour = 2 and join
-- with themselves based on the equality of aUnique1 attribute |
//eNest[@aSixtyFour=2][@aUnique1=//eNest[@aSixtyFour=2]/@aUnique1]/@aUnique1
-- QJ2: High selectivity join: select nodes with aSixteen = 2 and join
-- with themselves based on the equality of aUnique1 attribute. |
//eNest[@aSixteen=2][@aUnique1=//eNest[@aSixteen=2]/@aUnique1]/@aUnique1
-- QJ3: Low selectivity join: select all OccasionalType nodes that point to
-- a node with aSixtyFour = 3 |
//eOccasional[@aRef=//eNest[@aSixtyFour=3]/@aUnique1]/@aRef
-- QJ4: High selectivity join: select all OccasionalType nodes that point to
-- a node with aFour = 3 |
//eOccasional[@aRef=//eNest[@aFour=3]/@aUnique1]/@aRef
-- QA1: Over all nodes at level 15, compute the average value for the
-- aSixtyFour attribute |
avg(//eNest[@aLevel=15]/@aSixtyFour)
-- QA2: Over all nodes at all levels, compute the average value for the
-- aSixtyFour attribute |
avg(//eNest groupby(@aLevel)/@aSixtyFour)
-- QA3: Select elements that have at least two occurrences of keyword "oneB1"
in their content |
N/A
-- QA3: Amongst the nodes at level 11, find the node(s) with the largest
-- fanout. |
//eNest[@aLevel=11][count(./eNest)=max(count(//eNest[@aLevel=11]/eNest))]/@aUnique1
-- QA5: select elements that have at least two children that satisfy
-- aFour = 1 |
//eNest[count(./eNest[@aFour=1])>=2]/@aUnique1
-- QA6: For each node at level 7 (7,3), determine the height of the
-- sub-tree rooted at this node |
N/AQU1-QU6
N/A