30.08.2014 Views

url - Universität zu Lübeck

url - Universität zu Lübeck

url - Universität zu Lübeck

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.2. A MODEL FOR PATH EXPRESSIONS 51<br />

Definition 12 (Model Mod(p))<br />

It is obvious that Mod(p) ⊆ T .<br />

Mod(p) ::=<br />

{<br />

}<br />

t ∈ T | p(t) ≠ ∅<br />

Lemma 2 Mod(p) = ∅ or Mod(p) is infinite.<br />

If p is not satisfiable (e.g. 1 ) Mod(p) = ∅. On the other hand, if we have t 1 ∈ Mod(p)<br />

we are able to create t 2 by adding an arbitrary node (element) to t 1 . Then t 2 will<br />

also be ∈ Mod(p) because p will select the same nodes in t 2 as in t 1 . Therefore, the<br />

set Mod(p) is infinite (without proof).<br />

<br />

An algorithm that decides whether an XML data t is ∈ Mod(p) is introduced in<br />

section 7.2.2.<br />

In order to process path expressions with automaton theory, in section 7.2.2 we<br />

need access to the nodes of a path expression.<br />

Definition 13 (Function nodes(p) : P l → N Pl )<br />

The function nodes(p) returns a set consisting of all node tests of the linear path<br />

expression p. The set of all path expression nodes is denoted with N Pl .<br />

<br />

Analogously to nodes in the XML model the functions<br />

• p.root returns the root node of a linear path expression p;<br />

• n.label with n ∈ N Pl returns the label of n;<br />

• n.children returns the one child node of n if it exists or ∅ otherwise;<br />

• n.descendant returns the one descendant node of n if it exists or ∅ otherwise;<br />

Example 6 p = /a//b/ ∗ /b//a with p ∈ P l has the following properties:<br />

nodes(p) = {a 1 , a 2 , b 1 , b 2 , ∗ 1 }<br />

root(p) = a 1<br />

a 1 .label = a<br />

a 2 .label = a<br />

b 1 .label = b<br />

b 2 .label = b<br />

1 p=//a[b and not(b)]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!