import Command

The import command converts a format-specific snapshot file into a Mauro JSON model file.

Synopsis

MauroImportExport.Cli import FORMAT INPUT OUT-MODEL-JSON 
                         [--param KEY=VALUE]... [--store-key KEY] [--overwrite]
                         [--show-params] [--verbose] [--log-file FILE] [--log-level LEVEL]

Description

The import command reads a snapshot file in the specified format and converts it to a Mauro JSON model. The imported model is:

  • Written to the specified output JSON file
  • Stored in the in-memory model store for subsequent use
  • Validated against the Mauro model schema

The command supports parameterised import behaviour through the --param option, allowing customisation of how the source format is interpreted.

Arguments

FORMAT
Format identifier for the input file (e.g., skos, xmi, jsonschema). Use list-formats to see available importers.
INPUT
Path to the input snapshot file to import. Can be a single file, directory, or ZIP archive depending on format requirements.
OUT-MODEL-JSON
Path where the output Mauro JSON model file will be written.

Options

--param KEY=VALUE
Specify an importer parameter. Can be repeated for multiple parameters. Use import FORMAT --show-params to see available parameters.
--store-key KEY
Specify a key for storing the imported model in memory. Use "auto" or omit for automatic key generation.
--overwrite
Overwrite the output file if it exists, and overwrite any existing model with the same store key.
--show-params
Display available parameters for the importer without performing import. INPUT and OUT-MODEL-JSON arguments are not required when using this option.
--verbose
Enable verbose output showing detailed progress and diagnostic information.
--log-file FILE
Path to log file
--log-level LEVEL
Minimum logging level

Exit Status

Code Description
0 Success - model imported and written
1 Import failed (invalid file, format error, validation error)
130 Operation cancelled

Import SKOS Vocabulary

MauroImportExport.Cli import skos vocabulary.ttl model.json

Import with Custom Store Key

MauroImportExport.Cli import skos vocabulary.ttl model.json --store-key vocab1 --overwrite

Import with Parameters

MauroImportExport.Cli import xmi model.xmi output.json --param namespace=http://example.org --verbose

Show Available Parameters

MauroImportExport.Cli import jsonschema --show-params

Model Validation

After import, the model is validated against the Mauro schema. Validation errors are displayed but do not prevent the model from being written to file. The model must pass validation before it can be uploaded to a Mauro Data Mapper endpoint.

In-Memory Store

Imported models are stored in memory using either:

  • An automatically generated key (default)
  • A user-specified key via --store-key

Stored models can be accessed by subsequent export commands using the --input-key option. Use list-models to view stored models.

Notes

Important:

The INPUT and OUT-MODEL-JSON arguments are required unless --show-params is specified.

Tip:

Use --verbose to see detailed import progress and any warnings about the source data.