Re: Proposed: SPARQL grammar is complete as-is

On 23/12/10 12:09, Steve Harris wrote:
> On 2010-12-23, at 11:58, Andy Seaborne wrote:
>>> I had an action to look at including CONSTRUCT WHERE { ... } for commonality with DELETE WHERE. I've not done anything about that, but it looks to me like it could be included as:
>>> 'CONSTRUCT WHERE' GroupGraphPattern SolutionModifier
>> See discussion:
> I completely forgot that.
> In that case, modulo the stuff I've already mentioned, I think it's OK.
> - Steve

In the spirit of facts, and not mere guesswork, I went back and checked 
on the implications of a "CONSTRUCT WHERE" short form.  It's doable: my 
fears were unfounded.

Based on the discussion around DELETE WHERE, I have only considered a 
BGP or construct template for the WHERE clause.  No FILTER, no other 
graph patterns.

It's not quite like DELETE WHERE because of FROM/FROM NAMED.

It can be done by only changing the rule for CONSTRUCT:

[9]   	ConstructQuery 	  ::=
    # The original rule
    ConstructTemplate DatasetClause* WhereClause SolutionModifier
    # The short form.
    DatasetClause* 'WHERE' '{' TriplesTemplate? '}' SolutionModifier

It may be possible to tidy this up.

In the short form WHERE is mandatory - this enables the parser to know 
it's skipped the template in the full form.

Therefore, I think we should put this in.  The extra editing is quite 
small - adding a short para and example query to the CONSTRUCT section.


Received on Friday, 31 December 2010 13:20:40 UTC