XQuery/Loading data
Motivation
[edit | edit source]You want to load your data into a native XML database (deserialization).
Methods
[edit | edit source]There are several methods available. The one you use depends on the number of files you want to load and the loading rules.
Use the web browser user interface
[edit | edit source]- ideal for a quick single file upload
Use a IDE tool such as oXygen
[edit | edit source]- just right click on any collection and select "Import file" or "Import Folders"
Use a WebDAV client
[edit | edit source]- ideal for bulk loads
- also allows you to move, copy and rename collections and files
- some IDE's like oXygen also have a WebDAV client built-in
Accessed through the http://localhost:8080/exist/webdav/db URL
List of WebDAV clients
- Built-in MAC WebDAV client
- Transmit for the MAC
- Windows WebDAV client
eXist WebDAV documentation http://www.exist-db.org/exist/apps/doc/webdav.xml
Use the Java client
[edit | edit source]- the client has a tool to add files as well as to restore a backup
Use an XQuery program
[edit | edit source]- Use the HTTP client GET to get a remote XML file and store it in the database
- Use the ft-client (FTP, SFTP etc.)
Use an Apache Ant script
[edit | edit source]Many native XML databases have a set of Apache Ant scripts for doing things such as:
- bulk loading data
- creating collections
- setting permissions
- executing an XQuery
- running a backup
- restoring a backup file
These are usually the consistent and allow filtering of files as you load.
A sample ant "loader" is listed here: http://en.wikibooks.org/wiki/Apache_Ant/Store_XML_data
Note that some XQuery scripts that are loaded into the database collections may require post-installations steps to make them executable by some users.
References
[edit | edit source]- eXist documentation page on uploading files: http://exist-db.org/exist/apps/doc/uploading-files.xml