Archived

If you are looking for the last documentation in the 4.x series, see 4.7.5. Looking for another version? See all documentation.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Note

This documentation relates to a work in progress during three focused sprints starting on August 29, 2016 and as such, the features and procedures described here may not be finalized and released.

There are two different methods available for exporting metadata and digital objects from a Fedora 4 repository. The first relies on Camel and the second is a command line utility. Both methods can export RDF and can be configured to also export binary resources.

Exporting Resources Using the Camel Serialization Module


The Camel Serializer Module is currently a proof of concept but has documentation and code. It works by listening for events about newly created resources, or edits to existing resources. As such, the re-indexer Camel component must be invoked to export resources that were created before it started listening, unless they are edited while the camel serializer is turned on.

Exporting Resources Using the Export Tool

The command line tool is part of the Import Export Utility. This tool can export an entire repository, or a subset, and is intended as a method for creating a complete backup of a single Fedora container and all its descendant resources. From there, it can be imported back into the same Fedora repository, a different Fedora Repository, or into another external system.

Installing the export tool

Fedora 4

The import/export utility is designed to work against the Fedora 4 REST API. Therefore, you first must have a running Fedora repository.

There are several ways to install a Fedora repository if you do not have one already available, see either:

  1. Quick Start, or
  2. Fedora Vagrant
    1. (optional step to turn off user authentication) edit the file at install_scripts/config and change FEDORA_AUTH=true to FEDORA_AUTH=false and save the file

Import/Export Utility

The import/export utility maybe be installed in one of two ways:

  1. Download executable jar (TBD)
  2. Build from source

Preparing sample data

Go to Fedora in a browser, and in the 'Create New Child Resource' form on the right hand side of the page, type a name (I used 'albums') into the Identifier box and click 'add'. This will create a sample Resource.

Navigate to that new resource at http://localhost:8080/fcrepo/rest/albums and create a new child resource there.  This time, change the type to binary and upload a sample binary file. I used a jpg image for this example.  The identifier will get filled in by Fedora if you don't choose one yourself.

You now have a Container to export (http://localhost:8080/fcrepo/rest/albums).

Using the export tool

Move to the directory where you downloaded the code (cd /opt/fcrepo-import-export for the vagrant install).   

To see all the available command line options:

java -jar fcrepo-import-export-driver/target/fcrepo-import-export-driver-0.0.1-SNAPSHOT.jar -h


To export all the RDF and binary resources in your sample container:

java -jar fcrepo-import-export-driver/target/fcrepo-import-export-driver-0.0.1-SNAPSHOT.jar -m export -r http://localhost:8080/fcrepo/rest/albums -d /tmp/descriptions -b /tmp/binaries


You should now have RDF resources exported to /tmp/descriptions and binary resources in /tmp/binaries.  If you do not want backups of the binaries, omit the -b flag.  You cannot export only binaries, you must include the -d flag.

There are other command line options available, e.g.,:
-u to provide a username and password for Fedora basic authentication.
With the vagrant box, if you have Fedora Auth turned on and are using the default settings, you would add the following to your command:

-u fedoraAdmin:secret3 


-x to use a different file extension on the exported rdf.
-l to change the rdf language used
For example if you want json-ld instead of turtle, use:

-x .json -l application/ld+json

The full list of available serializations is:

  • application/ld+json
  • application/n-triples
  • application/rdf+xml
  • text/n3 (or text/rdf+n3)
  • text/plain
  • text/turtle (or application/x-turtle)

(from RESTful HTTP API)

Importing resources

Exported resources may be imported back into the repository from which they came or into the same path in another repository instance.

Installing the import tool

The export tool is installed at the same time as the import tool, you can follow the instructions about for installing the export tool, if you have not done so already.

  • No labels