Hello BaseX community,
I am writing a script to load a RDBMS with some information from large XML files (1GB). I am using BaseX and XQuery to process the files and generate appropriate data dumps for bulk loading the database. My ultimate goal is to write a couple BASH scripts that will just load up the database, however I need some advice on how to script BaseX. I would like to load the XML file, generate a couple indexes, run my queries, then delete the indexes. It does not look like BaseX is so easily scripted from the command line, unless I initially load the database or run a BaseX server. I have tried running BaseX just using doc() inside the XQuery but this takes forever...
Ideally I would want to write as script like this:
#!/bin/bash basex --generate-index --dbname="hello_world" file.xml basex --query qry.xml > result.xml basex --delete --dbname="hello world"
Any suggestions on how I can do this?
Thanks,
AJ
Hi Adrien,
for an easy example you could do the following:
save your steps in a textfile, like:
create db test <test/> xquery .
then run basex like the following (using the BaseX.jar):
java -cp BaseX.jar org.basex.BaseX < script
All commands for your script can be found in our wiki: http://docs.basex.org/wiki/Commands
I hope this helps, don't hesitate to ask for more information.
-- Andreas
Am 17.03.2011 um 16:27 schrieb Adrien Guillon:
Hello BaseX community,
I am writing a script to load a RDBMS with some information from large XML files (1GB). I am using BaseX and XQuery to process the files and generate appropriate data dumps for bulk loading the database. My ultimate goal is to write a couple BASH scripts that will just load up the database, however I need some advice on how to script BaseX. I would like to load the XML file, generate a couple indexes, run my queries, then delete the indexes. It does not look like BaseX is so easily scripted from the command line, unless I initially load the database or run a BaseX server. I have tried running BaseX just using doc() inside the XQuery but this takes forever...
Ideally I would want to write as script like this:
#!/bin/bash basex --generate-index --dbname="hello_world" file.xml basex --query qry.xml > result.xml basex --delete --dbname="hello world"
Any suggestions on how I can do this?
Thanks,
AJ _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Okay thanks, I missed this page :-)
Can I do all of this without any installation of BaseX? I am hoping to just package the .jar with the script and run the scripts without users knowing what is going on (this is for a course assignment).
AJ
On Thu, Mar 17, 2011 at 11:38 AM, Andreas Weiler andreas.weiler@uni-konstanz.de wrote:
Hi Adrien, for an easy example you could do the following: save your steps in a textfile, like: create db test <test/> xquery . then run basex like the following (using the BaseX.jar): java -cp BaseX.jar org.basex.BaseX < script All commands for your script can be found in our wiki: http://docs.basex.org/wiki/Commands I hope this helps, don't hesitate to ask for more information. -- Andreas Am 17.03.2011 um 16:27 schrieb Adrien Guillon:
Hello BaseX community,
I am writing a script to load a RDBMS with some information from large XML files (1GB). I am using BaseX and XQuery to process the files and generate appropriate data dumps for bulk loading the database. My ultimate goal is to write a couple BASH scripts that will just load up the database, however I need some advice on how to script BaseX. I would like to load the XML file, generate a couple indexes, run my queries, then delete the indexes. It does not look like BaseX is so easily scripted from the command line, unless I initially load the database or run a BaseX server. I have tried running BaseX just using doc() inside the XQuery but this takes forever...
Ideally I would want to write as script like this:
#!/bin/bash basex --generate-index --dbname="hello_world" file.xml basex --query qry.xml > result.xml basex --delete --dbname="hello world"
Any suggestions on how I can do this?
Thanks,
AJ _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
No installation is needed. Just the BaseX.jar.
-- Andreas
Am 17.03.2011 um 16:40 schrieb Adrien Guillon:
Okay thanks, I missed this page :-)
Can I do all of this without any installation of BaseX? I am hoping to just package the .jar with the script and run the scripts without users knowing what is going on (this is for a course assignment).
AJ
On Thu, Mar 17, 2011 at 11:38 AM, Andreas Weiler andreas.weiler@uni-konstanz.de wrote:
Hi Adrien, for an easy example you could do the following: save your steps in a textfile, like: create db test <test/> xquery . then run basex like the following (using the BaseX.jar): java -cp BaseX.jar org.basex.BaseX < script All commands for your script can be found in our wiki: http://docs.basex.org/wiki/Commands I hope this helps, don't hesitate to ask for more information. -- Andreas Am 17.03.2011 um 16:27 schrieb Adrien Guillon:
Hello BaseX community,
I am writing a script to load a RDBMS with some information from large XML files (1GB). I am using BaseX and XQuery to process the files and generate appropriate data dumps for bulk loading the database. My ultimate goal is to write a couple BASH scripts that will just load up the database, however I need some advice on how to script BaseX. I would like to load the XML file, generate a couple indexes, run my queries, then delete the indexes. It does not look like BaseX is so easily scripted from the command line, unless I initially load the database or run a BaseX server. I have tried running BaseX just using doc() inside the XQuery but this takes forever...
Ideally I would want to write as script like this:
#!/bin/bash basex --generate-index --dbname="hello_world" file.xml basex --query qry.xml > result.xml basex --delete --dbname="hello world"
Any suggestions on how I can do this?
Thanks,
AJ _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
basex-talk@mailman.uni-konstanz.de