Exporting Plain Text Data

Proximity provides the export-text.sh shell script (export-text.bat for Windows) for exporting data in Proximity databases to an XML format. You can only export complete databases, but you can prune and edit the resulting files if you want to preserve only a portion of the exported data, such as the data for a single attribute or container.

Exporting databases using plain text

Exercise 3.8 walks through the process of exporting the complete database created in Exercise 3.6.

Exercise 3.8. Exporting a database to plain text:

Before beginning, make sure that you are serving the MovieDB database using Mserver. Data files can only be exported to the same machine as that serving the database.

[Caution]

The export process overwrites existing data files in the output directory without warning. Make sure that output directory is empty or can be safely overwritten.

  1. Create a $PROX_HOME/doc/user/tutorial/examples/TextExport directory.

  2. Export the database. (Substitute the appropriate port number if you are using a different port.) You can only export text to an existing directory on the machine serving the database.

    > bin/export-text.sh localhost:30000 \
      $PROX_HOME/doc/user/tutorial/examples/TextExport
    

    Proximity outputs the following trace (leading information showing elapsed time and execution thread has been omitted from the trace for brevity):

    INFO kdl.prox.app.ExportTextApp - * exporting database to
      /proximity/doc/user/tutorial/examples/TextExport
    INFO kdl.prox.app.ExportTextApp -   Exporting object table
    INFO kdl.prox.app.ExportTextApp -   Exporting link table
    INFO kdl.prox.app.ExportTextApp -   Exporting attributes
    INFO kdl.prox.app.ExportTextApp - objtype
    INFO kdl.prox.app.ExportTextApp - title
    INFO kdl.prox.app.ExportTextApp - name
    INFO kdl.prox.app.ExportTextApp - birthyear
    INFO kdl.prox.app.ExportTextApp - linktype
    INFO kdl.prox.app.ExportTextApp - qgraph_query
    INFO kdl.prox.app.ExportTextApp -   Exporting containers
    INFO kdl.prox.app.ExportTextApp -      si_0
    INFO kdl.prox.app.ExportTextApp -      si_1
    INFO kdl.prox.app.ExportTextApp -      si_2
    INFO kdl.prox.app.ExportTextApp -      si_3
    INFO kdl.prox.app.ExportTextApp - * done exporting