uml4net 5.0.0
See the version list below for details.
dotnet add package uml4net --version 5.0.0
NuGet\Install-Package uml4net -Version 5.0.0
<PackageReference Include="uml4net" Version="5.0.0" />
<PackageVersion Include="uml4net" Version="5.0.0" />
<PackageReference Include="uml4net" />
paket add uml4net --version 5.0.0
#r "nuget: uml4net, 5.0.0"
#:package uml4net@5.0.0
#addin nuget:?package=uml4net&version=5.0.0
#tool nuget:?package=uml4net&version=5.0.0

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 form. Uml4net is typically used to support opinionated template based code-generation and is a part of modeltopia. Uml4net porivdes 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 to read and write UML models and make them available as an in-memory object graph.
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. The writer supports writing a selected Package, 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.
To learn more about how to read an 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.
Code Quality
Installation
The package are available on Nuget at:
- uml4net:
- uml4net.Extensions:
- uml4net.xmi:
- uml4net.HandleBars:
- uml4net.Reporting:
- uml4net.Tools:
- uml4net.xmi.Extensions.EnterpriseArchitect:
Reading a UML model
Reading a UML model is straightforward and is done using the 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 of 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
Build Status
GitHub actions are used to build and test the uml4net libraries
| Branch | Build Status |
|---|---|
| Master | |
| Development |
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.
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 digitaly signed to s.gerene@stariongroup.eu. You can find the CLA's in the CLA folder.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on uml4net:
| Package | Downloads |
|---|---|
|
uml4net.Extensions
Extension methods for the .NET implementation of the OMG UML v2.5.1 specification. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 5.1.0 | 546 | 10/5/2026 |
| 5.0.0 | 266 | 10/4/2026 |
| 4.3.1 | 534 | 9/8/2026 |
| 4.3.0 | 2,365 | 8/5/2026 |
| 4.2.1 | 2,248 | 7/1/2026 |
| 4.2.0 | 353 | 6/29/2026 |
| 4.1.7 | 1,775 | 4/24/2026 |
| 4.1.6 | 336 | 4/22/2026 |
| 4.1.5 | 1,657 | 3/13/2026 |
| 4.1.4 | 425 | 3/6/2026 |
| 4.1.2 | 1,138 | 1/23/2026 |
| 4.1.1 | 695 | 1/4/2026 |
| 4.1.0 | 655 | 12/29/2025 |
| 4.0.3 | 440 | 12/20/2025 |
| 4.0.2 | 2,884 | 11/30/2025 |
| 4.0.1 | 542 | 11/23/2025 |
| 4.0.0 | 675 | 11/19/2025 |
| 3.0.3 | 7,958 | 8/26/2025 |
| 3.0.2 | 823 | 8/11/2025 |
| 3.0.1 | 491 | 8/8/2025 |
[Fix] implement EncapsulatedClassifier.OwnedPort derived property; fixes #245
[Fix] implement OpaqueExpression.Result derived property; fixes #252
[Fix] implement Extension.IsRequired and Extension.Metaclass derived properties; fixes #247
[Fix] redefine ExtensionEnd.Lower's default to 0 per its MultiplicityElement::lowerBound() redefinition; fixes #270
[Fix] implement Vertex.Incoming/Outgoing/RedefinitionContext derived properties; fixes #256
[Fix] implement Region.RedefinitionContext derived property; fixes #254
[Fix] implement Transition.RedefinitionContext derived property; fixes #255
[Fix] implement ActivityGroup.ContainedEdge/ContainedNode/Subgroup/SuperGroup derived properties; fixes #237
[Fix] implement ActivityEdge.InGroup derived property; fixes #236
[Fix] forward redefined properties to their redefining property instead of throwing; fixes #232
[Fix] implement ActivityNode.InGroup derived property; fixes #238
[Fix] implement ConnectorEnd.DefiningEnd derived property; fixes #242
[Fix] implement DeploymentTarget.DeployedElement derived property; fixes #244
[Fix] implement ProtocolTransition.Referred derived property; fixes #258
[Fix] implement RedefinableTemplateSignature.InheritedParameter derived property; fixes #253
[Fix] generate derived composite properties as List instead of IContainerList; fixes #286
[Fix] implement Element.OwnedElement derived property; fixes #288
[Fix] implement ConnectableElement.End derived property; fixes #241
[Fix] implement NamedElement.ClientDependency derived property; fixes #294
[Fix] implement Port.Provided/Required derived properties; fixes #249
[Fix] implement Component.Provided/Required derived properties; fixes #240
[Fix] implement Namespace.OwnedMember derived union; fixes #302
[Fix] implement NamedElement.IsDistinguishableFrom and Namespace.GetNamesOfMember; fixes #301
[Fix] implement Package.MakesVisible and VisibleMembers; fixes #304
[Fix] implement Namespace.ExcludeCollisions and ImportMembers; fixes #303
[Fix] implement Namespace.ImportedMember; fixes #250
[Fix] implement Namespace.Member derived union; fixes #305
[Fix] implement Classifier.Feature derived union; fixes #306
[Fix] implement Feature.FeaturingClassifier; fixes #248
[Fix] implement RedefinableElement.RedefinedElement derived union; fixes #315
[Fix] implement Classifier.InheritedMember; fixes #318
[Fix] implement StructuredClassifier.Part and Role; fixes #317
[Fix] implement RedefinableElement.RedefinitionContext; fixes #316
[Improvement] return IReadOnlyList for derived/read-only collection properties; fixes #291
[Improvement] track additional ModelInspector variation dimensions; part of #300
[Feature] opt-in ThrowOnUnresolvedReferences reader setting; fixes #331
[Fix] implement Relationship::relatedElement and DirectedRelationship::source/target derived unions; fixes #337 and #342
[Fix] write enumeration values with the literal names of the UML metamodel; fixes #376
[Fix] report invalid enumeration literals, repeated single-valued references and duplicate xmi:id with element, property and position; fixes #371
[Feat] support xlink:href simple links and XPointer xmi:uuid references; fixes #383
[Fix] Namespace::member includes inheritedMember, feature, role and memberEnd; fixes #338
[Fix] NamedElement::namespace is the owning Namespace only when the element is one of its ownedMembers; fixes #339
[Fix] NamedElement::qualifiedName follows the OCL: null unless the element and all its namespaces are named; fixes #340
[Fix] Package::makesVisible makes an owned member visible only when its visibility is public; fixes #341
[Fix] Classifier::feature reads Extension::ownedEnd instead of the redefined Association::ownedEnd; fixes #343
[Fix] Class::extension includes the allParents branch of the derivation; fixes #344
[Fix] Property::isComposite is aggregation = composite only; the Enterprise Architect accommodation moves to QueryIsContainment; fixes #345
[Fix] MultiplicityElement lower/upper and ExtensionEnd::lower return the default for non-literal bounds instead of throwing; fixes #346
[Fix] RedefinableElement::redefinedElement includes redefinedInterface, redefinedBehavior, extendedStateMachine and redefinedPort; fixes #348
[Fix] Action::input/output include the pins of redefining properties; the reflection is replaced by an explicit dispatch; fixes #349
[Fix] Action::context follows the OCL: the containing Behavior when it has no context, and Actions owned by an Interaction; fixes #350
[Fix] ActivityNode::inGroup includes inInterruptibleRegion; inStructuredNode falls back to the owner; fixes #351
[Fix] set the owner end of a composite association on containment, and do not write it; fixes #432
[Fix] Vertex::incoming/outgoing are resolved for entry and exit points owned by a State, and through the owner; fixes #352
[Fix] Namespace::ownedMember includes the constraints of the properties that subset ownedRule; fixes #353
[Breaking] optional [0..1] Boolean, Integer, Real and Enumeration properties are nullable; fixes #357 and 347
[Fix] RedefinableElement::redefinitionContext is the owner only through the properties that subset redefinableElement; fixes #354
[Fix] Classifier::general and Class::superClass contain no duplicates and no null; fixes #355
[Breaking] derived composite properties are exposed as IReadOnlyList; fixes #358
[Fix] the emulation of allInstances() covers every root and every document of a read; fixes #356
[Fix] QueryHasDefaultValue is true only when the property has a default value; fixes #389
[Fix] QueryRootPackage walks the whole owner chain to the outermost Package; fixes #388
[Fix] documentation uses every owned comment and keeps the words of adjacent lines apart; fixes #396
[Fix] a referenced root package without xmi:id is reported instead of written as href document#; fixes #378
[Feature] stereotype applications are resolved, their tagged values typed, queryable per element and written back; fixes #465
[Improvement] single-valued composite properties enforce their upper bound; fixes #480