next up previous
Next: Coalesce Up: Additional Query Operators Previous: Slice

   
Collapse

In this section, the $Path{\it Collapse\/}\xspace_{\Gamma}$ operation introduced in Section 3.2.1 is trivially generalized to collapse every path in a set of paths. Typically, ${\it Match\/}\xspace_{\it DB\/}$ first chooses a set of paths that match some regular expression, then the paths are collapsed, and a property is coalesced from the collapsed paths.


[ ${{\it Collapse\/}\xspace}_{\Gamma}:
2^{\it PATHS\/} \rightarrow 2^{\it EDGES\/}$]

A set of paths, S, is collapsed by collapsing each path independently.


		${\it Collapse\/}\xspace_{\Gamma}(S) \stackrel{\scriptstyle \triangle}{=}\{ {\it...
...t\/}\xspace_{\Gamma}(P)~\vert~ P \in S~\land~{\it Valid\/}\xspace_{\Gamma}(P)\}$
`$\mathchoice{\raisebox{-.3ex}{\vbox{\hrule width5pt height2.5pt
\hrule width5pt...
...dth5pt height2.5pt
\hrule width5pt height2.5pt
\hrule width5pt height2.5pt}}}$2


The utility of an operation like Collapse has been investigated in other semistructured query languages where it has been called ``pull-up'' [1]. In Lorel, Collapse is not an operation at the query language level; rather, it is used in the implementation to compute the value of a path variable.




Copyright © 1998. Curtis E. Dyreson, Michael H. B&. All rights reserved.