Hi,
I've started using BaseX as a database for a PHP project. I can open the
database and add nodes but I can't delete nodes.
I've tested the XQUERY on the GUI and it works just fine. Any clue?
Here is the xquery:
Here is the php code:
[.]
$session->execute("OPEN data");
$session->execute("XQUERY delete nodes (//definition/item[@type='test'])");
I've tried without "XQUERY" but gives the same result.
Would be nice to have a working example of such use.
Best Regards,
Yoann Maingon
---------------------------------------
Yoann Maingon
Prodeos
+33 6.64.32.49.66
<mailto:yoann.maingon@prodeos.com> yoann.maingon(a)prodeos.com
LOGO_14032009_OnWhite_Signature
www.prodeos.com
As both a stress test and to experiment, I created a database using a recent
complete (current page) dump of English Wikipedia, a hefty file of 30.5 GB.
I don't have enough memory apparently to create a full-text index of all of
that text, so I created the DB without one.
My first testing came up empty until I realized that I needed to deal with
the namespace (ugh). Then I tried:
declare default element namespace "http://www.mediawiki.org/xml/export-0.4/
";
//siteinfo
This contains a small amount of data and occurs only once in the document
(at /mediawiki/siteinfo). However, it's extremely slow (~33 seconds on my
system). The query plan is:
<IterPath>
<Root/>
<IterStep axis="child" test="*:mediawiki"/>
<IterStep axis="child" test="*:siteinfo"/>
</IterPath>
Timing:
- Parsing: 0.35 ms
- Compiling: 0.22 ms
- Evaluating: 33316.32 ms
- Printing: 0.3 ms
- Total Time: 33317.19 ms
My surmise is that millions of node names are being checked rather than a
path index being used to rapidly access the appropriate node(s). I don't
think such a simple query should fail to be properly optimized. Another
surmise is that it's related to namespaces not being indexed (?). While
personally I very much dislike namespaces, they are common, and they have to
be efficiently handled.
To see if it made a difference, I also tried an explicitly named namespace
test:
declare namespace w="http://www.mediawiki.org/xml/export-0.4/";
//w:siteinfo
This results in:
<IterPath>
<Root/>
<IterStep axis="descendant" test="w:siteinfo"/>
</IterPath>
Timing:
- Parsing: 0.33 ms
- Compiling: 0.07 ms
- Evaluating: 54288.51 ms
- Printing: 0.3 ms
- Total Time: 54289.23 ms
So performance is even worse.
Dear all,
BaseX now offers (slightly modified) support for the EXPath ZIP
Module. This module allows everyone to extract files from ZIP
archives, list its contents, create new archives, and update existing
archives. As far as we know, our implementation is the first one which
is simply usable out of the box, and may be the first complete
implementation as well.
The ZIP Module is included in our latest build, available at:
http://files.basex.org/releases/latest/
Please have a look at our documentation to find more details and examples:
http://docs.basex.org/wiki/ZIP_Functions
All the best,
Christian
___________________________
BaseX
Christian Grün
Uni KN, Box 188
78457 Konstanz, Germany
http://www.inf.uni-konstanz.de/~gruen