Metafacture is a toolkit for processing semi-structured data with a focus on library metadata. It provides a versatile set of tools for reading, writing and transforming data. Metafacture can be used as a stand-alone application or as a java library in other applications. The name Metafacture is a portmanteau of the words meta data and manufacture.
Metafacture consists of a core library and a number of plugin packages and satellite projects which build on the core library and extend it with additional tools and features. This page describes the core package. Have a look at the Plugins and Tools page on the wiki for an overview of the supplementary packages and projects.
Originally, Metafacture was developed as part of the Culturegraph platform but its now used by others, too: see who uses Metafacture.
See the .travis.yml file for details on the CI config used by Travis.
You can use Metafacture either as a stand-alone application or as a Java library in your own projects.
If you are only interested in running Flux scripts without doing any Java programming this is the way to go. The instructions assume that you are using a *nix-like shell.
-
Download the latest distribution package from the metafacture-core/releases page. Make sure that you do download a distribution package and not a source code package.
-
Extract the downloaded archive:
$ tar xzf metafacture-runner-VERSION-dist.tar.gz
This will create a new directory containing a ready-to-use metafacture distribution.
-
Change into the newly created directory:
$ cd metafacture-runner-VERSION
-
Run one of the example scripts:
$ ./flux.sh examples/read/marc21/read-marc21.flux
This example will print a number of marc21 records on standard out.
The examples folder contains many more examples which provide a good starting point for learning metafacture. If you have any questions please join our mailing list or use our issue-based discussion forum over at metafacture-documentation.
If you want use Metafacture in your own Java projects all you need to do is to include the metafacture-core package as a dependency in your project. metafacture-core is available from Maven Central. To use it, add the following dependency declaration to your pom.xml
:
<dependency>
<groupId>org.culturegraph</groupId>
<artifactId>metafacture-core</artifactId>
<version>4.0.0</version>
</dependency>
Our integration server automatically publishes successful builds of the master branch as snapshot versions on Sonatype OSS Repository.
Building metafacture-core from source is easy. All you need is git and maven:
-
Clone the metafacture-core repository:
$ git clone https://github.com/culturegraph/metafacture-core.git
-
Build and install in your local repository:
$ mvn clean install
It is important to perform this step before importing the project into your IDE because it generates the lexer and parser sources for Flux from antlr grammar definitions. Otherwise your IDE will fail to compile the sources if it has integrated background compilation (like Eclipse has, for instance).
See Code Quality and Style on the wiki for further information on the sources.
For support and discussion join the mailing list.