Re: syntax tests update

* Seaborne, Andy <andy.seaborne@hp.com> [2007-01-19 12:07+0000]
> 
> 
> 
> 
> -------- Original Message --------
> > From: Lee Feigenbaum <>
> > Date: 18 January 2007 19:21
> >
> > Thanks, Jeen! My results and comments inline below.
> >
> > Jeen Broekstra wrote on 01/18/2007 10:35:29 AM:
> >
> > > Only syntax-sparql3 contains negative syntax tests. They are marked as
> > > such in the manifest, and can also be recognized by the filename,
> > > which is prefixed 'syn-bad-'.
> > >
> > > I would ask everyone with a SPARQL parser to try out these tests and
> > > report possible problems.
> >
> > As I said previously, Glitter throws exceptions during parsing when it
> > encounters a function that it does not recognize. That causes a handful
> > of tests to fail, which I've tried to highlight here.
> >
> > syntax-sparql1 - I fail 4 tests, all because of unknown functions
> > syntax-sparql2 - I fail 6 tests; 4 are because of unknown functions.
> > The other two are:
> >
> > syntax-esc-04
> > syntax-esc-05
> >
> > ...both of which have liberal use of \u escapes. It won't surprise me
> > at all if these tests are fine and this is a parser bug that I have.
> >
> > syntax-sparql3 - I fail these 6 tests;
> >
> > syn-bad-{8,9,10,1112,13} - these (negative) test asserts that multiple
> > periods ('.') in a row should fail; my parser allows them.
> >
> > Was there a change at some point in the grammar that affected the
> > validity of extra periods in a row?
> 
> No - not in any published version.  It's never been intentionally legal.  
> One development version did get it wrong but that was a long time ago.

I guess that version of the grammar was in the yacker until Andy
recently updated it. Before the update, yacker passed those same
tests:

data-r2/syntax-sparql3/syn-bad-08.rq
created data-r2/syntax-sparql3/syn-bad-08.rq.dump: 
test:SelectQuery-star matched ( Var+ | '*' ) regexp: \* "*"
test:GraphPattern-spoDOT matched ( '.' BasicGraphPattern? ) rule: BasicGraphPattern? regexp: ^$ ""
test:GraphPattern-spoDOT matched ( '.' BasicGraphPattern? ) rule: BasicGraphPattern? regexp: ^$ ""
test:GraphPattern-spo matched GraphPatternElement rule: BasicGraphPattern? regexp: . "?s ?p ?o . ."
--------------------
data-r2/syntax-sparql3/syn-bad-09.rq
created data-r2/syntax-sparql3/syn-bad-09.rq.dump: 
test:SelectQuery-star matched ( Var+ | '*' ) regexp: \* "*"
test:GraphPattern-spoDOT matched ( '.' BasicGraphPattern? ) rule: BasicGraphPattern? regexp: ^$ ""
test:GraphPattern-spoDOT matched ( '.' BasicGraphPattern? ) rule: BasicGraphPattern? regexp: ^$ ""
test:GraphPattern-spo matched GraphPatternElement rule: BasicGraphPattern? regexp: . "?s ?p ?o . ."
--------------------
data-r2/syntax-sparql3/syn-bad-10.rq
created data-r2/syntax-sparql3/syn-bad-10.rq.dump: 
test:SelectQuery-star matched ( Var+ | '*' ) regexp: \* "*"
test:GraphPattern-spoDOT matched ( '.' BasicGraphPattern? ) rule: BasicGraphPattern? regexp: ^$ ""
test:GraphPattern-spospo matched ( '.' TriplesSameSubject? ) rule: TriplesSameSubject? regexp: . "?s1 ?p1 ?o1"
test:GraphPattern-spo matched GraphPatternElement rule: BasicGraphPattern? regexp: . "?s ?p ?o . . ?s1 ?p1 ?o1"
--------------------
data-r2/syntax-sparql3/syn-bad-11.rq
created data-r2/syntax-sparql3/syn-bad-11.rq.dump: 
test:SelectQuery-star matched ( Var+ | '*' ) regexp: \* "*"
test:GraphPattern-spoDOT matched ( '.' BasicGraphPattern? ) rule: BasicGraphPattern? regexp: ^$ ""
test:GraphPattern-spospo matched ( '.' TriplesSameSubject? ) rule: TriplesSameSubject? regexp: . "?s1 ?p1 ?o1"
test:GraphPattern-spo matched GraphPatternElement rule: BasicGraphPattern? regexp: . "?s ?p ?o . . ?s1 ?p1 ?o1"
--------------------
data-r2/syntax-sparql3/syn-bad-12.rq
created data-r2/syntax-sparql3/syn-bad-12.rq.dump: 
test:SelectQuery-star matched ( Var+ | '*' ) regexp: \* "*"
test:GraphPattern-spoDOT matched ( '.' BasicGraphPattern? ) rule: BasicGraphPattern? regexp: ^$ ""
test:GraphPattern-spospo matched ( '.' TriplesSameSubject? ) rule: TriplesSameSubject? regexp: . "?s1 ?p1 ?o1"
test:GraphPattern-spo matched GraphPatternElement rule: BasicGraphPattern? regexp: . "?s ?p ?o . . ?s1 ?p1 ?o1"
--------------------
data-r2/syntax-sparql3/syn-bad-13.rq
created data-r2/syntax-sparql3/syn-bad-13.rq.dump: 
test:SelectQuery-star matched ( Var+ | '*' ) regexp: \* "*"
test:GraphPattern-spospo matched ( '.' TriplesSameSubject? ) rule: TriplesSameSubject? regexp: . "?s1 ?p1 ?o1"
test:GraphPattern-spoDOT matched ( '.' BasicGraphPattern? ) rule: BasicGraphPattern? regexp: ^$ ""
test:GraphPattern-spoDOT matched ( '.' BasicGraphPattern? ) rule: BasicGraphPattern? regexp: ^$ ""
test:GraphPattern-spo matched GraphPatternElement rule: BasicGraphPattern? regexp: . "?s ?p ?o . ?s1 ?p1 ?o1 . ."


We can see how it parsed:

http://www.w3.org/2005/01/yacker/uploads/SPARQL_old?markup=html&lang=perl&text=%23+Multiple+DOTs%0D%0ASELECT+*+WHERE%0D%0A%7B+%3Fs+%3Fp+%3Fo+.+.+%7D&action=validate+text


As I read it, ( "." TriplesSameSubject? )* allowed any number of '.'s

-- 
-eric

office: +1.617.258.5741 NE43-344, MIT, Cambridge, MA 02144 USA
cell:   +1.857.222.5741

(eric@w3.org)
Feel free to forward this message to any list for any purpose other than
email address distribution.

Received on Friday, 19 January 2007 23:21:52 UTC