Export Projects

How It Works

$ npm run start -- export-projects -h
Usage: robosaur export-projects [options] <configFile>

Export all projects based on the given config file

Options:
  -u --unzip  Unzips the exported projects, only storing the final version accepted by reviewers
  -h, --help  display help for command
  • Robosaur will try to export each projects previously created by the create-projects command. Each project will be saved as a separate zip file under the supplied directory in export.prefix.

  • By default, Robosaur will request for a full project export - with each labelers' version of the project document included. For simpler workflows, where we only need the final version of the document, we can use the --unzip option. With this option set, Robosaur will only save the final version of the document to the export destination.

  • Robosaur will export all the projects that fulfilled the filter and not yet recorded by the state. It will only export each project once.

Configuration

{
  ...
  "export": {
    "source": "local",
    "prefix": "path/to/export/root",
    "teamId": "<TEAM_ID>",
    "statusFilter": [],
    "format": "JSON_ADVANCED",
    "fileTransformerId": null
  },
  ...
}

Storage Options

Just like any other source, you can find the detailed explanation here.

Format

Refers to the export result. Please see this page to know all the supported formats.

File Transformer ID

If you want to custom transformation for your export result, you can utilize this custom script.

  1. You must create it on the app through https://app.datasaur.ai/teams/{team-ID}/custom-scripts.

  2. Open the custom script and get the ID from the URL.

Filter

Robosaur supports filtering which project to export by the project status. Overall, there are five different project statuses, from earliest to the latest. If it's empty, then it won't filter any statuses.

  • CREATED: projects that haven't been opened by any labelers

  • IN_PROGRESS: project that have been opened by one of the labelers

  • REVIEW_READY: projects that have been finished by all of the labelers

  • IN_REVIEW: projects in REVIEW_READY that have been opened by one of the reviewers

  • COMPLETE: projects that are already marked as completed by any reviewers

Execution Modes

Stateful Project Export (Default Approach)

In project export using export-projects, the JSON state file that is configured by projectState attribute is treated as the source of truth.

Only projects found in the state file, i.e. projects that are created by Robosaur, will be checked against the statusFilter and exported. Robosaur will also record the project state when it was last exported, and subsequent runs will only export the project if there had been a forward change in the project status.

Stateless project export

Robosaur also supports exporting projects that are not created by Robosaur (stateless). To do this add the following options to the configuration file:

  1. "executionMode"

    Specifies whether the projects to be exported is created with Robosaur or not. Fill with "stateless" for projects created outside Robosaur and "stateful" for projects created with Robosaur. The default value is "stateful".

  2. "projectFilter"

    Specifies which projects to be exported. Contains the following value:

    • "kind" (required)

      TOKEN_BASED, ROW_BASED, or DOCUMENT_BASED

    • "date"

      • "newestDate" (required)

        Ignores all projects created after this date.

      • "oldestDate"

        Ignores all projects created before this date.

See the example configuration below.

...
"export": {
  "source": "local",
  "prefix": "quickstart/token-based/export",
  "teamId": "1",
  "statusFilter": [],
  "executionMode": "stateless",
  "projectFilter": {
    "kind": "TOKEN_BASED",
    "date": {
      "newestDate": "2022-03-11",
      "oldestDate": "2022-03-07"
    }
  },
  "format": "JSON_ADVANCED",
  "fileTransformerId": null
},
...

Last updated