Definition for replacement in proposal B (early binding)

Modification of "in-scope" for EXISTS:

Assignment (an "AS") to a variable which is in-scope for the FILTER is 
not allowed.



-----------------------------
== Definition: Projection Expression Variable Remapping

For a projection algebra operation P with set of variables PV, define

    F = mapping from V to V.
       such that
       F(v) = v if v in PV
       F(v) = v1, v1 a variable with a name not used in the query
                     and not used in any other projection mapping.

Define the project mapping PrjMap(P,PV) to be the algebra expression P 
(and the subtree over which the projection is defined) with F applied to 
every variable of the algebra expression over which P is evaluated.


== Definition: Variable Remapping

For any algebra expression X, not a projection:

PrjMap(X) = replace all project operations with  PrjMap(P,PV) for each 
projection in X.


== Definition: Replace(pattern, μ)

For solution mapping μ, define Table(μ) be the multiset forms from μ.

Table(μ) = ToMultiSet(solution sequence { μ })

Replace(X, μ) is
If X is a BGP ,
     replace X with join(X, Table(μ))

If X is a property path expression,
     replace X with join(P, Table(μ))

If X is Graph(Var, pattern)
     replace X with join(X, Table(μ))


== Definition: Evaluation of Exists

Let μ be the current solution mapping for a filter and X a graph pattern:

exists(X) = true if and only if
               eval(D(G), Replace(PrjMap(X), μ)
             is a non empty solution sequence.

exists(X) = false otherwise

Received on Thursday, 17 November 2016 13:42:30 UTC