- From: Joe Presbrey <presbrey@MIT.EDU>
- Date: Sun, 08 Aug 2010 14:59:58 -0400
- To: Tim Berners-Lee <timbl@w3.org>
- CC: Ericp@w3.org, James D Hollenbach <jambo@mit.edu>, www-archive@w3.org, DIG group <diggers@csail.mit.edu>
It might break from too much badly formatted SPARQL until C++ error
handling is worked out though our errors today were caused by some
renaming Eric did in the SWObjects API.
I fixed the calls (s/POSFactory/AtomFactory and
s/assureGraph/ensureGraph) and decoupled the wiki from the SWObjects
compilation stack to prevent these kinds of errors in the future.
(Any thoughts on rdfWidgets editing/ACLs in the directory indexes?)
Index: __post.py
===================================================================
--- __post.py (revision 29511)
+++ __post.py (working copy)
@@ -6,13 +6,13 @@
import SWObjects
def update(n3, query, base_uri=''):
- _F = SWObjects.POSFactory()
+ _F = SWObjects.AtomFactory()
_DB = SWObjects.RdfDB()
# Parse existing N3
if n3:
_T = SWObjects.TurtleSDriver(base_uri, _F)
- _T.setGraph(_DB.assureGraph(SWObjects.cvar.DefaultGraph))
+ _T.setGraph(_DB.ensureGraph(SWObjects.cvar.DefaultGraph))
_T.parse(SWObjects.IStreamContext(n3,
SWObjects.StreamContextIstream.STRING))
Tim Berners-Lee wrote:
> Just today, Two compounded errors.
>
> 1) The SWOBJECT link to python seems to have died.
> 2) When the server produced that error message, it did it with a 200
> return code, instead of an error code. So the tabulator ignores the
> problem and behaves as though the data has been written back.
>
> This was working yesterday.
>
> Could I have broken it by sending badly formatted SPARQL?
>
> Tim
>
>
> $ curl -i -d 'INSERT {
> <http://dig.xvm.mit.edu/wiki/people/JoeLambda#JL>
> <http://xmlns.com/foaf/0.1/age> 66 }' -H
> Content-type:application/sparql-query
> http://dig.xvm.mit.edu/wiki/people/JoeLambda
>
> HTTP/1.1 200 OK
> Date: Sun, 08 Aug 2010 16:48:45 GMT
> Server: Apache
> Vary: Content-Type
> MS-Author-Via: SPARQL
> Access-Control-Allow-Origin: *
> Access-Control-Allow-Methods: GET,PUT,POST,OPTIONS
> Access-Control-Allow-Headers: X-Requested-With
> Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
> pre-check=0
> Pragma: no-cache
> Connection: close
> Transfer-Encoding: chunked
> Content-Type: text/html; charset=UTF-8
>
> <body bgcolor="#f0f0f8">
> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
> <tr bgcolor="#6622aa">
> <td valign=bottom> <br>
> <font color="#ffffff" face="helvetica,
> arial"> <br><big><big><strong><type
> 'exceptions.AttributeError'></strong></big></big></font></td
> ><td align=right valign=bottom
> ><font color="#ffffff" face="helvetica, arial">Python 2.6.4:
> /usr/bin/python<br>Sun Aug 8 12:48:45 2010</font></td></tr></table>
>
>
>
> <p>A problem occurred in a Python script. Here is the sequence of
> function calls leading up to the error, in the order they occurred.</p>
> <table width="100%" cellspacing=0 cellpadding=0 border=0>
> <tr><td bgcolor="#d8bbff"><big> </big><a
> href="file:///usr/lib/python2.6/site-packages/flup/server/fcgi_base.py">/usr/lib/python2.6/site-packages/flup/server/fcgi_base.py</a>
> in <strong>run</strong>(self=<flup.server.fcgi_base.Request object at
> 0x7f13700dc350>)</td></tr>
> <tr><td><font
> color="#909090"><tt><small> 556</small> """Runs the handler, flushes the streams, and ends the request."""<br>
> </tt></font></td></tr>
> <tr><td><font
> color="#909090"><tt><small> 557</small> try:<br>
> </tt></font></td></tr>
> <tr><td
> bgcolor="#ffccee"><tt><small> 558</small> protocolStatus, appStatus = self.server.handler(self)<br>
> </tt></td></tr>
> <tr><td><font
> color="#909090"><tt><small> 559</small> except:<br>
> </tt></font></td></tr>
> <tr><td><font
> color="#909090"><tt><small> 560</small> traceback.print_exc(file=self.stderr)<br>
> </tt></font></td></tr>
> <tr><td><small><font color="#909090">protocolStatus <em>undefined</em>,
> appStatus <em>undefined</em>, <strong>self</strong> =
> <flup.server.fcgi_base.Request object at 0x7f13700dc350>,
> self.<strong>server</strong> = <flup.server.fcgi.WSGIServer
> object at 0x332abd0>, self.server.<strong>handler</strong> =
> <bound method WSGIServer.handler of <flup.server.fcgi.WSGIServer
> object at 0x332abd0>></font></small></td></tr></table>
> <table width="100%" cellspacing=0 cellpadding=0 border=0>
> <tr><td bgcolor="#d8bbff"><big> </big><a
> href="file:///usr/lib/python2.6/site-packages/flup/server/fcgi_base.py">/usr/lib/python2.6/site-packages/flup/server/fcgi_base.py</a>
> in <strong>handler</strong>(self=<flup.server.fcgi.WSGIServer object
> at 0x332abd0>, req=<flup.server.fcgi_base.Request object at
> 0x7f13700dc350>)</td></tr>
> <tr><td><font
> color="#909090"><tt><small> 1116</small> try:<br>
> </tt></font></td></tr>
> <tr><td><font
> color="#909090"><tt><small> 1117</small> try:<br>
> </tt></font></td></tr>
> <tr><td
> bgcolor="#ffccee"><tt><small> 1118</small> result = self.application(environ, start_response)<br>
> </tt></td></tr>
> <tr><td><font
> color="#909090"><tt><small> 1119</small> try:<br>
> </tt></font></td></tr>
> <tr><td><font
> color="#909090"><tt><small> 1120</small> for data in result:<br>
> </tt></font></td></tr>
> <tr><td><small><font color="#909090"><strong>result</strong> =
> None, <strong>self</strong> = <flup.server.fcgi.WSGIServer
> object at 0x332abd0>, self.<strong>application</strong> =
> <function handler at 0x2f8e410>, <strong>environ</strong> =
> {'CONTENT_LENGTH': '96', 'CONTENT_TYPE': 'application/sparql-query',
> 'DOCUMENT_ROOT': '/srv/dig/www', 'GATEWAY_INTERFACE': 'CGI/1.1',
> 'HTTP_ACCEPT': '*/*', 'HTTP_CONNECTION': 'close', 'HTTP_HOST':
> 'dig.xvm.mit.edu', 'HTTP_USER_AGENT': 'curl/7.19.7
> (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3',
> 'PATH': '/sbin:/usr/sbin:/bin:/usr/bin', 'PATH_INFO':
> '/wiki/people/JoeLambda', ...}, <strong>start_response</strong> =
> <function start_response at
> 0x7f13700bdaa0></font></small></td></tr></table>
> <table width="100%" cellspacing=0 cellpadding=0 border=0>
> <tr><td bgcolor="#d8bbff"><big> </big><a
> href="file:///srv/dig/www/wiki/__post.py">/srv/dig/www/wiki/__post.py</a>
> in <strong>handler</strong>(environ={'CONTENT_LENGTH': '96',
> 'CONTENT_TYPE': 'application/sparql-query', 'DOCUMENT_ROOT':
> '/srv/dig/www', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': '*/*',
> 'HTTP_CONNECTION': 'close', 'HTTP_HOST': 'dig.xvm.mit.edu',
> 'HTTP_USER_AGENT': 'curl/7.19.7 (universal-apple-darwin10.0)
> libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3', 'PATH':
> '/sbin:/usr/sbin:/bin:/usr/bin', 'PATH_INFO': '/wiki/people/JoeLambda',
> ...}, start_response=<function start_response at
> 0x7f13700bdaa0>)</td></tr>
> <tr><td><font
> color="#909090"><tt><small> 37</small> if os.path.exists(abs_path+'.n3'):<br>
> </tt></font></td></tr>
> <tr><td><font
> color="#909090"><tt><small> 38</small> n3 = file(abs_path+'.n3').read()<br>
> </tt></font></td></tr>
> <tr><td
> bgcolor="#ffccee"><tt><small> 39</small> r = update(n3, query, base_uri)<br>
> </tt></td></tr>
> <tr><td><font
> color="#909090"><tt><small> 40</small> file(abs_path+'.n3', 'w').write(r)<br>
> </tt></font></td></tr>
> <tr><td><font
> color="#909090"><tt><small> 41</small> <br>
> </tt></font></td></tr>
> <tr><td><small><font color="#909090">r <em>undefined</em>,
> <em>global</em> <strong>update</strong> = <function update at
> 0x7f137d5b3c80>, <strong>n3</strong> =
> '<http://example.edu/2007/wiki/people/JoeLambda#J... "This is a
> comment whcih Tim put in at 22:48" .<font color="#c040c0">\n</font>',
> <strong>query</strong> = 'INSERT {
> <http://dig.xvm.mit.edu/wiki/people/JoeLambda#JL>
> <http://xmlns.com/foaf/0.1/age> 66 }',
> <strong>base_uri</strong> =
> 'http://dig.xvm.mit.edu/wiki/people/JoeLambda'</font></small></td></tr></table>
> <table width="100%" cellspacing=0 cellpadding=0 border=0>
> <tr><td bgcolor="#d8bbff"><big> </big><a
> href="file:///srv/dig/www/wiki/__post.py">/srv/dig/www/wiki/__post.py</a>
> in
> <strong>update</strong>(n3='<http://example.edu/2007/wiki/people/JoeLambda#J...
> "This is a comment whcih Tim put in at 22:48" .<font
> color="#c040c0">\n</font>', query='INSERT {
> <http://dig.xvm.mit.edu/wiki/people/JoeLambda#JL>
> <http://xmlns.com/foaf/0.1/age> 66 }',
> base_uri='http://dig.xvm.mit.edu/wiki/people/JoeLambda')</td></tr>
> <tr><td><font
> color="#909090"><tt><small> 7</small> import SWObjects<br>
> </tt></font></td></tr>
> <tr><td><font
> color="#909090"><tt><small> 8</small> def update(n3, query, base_uri=''):<br>
> </tt></font></td></tr>
> <tr><td
> bgcolor="#ffccee"><tt><small> 9</small> _F = SWObjects.POSFactory()<br>
> </tt></td></tr>
> <tr><td><font
> color="#909090"><tt><small> 10</small> _DB = SWObjects.RdfDB()<br>
> </tt></font></td></tr>
> <tr><td><font
> color="#909090"><tt><small> 11</small> <br>
> </tt></font></td></tr>
> <tr><td><small><font color="#909090">_F <em>undefined</em>,
> <em>global</em> <strong>SWObjects</strong> = <module 'SWObjects'
> from '/srv/dig/lib/python/SWObjects.py'>, SWObjects.POSFactory
> <em>undefined</em></font></small></td></tr></table><p><strong><type
> 'exceptions.AttributeError'></strong>: 'module' object has no
> attribute 'POSFactory'
> <br><tt><small> </small> </tt>args =
> ("'module' object has no attribute 'POSFactory'",)
> <br><tt><small> </small> </tt>message =
> "'module' object has no attribute 'POSFactory'"
>
>
> <!-- The above is a description of an error in a Python program, formatted
> for a Web browser because the 'cgitb' module was enabled. In case you
> are not reading this in a Web browser, here is the original traceback:
>
> Traceback (most recent call last):
> File "/usr/lib/python2.6/site-packages/flup/server/fcgi_base.py", line
> 558, in run
> protocolStatus, appStatus = self.server.handler(self)
> File "/usr/lib/python2.6/site-packages/flup/server/fcgi_base.py", line
> 1118, in handler
> result = self.application(environ, start_response)
> File "/srv/dig/www/wiki/__post.py", line 39, in handler
> r = update(n3, query, base_uri)
> File "/srv/dig/www/wiki/__post.py", line 9, in update
> _F = SWObjects.POSFactory()
> AttributeError: 'module' object has no attribute 'POSFactory'
>
> -->
>
Received on Monday, 9 August 2010 09:25:28 UTC