First of all, I'm a monetdb/xquery/ruby novice. I'm trying to do xqueries from the web in two ways: from a ruby-on-rails application, and from a cgi script. For the cgi script I use (a perl wrapper around) mclient, which seems to work ok. The remainder of this mail is about the access from ruby-on-rails. For the ruby-on-rails application, I typically have to do relatively small queries. The heart of the xqueries is in xquery module files (partly 'static', partly generated 'dynamically' from user data entered in web forms) and thus the queries to be done from ruby-on-rails are rather small: import the module, and invoke the right function with some parameters. I started using xrpc. However, I'm encountering issues that might be related to the fact that xrpc uses one backend, and mclient (by default) uses another one. (Being an xquery novice) I've also encountered some differences between the xquery support by both backends. I then started looking at the mapi interface, because that would allow the use of the same backend from both webapp an cgi scripts. To my understanding there are a couple of different routes possible, and I'm not sure what would be the best way. - use the native ruby code present in the MonetDB distribution this I tried, but it seems to not fully up-to-date/working in the Aug-2009 distribution at least, I had to hack MonetDBConnection.rb to make it work - use the swig mapi wrapper (via http://rubyforge.org/projects/monetdb-ror) I did not try that yet - somehow wrap mclient (using something like fork/exec from ruby) did not try that yet, but I have been using mclient to try queries - use libmapi to build my own translation daemon/program, that is kind of like mclient but e.g. without the prompts etc, that receives/sends xqueries/responses as strings on a socket (or so), and talks mapi to the database. I did not try this; I did compile and run the sample mapi program, which could be used as a start, I guess I'm kind of looking for comments, and in particular I'm curious about the status of the native ruby code included in the distribution - I would prefer to use that, but for some of the basic things I looked at the mapi C library seems to do things in a more involved way than the ruby code, which makes me wonder. On the other hand, it seems that for xquery support the library mainly has to pass strings around - not all the complicated things that seem to be necessary for, for example, the sql support. Thanks, Axel.