Skip to content

Export a model

You export a model from the Export model dialog. This guide covers a direct export: writing your model to files in its own standard. To convert a model to a different standard instead, see Transform a model to another standard.

  • A model you can open in ModelDesk.
  1. Open your model.
  2. In the bar at the top of the page, select Export. It is in the same place on every page of the model.
  3. The Export model dialog opens.

The Export model dialog with mapping, format, and document dropdowns and two download buttons

  1. Leave Mapping on None (direct export). This exports the model in its own standard, without transforming it.
  2. Choose a Format. The available formats depend on the model’s standard. Each option shows the format name and its media type.
  3. If the format produces more than one file, use Document to choose which one to preview. When the format produces a single file, that file is already selected. The selected document is shown in the preview below.
  4. Download your export:
    • Select the download button (its tooltip reads Download current document) to save the selected document.
    • Select the archive button (its tooltip reads Download all documents as a zipped archive) to save every document together as a ZIP file.

Your browser downloads the file or ZIP archive. An export always reflects the model’s current working state, that is, the latest saved change; you cannot export an earlier commit or a named version. A direct export produces files only. It does not create a new model in your workspace.

A JSON Schema export writes every Document of the model as its own .json file. Choose a file under Document to preview it, or download them all as a ZIP.

  • File paths follow the Folders. A Document at the top of the model is written under its name, such as order.json. A Document inside a Folder is written under its Folder path, such as common/address.json, also when it is the model’s only Document. The ZIP holds the Folders as directories. A published model serves each file under the same path.
  • References between the files resolve. A link from one Document to the root schema or a $defs entry of another is written as a $ref to that file. Where the files’ $ids match their layout, or the target file declares no $id, the $ref is a relative path, such as common/address.json#/$defs/Address or ../order.json. Where the $ids do not match the layout, the $ref is the target’s $id.
  • Paths are unique and safe. Two Documents that would get the same path, compared without regard to case, are numbered, such as common.json and Common-2.json, and the references follow the number. A Folder name that is empty, and any name that is . or .., is written as _. So is each / or \ in a name, so no file lands outside the export. A Document without a name is written as model.json.
  • Some references become copies. A $ref into another file reaches only its root schema and its $defs entries. A link to any other schema in another Document is written as a copy of that schema, and the Export log in the dialog lists it as Reference written as a copy. To get a $ref, move the schema into $defs of its Document.
  • A Document without a root schema is left out. It has nothing to write, so the export skips it, writes the other Documents, and lists it in the Export log as Document left out.

With the CLI, modeldesk model export <model> --format "JSON Schema" -o <dir> writes each file into <dir>, with the Folder paths as subdirectories. Without -o, the CLI writes a single document to standard output, so for a model with several Documents it stops with exit code 2. Pass -o <dir>, or --compressed -o <file> for one ZIP.

In a MIM model, an export writes a connected Extern package in full, as other tools expect it, and an unconnected one as it is. An element two packages hold is written once, under the first of them. When an export through a mapping, such as MIM to UML for XMI, meets a reference to an element of another model that no package holds, it leaves the reference out and lists it in the Export log, ending “Add the element to a package that represents that model.” See Export a model with Extern packages.

  • The Mapping list shows only “None (direct export)”. No transformation applies to this model, which is exactly what you want for a direct export. To learn when transformations are offered, see Transform a model to another standard.
  • The Format you expected is not listed. The formats offered depend on the model’s standard. See Supported standards & formats for what each standard can produce.
  • The preview is empty or the download buttons are missing. The document is still loading. Wait a moment, or select the Format again.