SPARQL Federation Extensions 1.1 --- unexpected headache with BINDINGS

Hello Eric and Andy,

I'm implementing the BINDINGS feature and I've found that it's less
compiler-frendly than I've thought initially. While it's 100%
human-readable, it's as inconvenient for fast query parser as C program
would be if #define-s are at the end of code, not before the first use.

In Virtuoso, distinction between external parameters and inner variables
was the first syntax extension I've made for SPARQL. The reasons were:
1. that's mandatory for SPARQL-to-SQL translation because in sql
variable is written as "name" whereas the parameter is ":name" or
":12345" or "?" but the syntax is clearly different;
2. optimizer consider an external parameter as an "constant of unknown
value", not as a variable to bind, and the meaning of { ?s ?p ?local-o }
seriously differs from { ?s ?p ?external-parameter-o }: the latter is
closer to { ?s ?p "value-of-external-parameter-o" };
3. when an important difference in semantics is backed by visible syntax
difference, the compiler can better understand intentions of the query
author and report more warnings; that's double important due to lack of
distinction between intentional use of two similarly named vars and a
typo in one of these names.

I can't propose anything better than a special syntax,
say, ?:parameter-name, for placeholders that are filled from outside.
Having this syntax, BINDINGS may present at the end of the query with
colons in "column titles" or may be replaced with some
implementation-specific way of parameter passing; it will be possible
even pass some parameters via BINDINGS {...} and some via non-standard
infrastructure.

I understand that it's probably too late to introduce a new feature,
even as small as a single colon here and there, but we don't even
describe the whole semantics right now, let it be a little syntax
agreement for BINDINGS right now and a compatible extension of semantics
in SPARQL 1.2 ;)

Best Regards,

Ivan Mikhailov
OpenLink Software
http://virtuoso.openlinksw.com

Received on Monday, 10 May 2010 23:53:06 UTC