Re: Successive Bindings, cascaded queries in Algae2

Eric Prud'hommeaux wrote:
> In his issues WBS response, Kendall mentioned Algae's approach to
> cascaded queries. I propose SPARQL adopt the same approach, which is:
> 
> The Algae2 results set [1] holds the know bindings at any point. It is
> defined as starting as a single result with no bindings (what we were
> calling "true" in DAWG). asks [2] are made of decls [3] which have the
> following semantics:
> 
> [[
> A single decl specifies that each result in the result set be
 > replaced by (zero or more) results obtained from the following
 >  two steps:
> 1 Substitute the variables from that result for the variables
 >   in the decl and search for the resulting triple in the
 >  (current) database.
> 2 Evaluate the constraints on the triples obtained from step 1.
> ]]

If I understand this correctly, the results (bindings) pass from stage to stage, 
  If so, then roughly, "yes" if you want to think of SPARQL in that way.

a/ Constraints do not have to executed last.  As soon as the vars are bound is a 
good time (n.b. issues about BOUND here).

b/ To be clear, once a solution has a binding, it can't be changed.

> 
> Thus, successive asks are constrained by the values bound in the
> result set by earlier asks.  This, and the ability to target queries,
> was used in the pharma federation example [4].
> 
> The SPARQL spec goes to some effort to make sure that the clauses in a
> query can be executed in any order. This is compatible with successive
> bindings, though some formulations of a query may be much more
> efficient than others.

I have some ideas on a generalisation and simplification of the optionals/2 var 
rule that define the order as much as needed by allow impls to do their best.

 Andy

> 
> [1] http://www.w3.org/2004/05/06-Algae/#resultSet
> [2] http://www.w3.org/2004/05/06-Algae/#doc-algae-askStr
> [3] http://www.w3.org/2001/sw/DataAccess/rq23/#query
> [4] http://www.w3.org/2004/10/04-pharmaFederate/

Received on Wednesday, 26 January 2005 13:51:06 UTC