Thanks Dirk and Eliot, Dirk's suggestion about the WRITEBACK option looks very promising, I'm gonna try it out but I guess it would fit my needs. Update: just tried it and it seems to work also on docs previously imported in a database and retrieved using db:open("DBname", "filename") so that's even better than providing the full path. I was well aware of the bad performances caused by working outside the optimized basex data model (hard to beat a key-value optimized datastore) but performances are not an issue for my specific application. Eliot's project sounds also very cool but I think it's a bit too much of an effort for the initial proof-of-concept tests that I have in mind.
Thanks for the great suggestions and timely support... that was FAST :) Best, Enea
2016-02-10 13:55 GMT+01:00 basex-talk-request@mailman.uni-konstanz.de:
Send BaseX-Talk mailing list submissions to basex-talk@mailman.uni-konstanz.de
To subscribe or unsubscribe via the World Wide Web, visit https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk or, via email, send a message with subject or body 'help' to basex-talk-request@mailman.uni-konstanz.de
You can reach the person managing the list at basex-talk-owner@mailman.uni-konstanz.de
When replying, please edit your Subject line so it is more specific than "Re: Contents of BaseX-Talk digest..."
Today's Topics:
- BaseX and Git versioning of XML at the same time (Enea Parimbelli)
- Re: BaseX and Git versioning of XML at the same time (Dirk Kirsten)
- Re: BaseX and Git versioning of XML at the same time (Eliot Kimber)
Message: 1 Date: Wed, 10 Feb 2016 13:33:58 +0100 From: Enea Parimbelli enea.parimbelli@gmail.com To: basex-talk@mailman.uni-konstanz.de Subject: [basex-talk] BaseX and Git versioning of XML at the same time Message-ID: <CABz3M_P4mWEsG20tws+UiCXoTbzXTEQqzX7-Ew=+kJJq= pZsYg@mail.gmail.com> Content-Type: text/plain; charset="utf-8"
Dear all, I'm Enea from Italy (working at the university of Pavia) and this is my first email to this list and I hope you'll forgive my dumb question. For one of my projects I was planning to use BaseX to be able to run Xqueries to manipulate a bunch of XMLs that I have on my filesystem (i.e. to take advantage of what XQuery can do vs manual editing of the xml files). At the same time I would like to have a version control system (Git in my case) control my files to be able to diff, branch, revert changes etc. However the way BaseX internally stores files is preventing me from doing this easily.
Here is an example of what I have in mind: 0. I have a bunch of xmls in a folder (versioned with a git repo)
- I create a baseX database from these
- Run a bunch of updates/edits on the files using Xquery processor from
basex 3. move back to git to diff what I've accomplished, commit, etc. 4. (possibly more advanced, not sure if I really need this) I want to be able to checkout a previous version of the files and have basex do the same (i.e. if I run a query now I want it to run on the version of the xmls that I have currently checked-out in my filesystem)
Here are the (dumb) questions:
- Is there a way for basex (maybe some config settings when I create the
database?) to work keeping on the plain xml files? In a way that every update query would actually change the original xml files (which I can view with a plain text editor even "outside" the basex environment)? 2. Is the only way of immediately seeing the changes I made to the xml files to export the database after every update? 3. (assuming 1 is doable) Would it be possible to have baseX recognize the changes made to the xml files using an external editor (i.e. not through xqueries run in basex)? 4. From your experience is BaseX the proper tool for my purposes? It feels to me that I merely want to use its xquery processor capabilities (and I don't need the full-fledged database) while keeping the files plainly stored in my filesystem... any suggestion on alternative options if baseX doesn't sound like the right one?
Thanks in advance for the help, and congratulations on the great work (I used basex in the past in a more orthodox way and was impressed by the numerous nice features... including being the nice GUI and the hassle-free integration with tomcat!)
Best regards, Enea Parimbelli
-- Dr. Enea Parimbelli Post-doctoral research fellow Laboratory for Biomedical Informatics "Mario Stefanelli" Department of Electrical, Computer and Biomedical Engineering University of Pavia, Italy e-mail: enea.parimbelli@gmail.com phone: +39-0382-985057 +39-0382-985981 http://www.labmedinfo.org/people/parimbelli
basex-talk@mailman.uni-konstanz.de