Jump to content

XQuery/Loading data

From Wikibooks, open books for an open world

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]
  1. ideal for a quick single file upload

Use a IDE tool such as oXygen

[edit | edit source]
  1. just right click on any collection and select "Import file" or "Import Folders"

Use a WebDAV client

[edit | edit source]
  1. ideal for bulk loads
  2. also allows you to move, copy and rename collections and files
  3. 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

  1. Built-in MAC WebDAV client
  2. Transmit for the MAC
  3. Windows WebDAV client

eXist WebDAV documentation http://www.exist-db.org/exist/apps/doc/webdav.xml

Use the Java client

[edit | edit source]
  1. the client has a tool to add files as well as to restore a backup

Use an XQuery program

[edit | edit source]
  1. Use the HTTP client GET to get a remote XML file and store it in the database
  2. 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:

  1. bulk loading data
  2. creating collections
  3. setting permissions
  4. executing an XQuery
  5. running a backup
  6. 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]