[MonetDB-users] [Fwd: Re: monetdb, xquery and perl]
-------- Original Message --------
Subject: Re: monetdb, xquery and perl
Date: Fri, 27 Feb 2009 10:35:15 +0100
From: francois guérin
francois guérin wrote:
Hi, I am about to develop an app using monetdb and its xquery part. My app will essentially be made of perl code. But it seems that perl is only used in monetdb's sql part, isn't? like using sql statements to access arrays and rows, but there's no way to access xml collections.
Am i right or haven't i read enough of monetdb's documentation?
You are right. The PHP, Perl, JDBC application interfacing to the XML/XQuery part is less developed.
regards, Martin
Thanks a lot,
francois.
Hello Francois, A collection will be deleted automatically, if all documents in this collection have been deleted. However, you don't have to delete the documents one by one. Please have a look in the admin:del-col() function, which you could find in <prefix>/share/MonetDB/xrpc/admin/admin.xq, how you could delete a collection. So you could just call this function (over XRPC) with the name of the collection you want to delete. If you just want to delete all collections in a particular database (i.s.o. physically remove the database directory in dbfarm), the following code should do the job (replace 'hostname' and 'port' with the host on which Mserver is running, and the port nr., on which the XRPC server is running): ============= import module namespace adm='http://monetdb.cwi.nl/XQuery/admin/' at 'http://[hostname]:[port]/admin/admin.xq'; for $col in pf:collections() return adm:del-col($col) ============= To make this functionality callable over XRPC, create a module file, and declare a function for it: ============= module namespace foo = '[define-a-namespace]'; (: import the admin functions :) import module namespace adm='http://monetdb.cwi.nl/XQuery/admin/' at 'http://[hostname]:[port]/admin/admin.xq'; (: defind your own function to empty a DB :) declare document management function foo:del-db() { for $col in pf:collections() return adm:del-col($col) } ============= Hope this helps. Kind regards, Jennie On Feb 27, 2009, at 10:37 , Martin Kersten wrote:
-------- Original Message -------- Subject: Re: monetdb, xquery and perl Date: Fri, 27 Feb 2009 10:35:15 +0100 From: francois guérin
To: Martin.Kersten@cwi.nl References: <31b3364e0902230836l140c9d0cs932937c392e8e9d@mail.gmail.com> <49A2EBEC.4050306@cwi.nl> ok! I'll then try the xrpc requests...
is there a way to delete a collection in the database? (deleting documents one by one in a given collection is quite fastidious) and a way to delete a database created by the command Mserver --dbname=<...> ? (the only way i found was to physically delete directories with that same name)
Thanks,
francois.
2009/2/23 Martin Kersten
: francois guérin wrote:
Hi, I am about to develop an app using monetdb and its xquery part. My app will essentially be made of perl code. But it seems that perl is only used in monetdb's sql part, isn't? like using sql statements to access arrays and rows, but there's no way to access xml collections.
Am i right or haven't i read enough of monetdb's documentation?
You are right. The PHP, Perl, JDBC application interfacing to the XML/XQuery part is less developed.
regards, Martin
Thanks a lot,
francois.
------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
participants (2)
-
Martin Kersten
-
Ying Zhang