• No se han encontrado resultados

RESULTADOS

In document FACULTAD DE CIENCIAS EMPRESARIALES (página 22-26)

In this section, we present the XFM view graph, which is built on top of the XFM view model and a classification of fragments as discussed in the §4.4.1.

RF

V1 : List operation status of stations that have more than 10 bikes available in Dublin in March 2005.

//Worldbikes//city/Dublin[.//year=2005][.//month=03]//stations[.//available>10]/station V2 : List operation status of each station in Dublin on the 16thof March 2005.

//Worldbikes//city/Dublin[.//year=2005][.//month=03][.//day=16]/stations/station

V3 : List bike availability of each station in Dublin for the months of March, April and May after 2005.

//Worldbikes//city/Dublin[.//year≥2005][.//month≥03][.//month<06]/stations//available V4 : List stations in Dublin that always have more than 8 free bicycle stands in March 2005.

//Worldbikes//city/Dublin[.//year=2005][.//month=03]//station[.//free>8]/station V5 : List weather conditions at all stations in Dublin in March 2005.

//Worldbikes//city/Dublin[.//year=2005][.//month=03]//stations//weather

1

Figure 4.5: XML Fragment Materialization View Graph

4.4.1 View Fragments

As outlined previously, the XFM view model is based on a set of algebraic operators where for each of these operators, we define different types of fragments representing the result of the algebraic operators. Basically, a fragment (except Source Fragment) is a sequence of instance nodes resulting from an algebraic operation. As shown in §4.4.2, it is these fragments that can be shared across XML views and when applied to the XFM view model, forms our fragment-based view framework. A sample graph is shown in Figure 4.5, with fragments represented as rectangular boxes. Fragments are categorised into 5 types as listed below:

• Root Fragment (RF) – The RF fragment is a 4-ary tuple <fid, V, n, p >, where fid is the unique identifier assigned to RF; V is a set of views sharing this fragment; n represents the NameTest and the label (tag name) of the return node in p; and p is the tree pattern mapped to RF from which the RF fragment can be evaluated. For a Root Fragment, p is simply a tree with a single node represented by the document node. The RF fragment represents the initial execution context. It contains a sequence with only one instance node, which is the root of an XML tree (also known as the document node). It always represents the starting point of an XFM view graph. While a view graph will contain multiple query representations, they are all joined by the same root fragment, as shown in Figure 4.5, e.g., RF with rectangle box.

• Filter Fragment (FF) – The FF fragment is a 5-ary tuple <fid, V, n, pred, p>, where fid is the unique identifier assigned to FF; V is a set of views sharing this fragment;

nis the NameTest as well as the label (tag name) of the return node in p; pred is the predicate applied to the context sequence; and p is a tree pattern mapped to the FF fragment from which the FF fragment can be evaluated (p is a subpart of the original query). The FF fragment (e.g., FF1 in Figure 4.5) represents the result produced by a select operation. In our view model, the select operation always contains a predicate used to filter an input sequence, e.g., free>8 in Figure 4.5 represents the filter operation that results in FF12.

• Dependency Join Fragment (DF) – The DF fragment is a 6-ary tuple <fid, V, nlef t,

nright, α, p>, where fid is the unique identifier assigned to DF; V is a set of views sharing this fragment; nlef t is the NameTest of the left join operand and the label of (tag name) the return node in p; nrightis the NameTest of the right join operand;

α is the axis of djoin (the relationship between two operands) operation; and p is the tree pattern from which a DF fragment can be evaluated, (p is a subpart of the original query). A DF Fragment (e.g., DF1 in Figure 4.5) represents the sequence resulting from a djoin operation, e.g., the./d

before DF1 represents a dependency join operation, where d indicates the ancestor-descendant relationship.

• Source Fragment (SF) – The SF fragment is a triple <fid, V, n >, where fid is the unique identifier assigned to SF; V is a set of views sharing this fragment; and n represents the NameTest. The SF fragment represents the full set of instance nodes whose labels match n. The major difference between this fragment and all others is that it cannot be reused and merely acts as an operand in a djoin operation.

• View Fragment (VF) – A VF fragment is a 4-ary tuple <fid, V, n, p>, where fid is the unique identifier assigned to VF; V is a set of views sharing this fragment;

nis the NameTest and the label (tag name) of the return node in p, and p is a tree pattern from which a VF fragment can be evaluated (in this case, p equals to the entire query). A VF fragment (e.g., VF1 in Figure 4.5) represents the final result for the view definition. It always follows a deep project operation, e.g., ΠD before VF1 indicates the deep projection.

4.4.2 XFM View Graph

The XFM View graph is a directed acyclic graph consisting of two types of nodes: a frag-ment node denoted by f, and an operation node denoted by o. Fragfrag-ment nodes can have operation nodes only as neighbours and operation nodes can have only fragment nodes as neighbours. The Root Fragment is the root of the XFM view graph. A formal definition of an XFM View Graph is given in Definition 4.7.

Definition 4.7 [XFM View Graph]

An XFM View Graph is a directed acyclic graph represented by a 4-tuple, denoted by G =

< fr, F, O, V >, where fris the RF fragment, F is a set of F-Nodes, O is a set of O-Nodes

and V is a set of views in G. 

A sample XFM view graph is shown in Figure 4.5, where fragment nodes are represented by rectangular boxes and operation nodes by circles, and a list of natural language descrip-tions of the views appearing in the sample graph and the corresponding XPath expressions.

Within an XFM view graph, a simple path determines a path that has distinct edges in a view graph. A simple path starting at the RF fragment and ending at the VF fragment, uniquely identifies an XPath expression/view in an XFM view graph. We use the notation V to rep-resent the view that is uniquely identified by a simple path. We assign a level value to each fragment with the exception of SF fragments, within the XFM view graph. As shown in Figure 4.5, the XFM graph contains five views V1 to V5 that end with VF fragments, VF1, VF2, . . ., VF5, respectively. The fragments in gray, FF7 and DF4 are the only materialised fragments in this graph. Bear in mind that we use it only for the purpose of illustration as the selection algorithm may choose different fragments for materialisation. In the rest of this dissertation, we use fragment and fragment node interchangeably and also algebraic operator and operation node.

In document FACULTAD DE CIENCIAS EMPRESARIALES (página 22-26)

Documento similar