Flexible XPath

Our flexible XPath is defined by means of the following rules:

xpath :=
['['deep-down']' ]path
path :=
literal | text() | node | @att | node/path | node//path
node :=
QName | QName[cond]
cond :=
xpath op xpath | xpath num-op number
deep :=
DOWN=number
down :=
DOWN=number
deep-down :=
deep | down | deep ';' down
num-op :=
> | = | < | <>
fuzzy-op :=
and | and+ | and- | or | or+ | or- | avg | avg{number,number}
op :=
num-op | fuzzy-op

Basically, our proposal extends XPath as follows:

  • A given XPath expression can be adorned with «[DEEP = r1; DOWN = r2]» which means that the deepness of elements is penalized by r1and that the order of elements is penalized by r2, and such penalization is proportional to the distance (i.e., the length of the branch and the weight of the tree, respectively). In particular, «[DEEP = 1; DOWN = r2]» can be used for penalizing only w.r.t. document order. DEEP works for //, that is, the deepness in the XML tree is only computed when descendant nodes are explored, while DOWN works for both / and //. Let us remark that in our preliminary version [3] DEEP and DOWN could only be used at the beginning of the XPath expression, however, now they can be used anywhere, many times into the XPath expression.
  • We consider three versions for each one of the conjunction and disjunction operators (also called connectives or aggregators) which are based in the so-called Product, Gödel and Lukasiewicz fuzzy logics. The Gödel and Lukasiewicz logic based fuzzy symbols are represented by and+, and-, or- and or+, in contrast with product logic operators and and or (see Figure 1). Adjectives like pessimistic, realistic and optimistic are sometimes applied to the Lukasiewicz, Product and Gödel fuzzy logics since operators verify that, for any pair of real numbers x and y in [0, 1]:

    0 ≤ &L(x, y) ≤ &P(x, y) ≤ &G(x, y) ≤ 1

    and the contrary for the disjunction operations:

    0 ≤ |G(x, y) ≤ |P(x; y) ≤ |L(x; y) ≤ 1

    So, note that it is more difficult to satisfy a condition based on a pessimistic conjun- tor/disjunctor (i.e, and-/or- inspired by the Lukasiewicz and Gödel logics, respec- tively) than with Product logic based operators (i.e, and/or), while the optimistic versions of such connectives (i.e., and+/or+) are less restrictive, obtaining a greater set of answers. This is a consequence of the following chain of inequalities:

    0 ≤ &L(x, y) ≤ &P(x, y) ≤ &G(x, y) ≤ |G(x; y) ≤ |P(x; y) ≤ |L(x; y) ≤ 1

    or equivalently, by using our notation:

    0 ≤ and-(x, y) ≤ and(x, y) ≤ and+(x, y) ≤ or-(x, y) ≤ or(x, y) ≤ or+(x, y) ≤ 1

    Fig. 1. Fuzzy Logical Operators

    &P(x, y) = x * y  |P(x, y) = x + y - x * y Product: and/or
    &G(x, y) = min(x; y) |G(x, y) = max(x, y) Gödel: and+/or-
    &L(x, y) = max(x + y - 1, 0) |L(x, y) = min(x + y, 1) Luka.: and-/or+

    Therefore users should refine queries by choosing operators in the previous sequence from left to right (or from right to left), till finding solutions satisfying in a stronger (or weaker) way the requirements.

  • Furthermore, the avg operator is fuzzily defined. Assuming two given RSV's r1 and r2, avg is defined as (r1+r2)=2, and avg{p1, p2} is defined as (p1 *r1+p2 *r2)=p1+ p2.
  • Finally, we have considered an special case of constraint, a thresholding constraint of the form xpath op r, where r ∈ [0, 1] and op ∈ {<, >,=}, in which the can specify the threshold that the RSV of a given fuzzy condition has to raise.

In general, an extended XPath expression defines, w.r.t. an XML document, a sequence of subtrees of the XML document where each subtree has an associated RSV. XPath conditions, which are defined as fuzzy operators applied to XPath expressions, compute a new RSV from the RSVs of the involved XPath expressions, which at the same time, provides a RSV to the node.

izmir escort- cratosslot baymavi vdcasino asyabahis tipobet