[Monetdb-developers] Get xquery timing, Error when running examples, etc

Hi, I just started to use MonetDB. My PC is Windows XP. I installed the MonetDB-XQuery-0.10.2.msi and few weeks later after the newer version come out, I uninstalled from Control Panel & install 0.12.0. I have several questions: 1. How to run the query from the command prompt and get the timing? Currently, everytime I want to run the query, I have to start XQuery Server (start - all programs - monetdb xquery - XQuery Server). After that I save the xquery into .xq file, then run it by right click - open with MPFClient. I've tried the following in XQuery Server but it gives me error: MonetDB>MapiClient -T -lx test.xq; !ERROR: "MapiClient -T -lx test.xq;" ! ^ ! can't help you here, sorry. MonetDB> 2. I tried to run the example in the website, books1.xq and books2.xq and slashdot.xq. In the files, the xml file is from internet. But when I run the files, the following error message come out: ERROR: No such file or directoryI/O warning : failed to load external entity "http://monetdb.cwi.nl/XQuery/files/bib.xml" ERROR: shred:mainSHREDDER: xmlCreateURLParserCtxt(" http://monetdb.cwi.nl/XQuery/files/bib.xml") failed ERROR: CMDshred2bats: operation failed. ERROR: interpret_params: +(param 2): evaluation error. Is it connection problem? How to modify the connection settings so that I can download data from internet? 3. voc2.xq and voc5.xq give the following error: type error: [err:XPTY0004] Orderspec requires at most one atomic item (given: string*). 4. Where is the shredded document being stored? Is it in the place where I install the program or in My Documents? Because before I uninstall 0.10.2, I shredded some documents, and after I uninstall then install 0.12.0, the shredded xml documents are still there. Thanks, Klarinda

On Thu, Jul 06, 2006 at 05:29:31PM +0800, kla gw wrote: Hi Klarinda, thanks for your interest in MonetDB/XQuery. Though I am only used to the Unix version of MonetDB/XQuery, I will try to give my best to answer your request.
Issue this command from the Windows command line, *not* from within the MonetDB server. You may have to call MapiClient with a fully qualified path (`C:\some\long\path\MapiClient').
(This may be OS dependent, so no guarantees for my answer.) This looks to me like a connection problem. What you could do is download the respective XML files to your harddisk, then replace the URL strings in the query files with `file:// ...'. Actually, we're relying here on the HTTP implementation of a third-party library (the libxml2 library, http://www.xmlsoft.org/). Unfortunately, I don't know the details on how this library tries to access the network and what you have to do to get network access running.
Apparently we have an erroneous example on the net, sorry about that. We'll fix that soon. The error message is actually correct, the query is wrong.
(again OS specific) I think the database is held in the installation directory of MonetDB. Look out for a directory that is called `dbfarm'. The structure below it contains the MonetDB database. Just let us know if you experience any more problems. Jens -- Jens Teubner Technische Universitaet Muenchen, Department of Informatics D-85748 Garching, Germany Tel: +49 89 289-17259 Fax: +49 89 289-17263 I invented <Ctrl><Alt><Delete>, but Bill Gates made it famous. -- David Bradley, member of the original IBM PC design team

On 2006-07-06 11:29, kla gw wrote:
Take a look at the BAT script MPFclient.bat in the installation folder (normally C:\Program Files\CWI\MonetDB-XQuery). Towards the end there is a call to MapiClient.exe. You can add a -T option there, however that would mess up the XML file that is generated and given to Internet Explorer. So a better solution might be to copy the script (but leave it in the same folder) and modify it to save the output of the MapiClient.exe command into a file which you should not open (the bit starting with the && on the MapiClient line) or throw away like is done in the script.
Try loading the xml file in your web browser. If that doesn't succeed either, it's a connection problem.
I don't know what the issue is here. Somebody else should comment.
The database is stored in %APPDATA%\MonetDB (normally C:\Documents and Settings\<user name>\Application Data\MonetDB) and is not removed on uninstall. See the Mserver.bat script. -- Sjoerd Mullender

The queries on the web have unfortunately not yet been updated to match the latest typing requirements of MonetDB/XQuery. Sorry for the inconvenience, and thanks for notifying us! The correct queries are: ======== voc2.xq: for $t in doc("voc.xml")//voyage[leftpage/boatname="ZEELANDIA"] let $l := $t/leftpage order by zero-or-one($l/departure) (: ^^^^^^^^^^^^ ^ :) return { $l/departure/text(), text { ", " }, $l/harbour/text() } ======== voc5.xq: for $t in doc("voc.xml")//voyage let $p := zero-or-one($t/rightpage/particulars/text()) where not($t//destination/arrival) and (contains($p,"wrecked") or contains($p,"sunk")) order by zero-or-one($t/leftpage/boatname/text()) (: ^^^^^^^^^^^^ ^ :) return element { "boat" } { element { "name" } { $t/leftpage/boatname/text() }, text { ": " }, element { "description" } { $t/rightpage/particulars/text() } } ======== We will update the website as soon as possible. Stefan -- | Dr. Stefan Manegold | mailto:Stefan.Manegold@cwi.nl | | CWI, P.O.Box 94079 | http://www.cwi.nl/~manegold/ | | 1090 GB Amsterdam | Tel.: +31 (20) 592-4212 | | The Netherlands | Fax : +31 (20) 592-4312 |

Hi, thanks for answering my questions :) On 7/6/06, Sjoerd Mullender <sjoerd@acm.org> wrote:
I have tried to copy the script and add a -T option. Below is a portion of the modified MPFClient.bat: rem start the real client set XMLFILE=%TEMP%\MonetDB-XQuery-%RANDOM%.xml "%MONETDB%\bin\MapiClient.exe -T" --set "prefix=%MONETDB%" --set "exec_prefix=%MONETDB%" -lxquery -sxml %* > "%XMLFILE%" && "%XMLFILE%" but when I run the .xq file (right click, open with MPFClientModified.bat), there is no result. My question is: How do you save the output into the file, instead of opening it in IE? Btw I tried the solution given by Jens (to run from command prompt), and it works :)
I still have this problem, so I guess it's connection problem.
How does the xml being shredded? I see there are lots of .buns, .desc, .theap files. Is there any documentation on the shredding detail? And I'm also interested to create a GUI / interface for XQuery and connect it to MonetDB/XQuery. Please give me some idea of where/how to start. Is it possible to use Java for the GUI? Regards, Klarinda

On 17-07-2006 22:49:42 +0800, kla gw wrote: [snip parts I cannot answer]
Yes, via JDBC or XML:DB you can easily query MonetDB/XQuery. For more information on this, see here: http://monetdb.cwi.nl/TechDocs/APIs/JDBC/node8.html or http://monetdb.cwi.nl/TechDocs/APIs/JDBC/node9.html
participants (5)
-
Fabian Groffen
-
Jens Teubner
-
kla gw
-
Sjoerd Mullender
-
Stefan Manegold