[MonetDB-users] (no subject)
Hello, I am interested in evaluating MonetDB/XQuery. I have some XML collections for a project I work on that are of 1-2 million individual XML documents for which I use XQuery to access for OLAP style reporting operations. This is a Java-based project, and while working on this project I developed a thin XQuery-centric API so that I could evaluate/use many different XQuery implementations, which my company released as an open source project called Xaj (http://sourceforge.net/projects/xaj). Currently I am using a Berkeley DB XML implementation, but am interested in exploring other options. I'd like to implement a MonetDB version of this API now, but I am having some difficulty finding out how to effectively access MonetDB through Java. So far I was able to use the MonetDB JDBC driver to construct XQuery statements and get XML results, and also I was able to construct MonetDB pf:add-doc() statements to add documents, but I am wondering if this is the best approach (and if so, how to add documents to a remote MonetDB server using the pf:add-doc() mechanism). The API I am trying to implement you can view here, to give you an idea what I'm trying to do: http://xaj.svn.sourceforge.net/viewvc/xaj/xaj/src/net/sf/xaj/XmlDb.java?revision=2&view=markup It was somewhat modeled after the defunct XML:DB API, but focused just on add/store/XQuery operations. Any help/advise would be greatly appreciated! -- m@
Hi Matt, On 03-10-2007 09:14:46 +1300, Matt Magoffin wrote: ...
I'd like to implement a MonetDB version of this API now, but I am having some difficulty finding out how to effectively access MonetDB through Java. So far I was able to use the MonetDB JDBC driver to construct XQuery statements and get XML results, and also I was able to construct MonetDB pf:add-doc() statements to add documents, but I am wondering if this is the best approach (and if so, how to add documents to a remote MonetDB server using the pf:add-doc() mechanism).
The only possibility to add a document "over the wire" is by a hack in JDBC that is really very limited. The name of the document that you will store is autogenerated and returned in a warning on the Connection. Unfortunately there is no better support in MonetDB/XQuery to add documents.
The API I am trying to implement you can view here, to give you an idea what I'm trying to do:
http://xaj.svn.sourceforge.net/viewvc/xaj/xaj/src/net/sf/xaj/XmlDb.java?revision=2&view=markup
It was somewhat modeled after the defunct XML:DB API, but focused just on add/store/XQuery operations. Any help/advise would be greatly appreciated!
I'm affraid we can't do any batching at the moment, neither can you rename documents such that you can assign an ID to them, as far as I know.
Hello Fabian, Thanks for your reply. I have some further questions below.
Hi Matt,
On 03-10-2007 09:14:46 +1300, Matt Magoffin wrote: ...
I'd like to implement a MonetDB version of this API now, but I am having some difficulty finding out how to effectively access MonetDB through Java. So far I was able to use the MonetDB JDBC driver to construct XQuery statements and get XML results, and also I was able to construct MonetDB pf:add-doc() statements to add documents, but I am wondering if this is the best approach (and if so, how to add documents to a remote MonetDB server using the pf:add-doc() mechanism).
The only possibility to add a document "over the wire" is by a hack in JDBC that is really very limited. The name of the document that you will store is autogenerated and returned in a warning on the Connection. Unfortunately there is no better support in MonetDB/XQuery to add documents.
I see. Xaj comes with a remote server implementation already, so I could use this to transfer the XML to the MonetDB server, and from there file:// URIs will work for storing documents, so I can work around that issue (this is how we support Berkeley DB XML running on a remote server). http://xaj.svn.sourceforge.net/viewvc/xaj/xaj/src/net/sf/xaj/web/XmlDbWebRemoteService.java?revision=28&view=markup
The API I am trying to implement you can view here, to give you an idea what I'm trying to do:
http://xaj.svn.sourceforge.net/viewvc/xaj/xaj/src/net/sf/xaj/XmlDb.java?revision=2&view=markup
It was somewhat modeled after the defunct XML:DB API, but focused just on add/store/XQuery operations. Any help/advise would be greatly appreciated!
I'm affraid we can't do any batching at the moment, neither can you rename documents such that you can assign an ID to them, as far as I know.
In terms of batching, I think all I would need is transaction support. Does MonetDB provide JDBC transaction support, and do the transactions cover the XQuery functions like pf:add-doc()? That is, can I start a JDBC transaction, call a bunch of update statements using pf:add-doc(), and then commit or rollback that transaction? -- m@
On 04-10-2007 11:21:53 +1300, Matt Magoffin wrote:
I'm affraid we can't do any batching at the moment, neither can you rename documents such that you can assign an ID to them, as far as I know.
In terms of batching, I think all I would need is transaction support. Does MonetDB provide JDBC transaction support, and do the transactions cover the XQuery functions like pf:add-doc()? That is, can I start a JDBC transaction, call a bunch of update statements using pf:add-doc(), and then commit or rollback that transaction?
Using JDBC this is totally impossible. The driver is heavily limited by a missing API of the XQuery engine. Sorry.
participants (2)
-
Fabian Groffen
-
Matt Magoffin