Errata : grammar : problem with compound subject nodes and property paths.

I've come across a problem with the grammar and a user has reported a 
related issue (1).

It comes from composite items in the subject, together with a property 
path, either inside the compound item or following.

Compound items are ways to write bNodes:

[ :p 123 ]
( 1 2 3 )

which, as well as being some triples, also result in a (blank) node that 
can be used as a subject or object.  The subject form is the one that 
matters here; it's also the less frequently used form in my experience.

# OK.
[ :p :o ] :q 123 .
( 1 2 3 ) :q 123 .

# Broken-1
# Property paths after a compound item
[ :p :o ] :q1/:q2 123 .
( 1 2 3 ) :q1/:q2 123 .

# Broken-2
# Property paths inside a compound item
[ :p1/:p2 :o ] :q 123 .
[ :p1/:p2 :o ]  .


1-Analysis

[77]  TriplesSameSubjectPath
    ::=  VarOrTerm PropertyListNotEmptyPath |
         TriplesNode PropertyListPath

so far so good but

[79]  PropertyListPath  ::=  PropertyListNotEmpty?

should be

[79]  PropertyListPath  ::=  PropertyListPathNotEmpty?
                                          ^^^^
so currently no paths after non-empty [ .. ]
and also subject lists.


2-Analysis

[92] TriplesNode  ::=  Collection | BlankNodePropertyList
[93]  BlankNodePropertyList  ::=  '[' PropertyListNotEmpty ']'

and this is shared between query pattern and templates (CONSTRUCT and 
SPARQL Update).

This needs to be split so that query pattern and templates have similar 
but different grammar rules to include or exclude property path syntax.

[77]  TriplesSameSubjectPath ::= ...  TriplesNodePath PropertyListPath
                                       ^^^^^^^^^^^^^^^

[++]   TriplesNodePath  ::=  Collection | BlankNodePropertyListPath
[++]   BlankNodePropertyListPath  ::=  '[' PropertyListPathNotEmpty ']'

     Andy

(1) http://s.apache.org/m0

Received on Monday, 20 February 2012 12:10:37 UTC