SysMLSystems Modeling Language A graphical modeling language for systems engineering, based on UML, with block, activity, state machine and parametric diagrams. v2
Exchanging SysML v2 Models
Import .sysml files, zip archives and SysML v2 JSON into a SysML v2 project with a preview, and export the model or a package as .sysml text or SysML v2 JSON.
On this page
Overview
SysMLSystems Modeling Language A graphical modeling language for systems engineering, based on UML, with block, activity, state machine and parametric diagrams. v2 projects exchange models with other SysML v2 tools as files. The Import and Export page (Model → Import and Export) does both:
- Import reads
.sysmlfiles, a.zipof.sysmlfiles, or a SysML v2 JSON file. It shows a preview of what changes, then applies it to this project as one undo step, or creates a new SysML v2 project. - Export writes the whole model or one package as SysML v2 text (
.sysml) or as SysML v2 JSON (.json).
You can also create a project straight from files: on Manage Projects, click Project Files ▾ → Import SysML v2 Files….
Tip: To keep the model in step with a SysML v2 model repository that offers the Systems Modeling API, use the Repository section of the same page: see Pull from and push to a repository.
Concepts
File formats
| Format | What it holds | Import | Export |
|---|---|---|---|
SysML v2 text (.sysml) | The textual notation, one file per top-level package. | Yes | Yes |
Zip archive (.zip) | Several .sysml files. Folders become packages. | Yes | Yes, when several files are exported |
SysML v2 JSON (.json) | A flat list of elements, each with @id and @type, as the Systems Modeling API uses. | Yes | Yes |
KerML files (.kerml) are not imported yet.
Ids and matching
Every element in a SysMLSystems Modeling Language A graphical modeling language for systems engineering, based on UML, with block, activity, state machine and parametric diagrams. v2 project has an id. The two formats keep it differently:
- JSON keeps ids. An element imported again from JSON matches the element with the same id.
- Text does not hold ids. When
.sysmltext is imported into a project, Holarch matches top-level packages by name, and the elements inside them by their names. Ids are kept where elements match.
Export notes this under the export controls: "Element ids are kept in JSON. The text keeps the model; ids are matched by name when it is imported again."
Folders become packages
In a zip archive, each folder becomes a package that holds its files and subfolders. A file powertrain/engine.sysml inside the archive is read as if it were written inside package powertrain { … }. Files at the top of the archive are read as they are. Folders and files are read in name order.
What the preview compares
The preview has one row per top-level package (or, for a new project, per top-level element). Each row has a result:
| Result | Meaning | Imported by default |
|---|---|---|
| New | The project has no package of that name (or id). It is added. | Yes |
| Changed | The project has the package; the import adds, changes or removes elements in it. The detail says how many, for example "3 added, 1 changed (ids kept where elements match)". | Yes |
| Unchanged | The package is the same as in this project. | No (nothing to do) |
| Conflict | The package cannot be merged. The detail says why and what to do. | No |
How to use it
When and why
Use Import and Export when a model moves between Holarch and another SysMLSystems Modeling Language A graphical modeling language for systems engineering, based on UML, with block, activity, state machine and parametric diagrams. v2 tool, or between Holarch projects:
- Start a Holarch project from a model written elsewhere.
- Bring in a package another team maintains, such as a component library, and update it when they send a new version.
- Hand a package to a supplier or to a tool that reads SysML v2 text or JSON.
- Keep
.sysmlfiles in your own version control next to the Holarch project.
Import files into this project
- Open Model → Import and Export.
- Under Import, choose Into this project.
- Drop the files on the drop zone, or click it and choose them.
You see "Reading the files…", then the preview: the number of top-level packages and files, any problems, and a table with Import, Package, Elements and Result.
- Read the problems list, if there is one. It names each file and line that does not parse and each file that was skipped.
- Untick any package you do not want to import. To replace a package that conflicts by name, tick it.
- Click Import N Packages.
The toast reads "Imported N packages." The page says "Imported N packages (M elements). Undo reverts the import in one step." Click Open Text to see them.
Import files into a new project
- Open Model → Import and Export and choose Into a new SysML v2 project.
- Drop or choose the files.
The preview lists the top-level elements, all ticked.
- Untick any you do not want, and edit the Project name. It defaults to the name of the single file, or the first package.
- Click Create Project.
The new project opens in the Editor.
From Manage Projects, Project Files ▾ → Import SysML v2 Files… does the same in one step. If parts of the files cannot be read, it asks first: "N problems found: parts of the files are left out. Create the project with the rest? To see the problems first, open a SysML v2 project and use Import and Export." Click Create Project to continue.
Update a package from a new version
- Export or receive the new version as
.sysmlfiles or JSON. - Import it Into this project.
The package shows Changed, with the number of elements added, changed and removed.
- Click Import 1 Package.
Elements that match keep their ids, so the links to them (requirements links, risks, view layouts, comments) stay. Elements that are no longer in the file move to the Trash.
Export the model or a package
- Open Model → Import and Export.
- Under Export, choose what to export: The whole model, or a package by its qualified name.
- Choose the format: SysML v2 text (.sysml; a .zip for several packages) or SysML v2 JSON (.json).
- Click Export.
One file downloads, or a zip when the export holds several files. The toast reads "Exported <file>." or "Exported N files as a zip."
To export one package quickly, use the Browser: the row menu of a package has Export as .sysml and Export as JSON.
Pull from and push to a repository
Connect the project to one branch of a SysML v2 model repository to read its latest commit and to send your changes back.
- Open Model → Import and Export and find the Repository section.
- Enter the Repository address (the https address of its Systems Modeling API) and, if the repository needs one, the Access token.
- Click Load Projects, then choose the Project and the Branch. To start a new repository project from this model, click New Repository Project instead.
- Click Pull…. Holarch reads the branch's latest commit and lists each difference: New, Changed, Removed or Conflict. You see "Up to date: no changes in the repository." when there is nothing to pull.
- Untick the differences you do not want, then click Apply Pull. The pull is one undo step.
- After you change the model, click Push. Your changes since the last synced commit go to the branch as one new commit. You see, for example, "Pushed 3 changed as commit 1a2b3c4d."
A Conflict is an element changed both here and in the repository since the last sync. An unticked conflict keeps this project's version.
Note: A push is refused when the branch has commits that this project has not pulled: "The repository branch has commits that this project has not pulled. Pull first, then push again."
Worked example: the Hybrid Car demo
Create the demo first: on Manage Projects, click Project Files ▾ → New Demo Project → Hybrid Car (SysML v2).
- Open Model → Import and Export. Under Export, choose The whole model and SysML v2 text, then click Export.
A zip downloads with one file per top-level package, such as
Vehicles.sysml,VehicleRequirements.sysml,VehicleBehavior.sysmlandVehicleViews.sysml. - Open
VehicleRequirements.sysmlin a text editor. Changeattribute maxCurbMass : MassValue = 1650 [kg];to1600 [kg]and save. - Back on Import and Export, choose Into this project and drop
VehicleRequirements.sysml.The preview shows VehicleRequirements as Changed, with the number of changed elements. The other packages are not in the file, so they are not listed.
- Click Import 1 Package.
The value changes in the model. The requirement Sedan Mass (VR-1.1) names
maxCurbMass, so its links become suspect (see Requirements and Verification in SysML v2 Projects). Press ⌘Z / Ctrl+Z to undo the import. - To start a second project from the same files, choose Into a new SysML v2 project, drop the zip and click Create Project.
Tips and good practice
- Use JSON to move a model between SysML v2 tools when ids matter, for example when the other tool keeps links by id. Use text when people read or review the files.
- Keep one top-level package per file. Export writes files that way, and a later import then matches package by package.
- Import a package from another team into its own top-level package. Updates then touch only that package.
- Check the problems list before you import. Members that do not parse are left out.
Common mistakes
- A package shows Conflict: "A package named X with other ids exists." The project has a package of that name that was not imported from this JSON. Tick the row to replace it (the old package moves to the Trash), or import into a new project.
- "The import holds two top-level packages named X; only the first is imported." Two files declare the same top-level package. Merge them into one file, or rename one.
- Elements are missing after the import. A member that does not parse is left out: "This member does not parse and is left out." Fix the line the problems list names, then import again.
- A JSON import is refused. Import one SysML v2 JSON file at a time, without
.sysmlfiles.
How it connects to other features
- Editor: imported packages open there; exported files are the text you see there.
- Undo and Trash: an import into this project is one undo step; elements it removes or replaces go to the Trash.
- Change control: values and documentation that change through an import make requirement links suspect, like any other edit.
- Holarch project files: Export this project… on Manage Projects saves the whole Holarch project, with risks, documents and other Holarch data.
.sysmland JSON hold only the model. - Conversion: to move a model between LMLLifecycle Modeling Language An open modeling language with a small set of classes and relationships that covers a system's whole lifecycle. Holarch models are LML models. and SysML v2, make a converted copy (see Converting Between LML and SysML v2).
The Import and Export page
Import
| Control | Use |
|---|---|
| Into this project | Merge the files into the open project. Not available to people who can only view the project; for them, imports create a new project. |
| Into a new SysML v2 project | Create a new project from the files. |
| Drop zone | "Drop files here or click to choose them". Accepts .sysml files, a .zip of .sysml files, or one SysML v2 JSON file. |
| Preview table | Import (tick box), Package (name and kind), Elements (count), Result (New, Changed, Unchanged or Conflict, with a detail). |
| Project name | (New project only) The name of the new project, up to 200 characters. |
| Import N Packages / Create Project | Apply the import. |
| Cancel | Close the preview without importing. |
Elements outside any package in .sysml text are listed together in one row, Outside packages.
When the model changes while a preview is open (another tab, a collaborator, or Undo), the preview is computed again.
Export
| Control | Use |
|---|---|
| Export (scope) | The whole model, or any package by qualified name. |
| as (format) | SysML v2 text (.sysml; a .zip for several packages) or SysML v2 JSON (.json). |
| Export | Download the file. |
Text export writes one file per top-level package, named after it (Vehicles.sysml). Elements outside packages go into Outside packages.sysml. JSON export writes one file named after the project or the package.
Repository
The Repository section links the project to one branch of a repository that offers the Systems Modeling API.
- Repository address: the https address of the repository's API. Holarch connects only to https addresses on public hosts; site administrators can limit the hosts and ports.
- Access token: stored encrypted for your account and this project, and sent only to that address. It is never shown again; leave the field empty to keep the stored token.
- Load Projects, Project and Branch: choose where to sync. New Repository Project creates a project in the repository for this model.
- Pull…, Apply Pull: read the latest commit, review the differences and apply them as one undo step. Holarch compares against the commit it synced last, so it can tell your changes from the repository's.
- Push: send the changes since the last synced commit as one commit. "Nothing to push: the model matches the last synced commit." means there is nothing new.
- Settings… changes the connection. Disconnect removes the stored token and the sync state; the model stays.
- Repository operations need the editor role. Viewers cannot pull or push.
- Pushes are refused for projects with regulated-data markings.
How files are read
- Files are checked before anything is read: their sizes, counts, nesting and text lengths.
- In a zip, hidden files and
__MACOSXfolders are ignored. Links, files outside.sysml, and a second copy of the same path are skipped, and the problems list says why. - Text must be UTF-8. A byte-order mark is allowed.
- Each imported element is checked before it is written. An element that is refused takes its owned members with it; the problems list counts them.
- In JSON, an element kind Holarch does not support is left out, and its members move to its owner.
Messages
| Message | Meaning and fix |
|---|---|
| Choose .sysml files, a .zip of .sysml files or a SysML v2 JSON file. | No files were chosen. |
| No .sysml files were found. Choose .sysml files, a .zip of .sysml files or a SysML v2 JSON file. | The archive or selection holds no .sysml files. |
| Import one SysML v2 JSON file at a time, without .sysml files. | Several JSON files, or JSON mixed with text, were chosen. |
| <file> is not UTF-8 text. Save it as UTF-8 and import it again. | Convert the file's encoding. |
| <file> is not a valid ZIP archive. Create the archive again. | The archive is damaged. |
| <file> holds encrypted files. Create the archive without a password. | Password-protected archives are not read. |
| <path> is compressed more than 200:1, which is typical of a zip bomb. Create the archive again. | The archive was refused for safety. |
| The archive uses a compression method that is not supported. Create it with standard ZIP compression. | Use standard (deflate) compression. |
| KerML files are not imported yet. | .kerml files are skipped. |
| Only .sysml files are imported from an archive. | Other files in a zip are skipped. |
| Links are not imported. | Symbolic links in a zip are skipped. |
| The archive holds this file twice; the first copy is imported. | Two entries have the same path. |
| <file> is not valid JSON. Export the model again. | The JSON file is damaged. |
| <file> is not SysML v2 JSON (a list of elements with @id and @type). Choose a SysML v2 JSON export. | The JSON is some other format. |
| Line N of <file> is longer than 64 KB. Break the line, then import the file again. | Very long lines are refused. |
| This member does not parse and is left out. | Fix the line named in the problems list. |
| An element with this id sits inside <element> in this project. Move it to the top level first, or import into a new project. | (Conflict) The JSON's top-level package already exists deeper in the model. |
| N element ids of it are used elsewhere in this project. Import into a new project instead. | (Conflict) The JSON reuses ids of other elements. |
| The package text does not parse after printing. Import it into a new project. | (Conflict) The package could not be merged. |
| The import was not applied: … Nothing was changed. | The import failed; the project is unchanged. |
| The model is empty. Add a package, then export again. | There is nothing to export. |
| The package to export no longer exists. Choose another one. | The package was deleted while the page was open. |
Limits
| Limit | Value |
|---|---|
| Files per import | 2,000 |
.sysml text per import (unpacked) | 8 MB |
| Zip archive | 16 MB, 10,000 entries |
| Folder nesting in a zip | 32 folders |
| JSON file | 24 MB, 100,000 elements, nesting 64 levels |
| Line length | 64 KB |
- Repository replies are capped at 64 MB for a whole pull, and each repository operation stops after 120 seconds.
- Each account can run at most 300 repository operations per hour.
- KerML (
.kerml) files are not imported yet. - Holarch data next to the model (requirement status, risks, budgets, simulator settings, view layouts) is not part of
.sysmlor JSON files. Use Export this project… on Manage Projects to keep it.
Related pages
- The Text Editor and Browser
- Converting Between LML and SysML v2
- Getting Started with SysML v2 Projects
- Import and Export for LMLLifecycle Modeling Language An open modeling language with a small set of classes and relationships that covers a system's whole lifecycle. Holarch models are LML models. projects and Holarch project files.
SysMLSystems Modeling Language A graphical modeling language for systems engineering, based on UML, with block, activity, state machine and parametric diagrams.® and OMGObject Management Group The standards body that maintains UML, SysML, UAF and XMI.® are registered trademarks of Object Management Group, Inc. in the United States and other countries.