Tue 21 Feb 2006

Parser testing

I hope nobody ever writes a query like this, but if they do I'm confident that twinql will handle it.
* (parse-sparql "SELECT * {
?x ?y [ ?p ?q ;
?r ?s ,
?t ] .
?u ?v ?w ;
?vv ?ww ,
?xx .
[ ?b ?c ] ?d ?e ;
?f ?g ,
?h . }")

(SPARQL
:SELECT
:WHERE
'(GRAPH-PATTERN
(TRIPLE |x| |y| #<NODE {41650121}>)
(TRIPLE #<NODE {41650121}> |p| |q|)
(TRIPLE #<NODE {41650121}> |r| |s|)
(TRIPLE #<NODE {41650121}> |r| |t|)
(TRIPLE |u| |v| |w|)
(TRIPLE |u| |vv| |ww|)
(TRIPLE |u| |vv| |xx|)
(TRIPLE #<NODE {41651D21}> |b| |c|)
(TRIPLE #<NODE {41651D21}> |d| |e|)
(TRIPLE #<NODE {41651D21}> |f| |g|)
(TRIPLE #<NODE {41651D21}> |f| |h|)))
Wow, this must be the post with the smallest audience ever.

Posted at 2006-02-21 13:57:41 by RichardLink to Parser testing
Comments, trackbacks.

Redirects

I'm blogging this as a piece of permanent documentation, after someone asked me and couldn't find the answer online. Using Araneida, to set up a redirect handler on the root, and a normal handler somewhere else, so that they don't interfere, do the following:
(let ((r-h (make-instance 'redirect-handler 
:location "index.html"))
(my-h (make-instance 'some-other-handler)))
(install-handler (http-listener-handler *listener*)
my-h "some-path" nil)
(install-handler (http-listener-handler *listener*)
r-h "" t))
And if you want to handle the static files:
(install-handler (http-listener-handler *listener*)
(make-instance 'static-file-handler :pathname *app-path*)
(urlstring (merge-url *my-url* "/")) nil)

Posted at 2006-02-21 09:42:05 by RichardLink to Redirects
Comments, trackbacks.

Google
Web holygoat.co.uk
  • richard is: