metafacture-mongodb

Metafacture Modules for MongoDB

License

License

Categories

Categories

MongoDB Data Databases
GroupId

GroupId

org.culturegraph
ArtifactId

ArtifactId

metafacture-mongodb
Last Version

Last Version

4.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

metafacture-mongodb
Metafacture Modules for MongoDB
Project URL

Project URL

http://github.com/culturegraph/metafacture-mongodb
Source Code Management

Source Code Management

http://github.com/culturegraph/metafacture-mongodb

Download metafacture-mongodb

How to add to project

<!-- https://jarcasting.com/artifacts/org.culturegraph/metafacture-mongodb/ -->
<dependency>
    <groupId>org.culturegraph</groupId>
    <artifactId>metafacture-mongodb</artifactId>
    <version>4.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.culturegraph/metafacture-mongodb/
implementation 'org.culturegraph:metafacture-mongodb:4.0.0'
// https://jarcasting.com/artifacts/org.culturegraph/metafacture-mongodb/
implementation ("org.culturegraph:metafacture-mongodb:4.0.0")
'org.culturegraph:metafacture-mongodb:jar:4.0.0'
<dependency org="org.culturegraph" name="metafacture-mongodb" rev="4.0.0">
  <artifact name="metafacture-mongodb" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.culturegraph', module='metafacture-mongodb', version='4.0.0')
)
libraryDependencies += "org.culturegraph" % "metafacture-mongodb" % "4.0.0"
[org.culturegraph/metafacture-mongodb "4.0.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.mongodb : mongodb-driver jar 3.4.1

provided (1)

Group / Artifact Type Version
org.culturegraph : metafacture-core jar 4.0.0

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.mockito : mockito-core jar 2.6.2

Project Modules

There are no modules declared in this project.

metafacture-mongodb

Metafacture meets MongoDB

About metafacture-mongodb

metafacture-mongodb is a plugin for Metafacture. It provides the modules to-mongodb and from-mongodb to store and retrieve Metafacture streams to and from Mongo database collections.

Key Features

  • Stores Metafacture streams to a Mongo database collection
  • Maps Metafacture records to MongoDB records
  • Retrieves stored records by using record identifiers
  • Keeps the hierachical structure of Metafacture records intact

Download and Install

metafacture-mongodb can be used as a plugin in the Metafacture distribution or as a Java library in your own programs.

Usage

Both modules need a MongoURI to connect to the Mongo database instance.

to-mongodb

Acts as a StreamReciever and writes each stream record as MongoDB record to the given MongoDB collection. This module provides no output.

from-mongodb

Acts as an ObjectPipe<String, StreamReceiver>. Each input string represents the identifier of one record, which is fetched from the given MongoDB collection and transformed to a Metafacture stream.

Examples

The following Flux script opens a file, interprets the content as pica records and stores them to a MongoDB database.

default fileName = FLUX_DIR + "10.pica";
default mongoUri = "mongodb://localhost/pica.records";

fileName|
open-file|
as-lines|
decode-pica|
to-mongodb(mongoUri);

This Flux script retrieves a record by its identifier and writes the stored stream to stdout:

default identifier = "1234567890";
default mongoUri = "mongodb://localhost/pica.records";

identifier|
from-mongodb(mongoUri)|
encode-formeta(style="multiline")|
write("stdout");
org.culturegraph

Versions

Version
4.0.0
0.2.2
0.2.1
0.2.0
0.0.0