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

Mismatch with multiple OPTIONAL and grammar?

From: Chimezie Ogbuji <ogbujic@bio.ri.ccf.org>
Date: Mon, 8 May 2006 00:55:54 -0400 (EDT)
To: public-rdf-dawg-comments@w3.org
Message-ID: <Pine.GSO.4.60.0605080037110.11908@joplin.bio.ri.ccf.org>

While writing a parser for sparql-p, I ran into a situation with 
OPTIONs that is unclear in the spec (5.1) and grammar.

The following rules (rule 20 in particular):

[20] GraphPattern ::= FilteredBasicGraphPattern (GraphPatternNotTriples '.'? GraphPattern )? 
[21] FilteredBasicGraphPattern ::=  BlockOfTriples? (Constraint '.'? FilteredBasicGraphPattern )?

Seem to allow for the following pattern:

patternA OPTIONAL { patternB } patternC OPTIONAL { patternD }

The main difference from the OPTIONAL examples is the juxtaposition of 
patternC in-between the patterns.  If this is by design, it's not clear whether this 
should be interpreted as

{patternA} UNION {patternC} OPTIONAL {patternB} OPTIONAL {patternD}

or

{patternA. patternC} OPTIONAL {patternB} OPTIONAL {patternD}


Perhaps it's just my misunderstanding of how multiple OPTIONALs are meant 
to appear within a GraphPattern

Chimezie Ogbuji
Lead Systems Analyst
Thoracic and Cardiovascular Surgery
Cleveland Clinic Foundation
9500 Euclid Avenue/ W26
Cleveland, Ohio 44195
Office: (216)444-8593
ogbujic@ccf.org
Received on Monday, 8 May 2006 13:04:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:14:50 GMT