uml4net.Tools 9.4.0

dotnet tool install --global uml4net.Tools --version 9.4.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local uml4net.Tools --version 9.4.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=uml4net.Tools&version=9.4.0
                    
nuke :add-package uml4net.Tools --version 9.4.0
                    

uml4net

Introduction

Uml4net is a suite of dotnet core libraries and tools that are used to deserialize (read) and serialize (write) a UML version 2.5.1 model in XMI 2.5.1 form. Uml4net is typically used to support opinionated template based code-generation and is a part of modeltopia. Uml4net provides a number of libraries that are described in the following sections.

uml4net

The core library that contains all the class definitions as they appear in the UML 2.5.1 specification. Together with uml4net.xmi it provides the capability to read and write UML models and make them available as an in-memory object graph. The derived properties of the metamodel are implemented, and the owner ends of composite associations are kept in sync with the containment.

uml4net.Extensions

The uml4net.Extensions library provides extensions methods to the uml4net library to support code generation. This library is part of the uml4net ecosystem.

uml4net.xmi

The uml4net.xmi library provides an XMI reader implementation to read UML XMI model files and an XMI writer implementation to write UML models to XMI:

  • Reading: references to other documents are resolved, also across documents found on disk or through path maps; stereotype applications are resolved against their profile and their tagged values are typed; content uml4net does not model, such as UML Diagram Interchange, is captured. In strict mode (the default) a document that is not valid XMI 2.5.1 is rejected with an exception that names the element, property and line position; otherwise the problem is logged and reading continues.
  • Writing: a model is written as it was read, including its documentation, MOF tags, stereotype applications and captured content, so that a document survives a read-write cycle. A selected Package can be written as well, where references to elements outside the selected package are either written as href references to the original document or the containing root packages are included in the written document, resulting in a self-contained XMI file. The writer can also write Canonical XMI (XMI 2.5.1 Annex B).

To learn more about how to read and write a UML model, read about it here

uml4net.xmi.Extensions.EnterpriseArchitect

The uml4net.xmi.Extensions.EnterpriseArchitect library is a specific XMI Reader extension to support Enterprise Architect XMI reading.

uml4net.HandleBars

The uml4net.HandleBars library provides HandleBars helpers to support code generation. This library is part of the uml4net ecosystem.

uml4net.Reporting

The uml4net.Reporting library contains reporting generators. This library is part of the uml4net ecosystem.

uml4net.Tools

The uml4net.Tools commandline application is used to generate reports on the content of the UML model. Find the documentation here.

It is available as a dotnet tool on NuGet and as a self-contained Windows executable (uml4net.Tools.exe) attached to each GitHub release. The executable comes with a signed build provenance attestation, see Build Provenance.

Code Quality

Quality Gate Status Code Smells Coverage Duplicated Lines (%) Lines of Code Maintainability Rating Reliability Rating Security Rating Technical Debt Vulnerabilities

Installation

The packages are available on Nuget at:

Reading a UML model

Reading a UML model is straightforward and is done using an IXmiReader. An instance of IXmiReader is created using the XmiReaderBuilder. Once the reader is available, point it to a UML model you want to read and you're off to the races:

var reader = XmiReaderBuilder.Create()
    .Build();

var xmiReaderResult = reader.Read("path-to-your-model");

var rootPackage = xmiReaderResult.QueryRoot("<xmi:id-of-the-root-package-you-are-interested-in>");

The IXmiReader can be configured with an IXmiReaderSettings, read more about reading an XMI document here

The IXmiReader is able to read and process StereoTypes as they are applied to UML model elements. Read more about that here

Writing a UML model

A UML model is written using an IXmiWriter, which is created using the XmiWriterBuilder. Writing the top-level elements of the document that was read, together with its XmiRoot, writes the whole document back:

var writer = XmiWriterBuilder.Create()
    .Build();

writer.Write(xmiReaderResult.DocumentRootElements, "path-to-the-written-model", xmiReaderResult.XmiRoot);

The IXmiWriter can be configured with an IXmiWriterSettings, for example to write Canonical XMI; read more about writing an XMI document here

Design Decisions

Some choices in uml4net are deliberate and can look surprising at first, such as single-valued composite properties exposed as IContainerList<T>, UnlimitedNatural values as string, or the order in which the writer writes the properties. They are recorded, with their reasons, in design-decisions.md.

Build Status

GitHub actions are used to build and test the uml4net libraries

Branch Build Status
Master Build Status
Development Build Status

UML Documentation

The Object Management Group (OMG) is an international technology standards consortium. It was founded in 1989 with the goal of creating and maintaining vendor-neutral, interoperable, and portable standards for distributed computing. UML is one of the standards provided by OMG at http://www.omg.org/spec/UML/

Software Bill of Materials (SBOM)

As part of our commitment to security and transparency, this project includes a Software Bill of Materials (SBOM) in the associated NuGet packages. The SBOM provides a detailed inventory of the components and dependencies included in the package, allowing you to track and verify the software components, their licenses, and versions.

Why SBOM?

  • Improved Transparency: Gain insight into the open-source and third-party components included in this package.
  • Security Assurance: By providing an SBOM, we enable users to more easily track vulnerabilities associated with the included components.
  • Compliance: SBOMs help ensure compliance with licensing requirements and make it easier to audit the project's dependencies.

You can find the SBOM in the NuGet package itself, which is automatically generated and embedded during the build process.

Build Provenance (Artifact Attestation)

Starting with release 9.3.0, the self-contained uml4net.Tools.exe attached to each GitHub release comes with a signed SLSA build provenance attestation. The attestation proves that the executable you downloaded was built by the release workflow of this repository from the tagged commit, and that it hasn't been modified since. It is signed through Sigstore and stored with this repository's attestations.

Verify a downloaded executable with the GitHub CLI:

gh attestation verify uml4net.Tools.exe --repo STARIONGROUP/uml4net

The command fails if the file doesn't match an attestation created by this repository. The SHA256 of the executable is also listed in the release notes.

The NuGet packages are not attested: nuget.org adds its own repository signature to every package it receives, which changes the file. Their integrity is covered by that NuGet signature, and they are built deterministically with Source Link, so the sources in the debug symbols map to the exact commit on GitHub.

License

The uml4net libraries are provided to the community under the Apache License 2.0.

Contributions

Contributions to the code-base are welcome. However, before we can accept your contributions we ask any contributor to sign the Contributor License Agreement (CLA) and send this digitally signed to s.gerene@stariongroup.eu. You can find the CLA's in the CLA folder.

Contribution guidelines for this project

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
9.4.0 56 11/24/2026
9.3.0 103 11/21/2026
9.2.0 143 10/13/2026
9.1.0 139 10/5/2026
9.0.0 119 10/4/2026
8.6.1 164 9/8/2026
8.6.0 213 8/13/2026
8.5.0 142 8/11/2026
8.4.0 151 8/5/2026
8.3.0 153 7/28/2026
8.2.1 193 7/1/2026
8.2.0 162 6/29/2026
8.1.2 166 4/24/2026
8.1.1 151 4/22/2026
8.1.0 164 4/17/2026
8.0.1 177 4/2/2026
8.0.0 173 3/31/2026
7.0.1 184 3/27/2026
7.0.0 152 3/22/2026
6.4.1 167 3/13/2026
Loading failed

[Update] uml4net.Extensions to 9.4.0