nfdi4plants / arc-to-invenio

Automatic building of a Docker container for converting ARCs to Invenio Metadata
MIT License
1 stars 0 forks source link

arc-to-invenio

CLI tool for creating invenio-rdm metadata records from ARCs.

Supported fields

full example record:

{
  "resource_type": {
    "id": "dataset"
  },
  "creators": [
    {
      "person_or_org": {
        "type": "personal",
        "name": "LN1, FN1",
        "given_name": "FN1",
        "family_name": "LN1",
        "identifiers": [
          {
            "scheme": "email",
            "identifier": "yes@yes.yes"
          },
          {
            "scheme": "orcid",
            "identifier": "0000-0000-0000-0000"
          }
        ]
      },
      "affiliations": [
        {
          "name": "Institute 1"
        }
      ]
    },
    {
      "person_or_org": {
        "type": "personal",
        "name": "LN2, FN2",
        "given_name": "FN2",
        "family_name": "LN2",
        "identifiers": [
          {
            "scheme": "email",
            "identifier": "yes@yes.yes"
          }
        ]
      },
      "affiliations": [
        {
          "name": "Institute 2"
        }
      ]
    }
  ],
  "title": "test investigation",
  "description": "this is a test investigation",
  "publication_date": "2023-04-25"
}

Development

Prerequisites:

Building

in the repo root:

./build.cmd or ./build.sh

Testing

in the repo root:

./build.cmd runtests or ./build.sh runtests

Building the docker container

in the repo root:

docker build . -t arc-to-invenio

Usage

Command line

arc-to-invenio [--help] --arc-directory <path> [--out-directory <path>] [--publication-date <publication date>]
                      [--format-output]

OPTIONS:

    --arc-directory, -p <path>
                          Specify a directory that contains the arc to convert.
    --out-directory, -o <path>
                          Optional. Specify a output directory for the invenio metadata record.
    --publication-date, -pd <publication date>
                          Optional. ISO 8601 formatted (yyyy-MM-dd) publication date to set on the record
    --format-output, -fmt Optional. Wether or not to format the output json document (e.g. use identations and
                          mutliline)
    --help                display this list of options.

Docker

The CLI tool is built and added to path inside the container, so you can either:

  1. Mount a directory containing the ARC to convert into the container and specify CLI args directly, e.g.

    docker run --mount type=bind,source=path/to/your/arc,target=/arc arc-to-invenio arc-to-invenio <arguments here>
  2. Running conversion inside the container, e.g.

    docker run -it arc-to-invenio

    then - inside the container -

    
    arc-to-invenio <arguments here>
  3. or combine these approaches, e.g

    docker run -it --mount type=bind,source=path/to/your/arc,target=/arc

    then - inside the container -

    arc-to-invenio <arguments here>