Re: ISSUE-68 definition of pre-binding

On 22/03/2016 4:08, Peter F. Patel-Schneider wrote:
> The definition of pre-binding in the current editors' draft says
>
> pre-binding a variable with a value means that, prior to evaluating a query,
> the SHACL processor needs to substitute all occurrences of the variable in the
> query (including inner scopes and nested SELECT queries) with the provided value.
>
> This does not match my intuitions on how pre-binding should work.
>
> It may match what happens in practice, but I think that for this definition to
> be acceptable there will have to be a determination that most SPARQL
> implementations use this definition.

There are no existing implementations of SHACL, and while I agree it 
would be ideal if we could simply hook into existing implementations of 
pre-binding, I don't see how we can realistically make this a requirement.

Having said this, Jena has 3 different implementations of pre-binding:
1) QueryExecution.setInitialBindings (used by SPIN)
2) Parameterized SPARQL strings (text-based, does not support bnodes)
3) Query syntax tree transform (this is closest to what SHACL would use)
AFAIK Sesame uses a similar technique to 3, i.e. it inserts variable 
values into a parsed Query syntax tree. Then, whenever a variable is 
queried, the system will check if that ?var has a pre-bound value already.

Instead of relying on the textual syntax of SPARQL (which introduces 
problems such as bnodes), could we describe the desired behavior in 
terms of how Sesame does it? I.e. along the lines of "Given an internal 
representation of a SPARQL query (such as Algebra or Query objects in 
Java) pre-binding has the effect that the evaluation of a variable 
returns the constant of the pre-binding.".

>
> There is also no indication of when invalid pre-bindings are supposed to be
> reported or how.

The Appendix tried to enumerate those cases. I am not sure what else 
needs to be said here. Do you want us to clarify what kind of error 
needs to be reported and when? We don't do that in other places either.

>
>
> The appendix on pre-binding should be sent by several SPARQL experts to see if
> they think that it is reasonable.

Yes, that should definitely be part of the review. I asked before 
whether W3C has any process to gather such feedback.

Holger


>
>
>
> peter
>
>

Received on Monday, 21 March 2016 23:22:28 UTC