[MonetDB-users] Query XML data with SQL
Hello,
I was wondering if it's possible to query the MonetDB backend containing
an imported XML document using SQL. I couldn't readily find an example
of this on the website and got as far as importing the VOC XML data and
starting the jdbcclient to attempt a table dump. My guess is that I need
some kind of mapping (view) on the XML data in order to use it with SQL.
Any tips or suggestions would be greatly appreciated.
Cheers,
--
-- Jeroen van Holst
On Fri, Nov 10, 2006 at 03:58:58PM +0100, Jeroen van Holst wrote:
I was wondering if it's possible to query the MonetDB backend containing an imported XML document using SQL. I couldn't readily find an example of this on the website and got as far as importing the VOC XML data and starting the jdbcclient to attempt a table dump. My guess is that I need some kind of mapping (view) on the XML data in order to use it with SQL. Any tips or suggestions would be greatly appreciated.
Jeroen, thanks for your interest in MonetDB/XQuery. XML support for MonetDB is provided by the Pathfinder XQuery compiler. This front-end to the database kernel in fact does a transformation between the XML document format and relational database tables stored in the MonetDB back-end. However, the resulting tables use an internal table layout that is inaccessible via MonetDB's SQL front-end. Unlike XML functionality in some commercial systems (DB2's XML Extender, for instance), it is not possible in MonetDB/XQuery to access the same data from both front-ends, the Pathfinder XQuery front-end and MonetDB's SQL front-end. The relational table layout used by the Pathfinder compiler, by the way, would not be of much help for you anyway. The XQuery front-end does not use any semantical mapping between XML data and relational tables. Rather, it shreds XML into a table layout that is independent of your specific data and thus barely useful for direct access with relational means (e.g., with SQL). Regards, Jens -- Jens Teubner Technische Universitaet Muenchen, Department of Informatics D-85748 Garching, Germany Tel: +49 89 289-17259 Fax: +49 89 289-17263 SQL0437W Performance of this complex query may be sub-optimal. Reason code: "3". SQLSTATE=01602 -- IBM DB2 V7.1 Warning Message
participants (2)
-
Jens Teubner
-
Jeroen van Holst