Re: Review SPARQL Query 1.1, Section 18 (algebra)

>>> Here an example: query pattern is
>>> { ?s :p ?o FILTER EXISTS { ?s p' ?o } }
>>> I replace the EXISTS
>>> { ?s :p ?o FILTER exists(Bgp(?s p' ?o)) }
>>> and continue
>>> Filter(exists(Bgp(?s :p' ?o)), Bgp(?s :p ?o)) (simplified already)
>>> then evaluate
>
> here comes the problem. I have to evaluate
>>> eval(D(G), Filter(…))
> so I go to the definition of filter evaluation (18.5), which tells me
>
> eval(D(G), Filter(F, P)) = Filter(F, eval(D(G),P))
>
> in my example that is:
>>> = Filter(exists(…), Eval(D(G),Bgp(…)))
>
> Now Filter(.) is define in 18.4
> Filter(expr, Ω) = { μ | μ in Ω and expr(μ) is an expression that has an
>            effective boolean value of true }
>
> but in my example expr is actually exists(Bgp(?s :p' ?o)), and just
> proceeding here as told doesn't really work.
>
> I would rather need something like
> Filter(expr, Ω) = { μ | μ in Ω and either
>      (a) expr is exists(...) and eval(D(G), substitute(pattern, μ)) is
> a non-empty sequence, or
>      (b) expr(μ) is an expression that has an effective boolean value of true }

I've made changes:

1/ http://www.w3.org/2009/sparql/docs/query-1.1/rq25.xml#defn_algFilter

Definition: Filter
Filter(expr, Ω, D(G)) = { μ | μ in Ω and expr(μ) is an expression that 
has an effective boolean value of true }
    Note that evaluating an exists(pattern) expression uses
    the dataset and active graph, D(G).
    See the evaluation of filter.
 
2/ http://www.w3.org/2009/sparql/docs/query-1.1/rq25.xml#defn_evalFilter

Definition: Evaluation of Filter(F, P)

eval(D(G), Filter(F, P)) = Filter(F, eval(D(G),P), D(G))

and moved the definitions for substitute and exists next to eval of Filter.

I don't think it's helpful to rewrite the whole of expression evaluation 
to include D(G) but instead use language and highlight that the context 
of evaluation can provide it.

 Andy

Received on Monday, 2 May 2011 20:10:52 UTC