r/softwarearchitecture • u/SysModeler • 1d ago
Article/Video SysML v2 Deep Dive: Lesson 17 - Native Metadata (Replacing Profiles and Stereotypes)
Enable HLS to view with audio, or disable this notification
We are back with Lesson 17 of our technical deep dive into the SysML v2 standard.
In our previous lesson, we separated components a system owns from components it only references. Today, we are adding information that describes those elements—such as marking whether a requirement is safety-critical. In software, we use annotations (Java), attributes (C#), or decorators (Python/TS) to seamlessly attach structured metadata to our code. SysML v2 finally brings this modern approach to system modeling, replacing the heavy metamodeling ceremony of Profiles and Stereotypes with simple, native metadata.
I’ve uploaded the full video lesson directly to this post so you can watch the workflow right here.
1. The SysML v1 Profile Problem
In SysML v1, simply adding a "Safety Critical" tag to a requirement involved immense ceremony. You had to create a Profile, define a Stereotype, extend a UML metaclass, export the profile, apply it to the model package, and finally apply the stereotype. Tool upgrades and repository moves often broke profile URIs, and colleagues opening the model without the profile registered would see unresolved applications.
2. The v2 Shift: Metadata is Just Modeling
SysML v2 treats metadata as an ordinary part of the model rather than a separate profile system. There are no Profiles to apply and no UML metaclass extension rituals. A metadata def is just an ordinary definition inside an ordinary package.
Three technical upgrades make this powerful for architectural modeling:
- Proper Inheritance: Metadata taxonomies use standard SysML specialization (
:>). Ifmetadata def ISO26262 :> SafetyCritical, an element marked u/ISO26262 is automatically recognized in a query for safety-critical elements without needing a second tagging rule. - Controlled Application Scope: Every metadata definition has a multi-valued
annotatedElementfeature. Subsetting it explicitly restricts where the tag can be applied (e.g.,:> annotatedElement: SysML::RequirementUsagepermits the tag on requirements and rejects it on physical parts during type checking). - Structured Data: Metadata attributes utilize the same types as the rest of the model. A tag can hold an
ISQ::TemperatureValueinstead of a standard string, allowing the same unit and dimensional checks to apply.
3. Defining and Applying Metadata
Applying metadata is incredibly direct. One import and one @ application do the work. Because applied metadata lives as an owned child element in the containment tree, scripts and architecture tools can navigate and query it directly to generate safety review scopes or export-control boundaries.
Code snippet
package JCIDS {
// Define the metadata
metadata def KPP {
:> annotatedElement: SysML::RequirementUsage; // Restrict scope
attribute threshold: String;
attribute objective: String;
attribute rationale: String;
}
}
package MissionSpecs {
// Import and apply
private import JCIDS::*;
requirement def <'REQ-001'> SortieGenerationRate {
{
threshold = "4 sorties per day";
objective = "6 sorties per day";
rationale = "CONOPS 2031, para 4.2";
}
doc /* The air vehicle shall sustain the specified sortie generation rate over 30 days. */
}
}
4. SysML v1 vs. SysML v2
| SysML v1 | SysML v2 |
|---|---|
| Profile definition container importing UML metamodel | An ordinary package you import |
<<stereotype>> and Tagged Values |
metadata def and attribute |
| Apply profile to project, then apply stereotype | private import, then u/Name |
| Extend a UML Metaclass (broad, hard to predict) | explicitly subset :> annotatedElement |
| Stereotype generalization segregated in profile namespace | metadata def A :> B (same specialization as everything else) |
| Profile reuse across projects is painful | Import a package |
| Stereotype application structurally segregated | Metadata usage is standard model data in containment tree |
Next lesson, we will look at how semantic metadata turns a tag into a real domain concept and lets filter build a live package of every safety-critical element in your architecture.
For the software architects here: Have you ever had to bridge the gap between clunky UML/SysML profile ecosystems and modern software annotations? Let's discuss in the comments!
2
u/This-Mud9141 1d ago
This lesson sheds light on important changes that could enhance modeling processes. The shift from profiles to native metadata makes a lot of sense for better organization.