Re: Latest version of CWM needs line return after last predicate, is much slower too

Dom,

Indeed it does help. Thank you.
It is fixed with the latest version. notation3.py 1.130

A regression test has been added to  make sure it doesn't happen again
http://www.w3.org/2000/10/swap/test/regression.n3#t1005a

Thanks!

Tim
________________________________________________

:t1005a a test:CwmTest;
	test:shortFileName 	"no-last-nl.n3";
	test:description	"An N3 file with no final newline character";
	test:arguments		"syntax/no-last-nl.n3".

:

On Thursday, Jan 16, 2003, at 05:11 US/Eastern, Dominique 
Hazaël-Massieux wrote:

> Hi,
>
> As I was working on some rules for the Matrix maintenance, I noticed
> that the latest version of CWM reacts differently from a previous
> version, since it now requires a line return after the last predicate 
> in
> a file.
>
> The attached file that only contains a trivial predicate triggers an
> error when feed into cwm:
> dom@stratustier:~/tmp$ python2.2 /var/tmp/WWW/2000/10/swap/cwm.py
> toto.n3
> #Processed by Id: cwm.py,v 1.115 2003/01/10 17:13:13 timbl Exp
>         #    using base file:/home/dom/tmp/toto.n3
>         Traceback (most recent call last):
>   File "/var/tmp/WWW/2000/10/swap/cwm.py", line 707, in ?
>     doCommand()
>   File "/var/tmp/WWW/2000/10/swap/cwm.py", line 502, in doCommand
>     p.load(_inputURI)
>   File "/var/tmp/WWW/2000/10/swap/notation3.py", line 190, in load
>     return self.loadBuf(stream.read())    # self._formula
>   File "/var/tmp/WWW/2000/10/swap/notation3.py", line 198, in loadBuf
>     self.feed(buf)
>   File "/var/tmp/WWW/2000/10/swap/notation3.py", line 213, in feed
>     i = self.directiveOrStatement(str,j)
>   File "/var/tmp/WWW/2000/10/swap/notation3.py", line 226, in
> directiveOrStatement
>     j = self.statement(str, i)
>   File "/var/tmp/WWW/2000/10/swap/notation3.py", line 314, in statement
>     j = self.property_list(str, i, r[0])
>   File "/var/tmp/WWW/2000/10/swap/notation3.py", line 571, in
> property_list
>     i = self.object_list(str, j, objs)
>   File "/var/tmp/WWW/2000/10/swap/notation3.py", line 589, in
> object_list
>     i = self.object(str, i, res)
>   File "/var/tmp/WWW/2000/10/swap/notation3.py", line 743, in object
>     j = self.subject(str, i, res)
>   File "/var/tmp/WWW/2000/10/swap/notation3.py", line 320, in subject
>     return self.item(str, i, res)
>   File "/var/tmp/WWW/2000/10/swap/notation3.py", line 393, in item
>     return self.path(str, i, res)
>   File "/var/tmp/WWW/2000/10/swap/notation3.py", line 405, in path
>     if ahead not in _namechars + "[{(":
> TypeError: 'in <string>' requires character as left operand
>
> This error disappear when you add a line return after the predicate. I
> don't if it's a bug or an intended change of behavior (my current
> day-to-day version uses .
> llyn.py version 1.47
> cwm.py version 1.109
> notation3.py version 1.120
>
> On a completely unrelated point, the latest version of cwm is *much*
> slower than the above (like 3 times slower), which shows pretty badly 
> in
> my usual applications such as tr and matrix automations.
>
> Hope this helps,
>
> Dom
> -- 
> Dominique Hazaël-Massieux - http://www.w3.org/People/Dom/
> W3C/ERCIM
> mailto:dom@w3.org
> <toto.n3><signature.asc>

Received on Thursday, 16 January 2003 09:26:56 UTC