W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > October 2006

RE: Definition of FilteredBasicGraphPattern in SPARQL grammar

From: Seaborne, Andy <andy.seaborne@hp.com>
Date: Thu, 26 Oct 2006 18:49:07 +0100
Message-ID: <86FE9B2B91ADD04095335314BE6906E884DA91@sdcexc04.emea.cpqcorp.net>
To: "Arjohn Kampman" <arjohn.kampman@aduna-software.com>
Cc: <public-rdf-dawg-comments@w3.org>

-------- Original Message --------
> From: Arjohn Kampman <>
> Date: 26 October 2006 16:48
> It took me quite some time to understand the production rule for
> FilteredBasicGraphPattern in the SPARQL grammar, due to the
> recursiveness of the definition. I think this production rule
> in combination with BlockOfTriples can be reformulated to one of the
> following, much simpler, definitions:
> FilteredBasicGraphPattern ::=
>          ( (TriplesSameSubject|Constraint) '.'? )*
> As far as I can see, there is only one difference between these rules
> and the rules from the grammar: The rules from the grammar allow
> multiple dots after TriplesSameSubject blocks and zero or one dot
> Constraint blocks, whereas the above rule only allows zero or one dot
> after both blocks. Alternatively, the above rule can be slightly
> modified to allow multiple dots after (both) blocks.
> --
> Arjohn Kampman, Senior Software Engineer
> Aduna - Guided Exploration
> www.aduna-software.com


Thanks for the observation.

[22] BlockOfTriples ::=
	TriplesSameSubject ( '.' TriplesSameSubject? )*

should be 

[22'] BlockOfTriples ::=
	TriplesSameSubject ( '.' BlockOfTriples? )?

TriplesSameSubject can not be empty so BlockOfTriples can't be.
More recursion I'm afraid - it's the way that "must see before" is
handled in the grammar.

It used to be based on:
[28]    	Triples  	  ::=    	Triples1 ( '.' Triples?

(I'm hoping to find time to work through the grammar and remove the
recursion where possible - sometimes it is just the easiest way to
approach the problem though.)

> FilteredBasicGraphPattern ::=
>          ( (TriplesSameSubject|Constraint) '.'? )*

allows ?s ?p ?o ?s1 ?p ?o as '.' is completely optional.

By the way - the grammar is being changed around here to move
constraints out into groups.

I just applied the equivalent of [22'], after having added multiple
adjacent dots tests to the test suite as "parse error expected" tests,
and the grammar passes.

The development test suite is under

Manifests uses an extended vocabulary to merge manifests and to mark
syntax and bad syntax test cases.

Received on Thursday, 26 October 2006 17:49:22 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:52:07 UTC