JSON Format
The JSON format is the native Mauro Data Mapper model interchange format, providing complete fidelity for all model elements and metadata.
Overview
The JSON format (identifier: json) is the primary interchange format for Mauro Data Mapper models. It provides:
- Complete representation of all model elements
- Full metadata preservation
- Lossless round-trip capability
- Human-readable structure
- Validation against JSON schema
Format Identifier
Format: json
File Extension: .json
Direction Support
| Direction | Supported | Version |
|---|---|---|
| Import | Yes | 2.0.0 |
| Export | Yes | 2.0.0 |
Parameters
The JSON importer and exporter support the following parameters:
| Parameter | Direction | Type | Default | Description |
|---|---|---|---|---|
| indented | Export | Boolean | true | Format output with indentation for readability |
| schemaVersion | Import/Export | String | 2.0.0 | JSON schema version to use |
Model Structure
The JSON format represents a Mauro model as a hierarchical structure containing:
- dataModel
- Root model container with label, description, and metadata
- dataClasses
- Collection of data classes (tables/entities)
- dataElements
- Individual data elements (columns/fields) within classes
- dataTypes
- Type definitions (primitive, reference, enumeration)
- metadata
- Key-value pairs for additional model information
Examples
The following examples illustrate the use of the JSON format
Export Model to JSON
MauroImportExport.Cli export json model.json output.json --param indented=true
Import JSON Model
MauroImportExport.Cli import json source.json imported.json --store-key model1
Convert to JSON with Compact Output
MauroImportExport.Cli convert skos json vocabulary.ttl model.json --out-param indented=false
Best Practices
- Use indented format for version control and human readability
- Use compact format for minimal file size in automated systems
- Always validate models after import using the built-in validator
- Preserve schema version information for compatibility tracking
Compatibility
The JSON format follows semantic versioning:
- MAJOR version for breaking schema changes
- MINOR version for backwards-compatible additions
- PATCH version for bug fixes and clarifications
Current version 2.0.0 introduces improved metadata handling and validation rules.