sinopia_exporter
Export RDF entities from a group in Sinopia Server (Sinopia's particular configuration of trellis-ext-db)
Last updated 4 months ago by jermnelson .
Apache-2.0 · Original npm · Tarball · package.json
$ cnpm install sinopia_exporter 
SYNC missed versions from official npm registry.

Sinopia Exporter

CircleCI Code Climate Code Climate Test Coverage

Plain local export

Dependencies

This is a Node project, so once you clone the repo, you'll want to do an npm install if you intend to run the app natively (the bin/export script is a very thin wrapper).

Usage

Invoke the bin/export script with the name of the group to be exported as a parameter. E.g. to export RDF for the ucdavis group:

$ ./bin/export 'ucdavis' # group name in Sinopia/Trellis

...which should leave you with output like:

$ tree exported_rdf/
exported_rdf/
└── ucdavis_2019-08-05T23:11:54.601Z
    ├── 0c9895ff-9470-4c70-bee4-b791ee179b34
    └── complete.log
  • The output will land in the configured exportBasePath (defaults to ./exported_rdf), in a subdirectory named for the exported group and the time at which the export was run.
  • Each RDF resource will have its own file (named for the resource).
  • complete.log will be written at the end of a successful run.

Alternatively, instead of a group, you can export from all groups at once by specifying '_ALL_' instead of a group name, e.g.:

$ ./bin/export '_ALL_'

...which should leave you with output similar to what's described above, but with a directory for each group, all inside of one containing directory for the export, named sinopia_export_all_<date>, e.g.:

$ tree exported_rdf/
exported_rdf/
└── sinopia_export_all_2019-10-20T07:29:16.412Z
    ├── complete.log
    ├── group1_2019-10-20T07:29:16.412Z
    │   ├── complete.log
    │   ├── resource1
    │   ├── resource2
    │   └── resource3
    ├── group2_2019-10-20T07:29:16.412Z
    │   ├── complete.log
    │   ├── resource4
    │   ├── resource5
    │   └── resource6
    └── group3_2019-10-20T07:29:16.412Z
        ├── complete.log
        ├── resource7
        ├── resource8
        └── resource9

Docker export

Docker export performs an export of all groups, and zips up the results. If provided with the S3_BUCKET env var, it will clear the specified S3 bucket, then copy the newly exported resources to it.

To build and run the Docker container:

docker build . -t "ld4p/sinopia_exporter"
docker run --rm "ld4p/sinopia_exporter"

To push:

docker push ld4p/sinopia_exporter

For local testing purposes, you may want to link in a local directory (-v) to view the results. E.g.:

docker run --rm -v ~/data/ld4p/sinopia_exporter/exported_rdf:/home/circleci/exported_rdf "ld4p/sinopia_exporter"

Configuration

The export container uses the following environment variables:

Current Tags

  • 1.0.13                                ...           latest (4 months ago)

2 Versions

  • 1.0.13                                ...           4 months ago
  • 1.0.12                                ...           4 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (8)
Dev Dependencies (8)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |