W3C home > Mailing lists > Public > public-cwm-bugs@w3.org > May 2008

Re: fixes to get cwm 1.2.1 to handle SPARQL queries

From: Yosi Scharf <syosi@MIT.EDU>
Date: Fri, 30 May 2008 15:23:50 -0400
Message-ID: <48405446.3020304@mit.edu>
To: lcs@MIT.EDU
CC: public-cwm-bugs@w3.org

Larry Stone wrote:
> I've been working with cwm 1.2.1, running it under python 2.4 on
> a Linux i386 (32-bit) system.  The original code as I downloaded it wouldn't
> handle any SPARQL queries (the --sparql options) until I applied the
> attached patches to the source.  It still doesn't handle DESCRIBE
> queries, but it appears that is simply not implemented, not a bug.
Describe is not implemented. Reading the standard never allowed me to
understand what it is supposed to do.
> The fix to "cwm" is pretty self-explanatory.
Thanks. That feature is not adequately tested, thus the obvious error.

> The other changes were to work around a fatal error -- I've never
> worked with Python so it didn't make much sense, but might be an
> incompatibilty in the regular expression implementation.
Python comes in two types of builds: wide and narrow. Wide builds use 32
bit values for unicode, which narrow use 16. You are correct that those
regular expressions have issues on narrow builds (which tend to be the
default on most platforms). The solution is ... to delete
sparql_tokens_table.py (and sparql_tokens_table.pyc). It will recreate
itself. The code to generate it was fixed long ago. However, the version
on my box has stayed, and still works for me, so I never changed it.
Next week I will look into releasing a fixed version.

You can tell what kind of python build you have by running:
$ python -c 'unichr(0x1000000)'
It will tell you
ValueError: unichr() arg not in range(0x110000) (wide Python build)
ValueError: unichr() arg not in range(0x10000) (narrow Python build)


> Hope this is of use,
>         -- Larry Stone
>            MIT Libraries
> ----------------
Received on Friday, 30 May 2008 19:24:37 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 19:52:01 UTC