SysGit Metadata Library#
SysGit annotates the requirements, parts, and other elements it manages with .sysml metadata
usages — an owner, a comment, a tag, and so on. Each of those usages references a metadata def
(or attribute def) that SysGit does not write into your model files. Instead, every model
SysGit produces assumes those defs are available from SysGit's own bundled standard library, the
same way any SysML v2 tool assumes ScalarValues::String is available from the language's
built-in library.
If you load SysGit-produced .sysml files in your own tooling — a Python pipeline, a different
SysML v2 implementation, a custom validator — and that tooling does not also have SysGit's library
on its library path, every metadata Owner { ... }, metadata SysGitTag { ... }, and similar
usage will fail to resolve, because the metadata def it points to is unqualified and lives
somewhere your tooling doesn't know to look.
This page lists every definition in that library and makes the library file itself available to download, so external tooling can add it to its own library path and load SysGit models cleanly.
Why the file is root-namespace#
Metadata.sysml is not wrapped in a package or library package. Every def in it —
Owner, Comment, RequirementMetadata, and so on — lives at the root namespace. This is
deliberate: it is exactly how SysGit writes references to these defs in the models it produces.
A requirement gets metadata Owner { ... }, not metadata SysGit::Metadata::Owner { ... }. For
an external loader to resolve that reference, the def has to resolve the same way — unqualified —
which means the library file needs to sit in your library path without a package wrapper around
it, exactly as provided below. Don't add a package block around the contents when you install
it; doing so would make every def qualified and break resolution against unqualified references
in SysGit's models, defeating the point.
Defs in this library#
| Def | Kind | Written by SysGit when… |
|---|---|---|
Owner |
metadata def |
An element (requirement, part, etc.) is assigned an owner — a Git-platform user or a free-form name/email — via the requirements table or the node drawer. |
Comment |
metadata def |
A comment thread is created on an element in the Design Reviews / collaboration view. Carries the thread's replies as a nested list. |
Reply |
metadata def |
A reply is added to an existing comment thread. Nested inside a Comment's replies list; never written standalone. |
CommentMetadata |
metadata def |
A native SysML v2 comment <name> about <element> element is created, to track its author, timestamp, and edit status. Distinct from Comment/Reply, which back the Design Reviews UI. |
SysGitTag |
metadata def |
A tag is applied to an element for cross-cutting filtering (e.g. "propulsion", "power"). One @SysGitTag block per tag; an element with multiple tags gets multiple blocks. |
RequirementMetadata |
metadata def |
A requirement is given a rationale and/or a hierarchy level — the standard columns shown in the SysGit Requirements Management table. |
URL |
attribute def |
A URL-typed field inside CustomRequirementMetadata is populated, attaching an external link (with a display name) to a requirement. |
ColorValue |
attribute def |
Not written automatically by SysGit today. It's a base attribute def provided for hand-authored enum defs that want a per-value display color (:> ColorValue, then :>> hexColor = "#ef4444"; on each enum literal) — included here because it lives in the same file and a loader needs it if any model specializes it. |
Owner#
name, email, username — identifies who owns an element. email/username are only
populated for a Git-platform user; a free-form owner (a team, a role) carries only name. As of
this writing, SysGit omits any of the three fields that would otherwise be blank rather than
writing field = ""; — so don't assume all three are always present.
Comment#
Backs the Design Reviews collaboration UI. Tracks id, timestamps, author, resolution state, and
body text, plus a replies : Collections::List of Reply elements.
Reply#
A single reply within a Comment's replies list — its own id, timestamps, author, and text.
Never written standalone; always nested inside a Comment.
CommentMetadata#
Attaches authorship/timing metadata (name, email, username, created_at, edited) to a
native SysML v2 comment element — separate from the Comment/Reply pair above, which model
the Design Reviews discussion thread rather than the language's own comment construct.
SysGitTag#
A single name attribute holding the tag label. Applied by adding one metadata SysGitTag { name
= "..."; } block per tag.
RequirementMetadata#
rationale (string) and level (integer) — the two fields shown as built-in columns in the
Requirements Management table.
URL#
href and linkName — used as the type of URL-valued attributes inside a
CustomRequirementMetadata def, so a requirement can carry a labeled external link.
ColorValue#
hexColor — a CSS hex color string. A base type for enum defs that want each literal to carry a
display color.
Installing the library#
- Download
Metadata.sysmlbelow. - Place it in your SysML v2 library path exactly as downloaded — same filename, same directory
name (
SysGit/), no package wrapper added around its contents. - Load your SysGit-produced
.sysmlmodel(s) alongside it. Themetadata Owner { ... }and similar unqualified references in those models will now resolve against the defs in this file.
Full source#
The complete, current contents of sysml.library/SysGit/Metadata.sysml, copied verbatim:
metadata def Comment {
doc
/*
* Comment metadata is used to represent a comment associated with an annotated element.
*/
attribute id : ScalarValues::String {
doc
/*
* A unique identifier for the comment.
*/
}
attribute created_at : ScalarValues::String {
/*
* The timestamp when the comment was created in ISO 8601 format.
*/
}
attribute edited_at : ScalarValues::String {
/*
* The timestamp when the comment was most recently edited in ISO 8601 format.
*/
}
attribute resolved_at : ScalarValues::String {
/*
* The timestamp when the comment was resolved in ISO 8601 format.
*/
}
attribute name : ScalarValues::String {
doc
/*
* The full name of the user who authored the comment.
*/
}
attribute email : ScalarValues::String {
doc
/*
* The email address of the user who authored the comment.
*/
}
attribute username : ScalarValues::String {
doc
/*
* The git provider username of the user who authored the comment.
*/
}
attribute text : ScalarValues::String {
/*
* The text of the comment.
*/
}
attribute resolved_name : ScalarValues::String {
doc
/*
* The full name of the user who resolved the comment.
*/
}
attribute resolved_email : ScalarValues::String {
doc
/*
* The email address of the user who resolved the comment.
*/
}
attribute resolved_username : ScalarValues::String {
doc
/*
* The git provider username of the user who resolved the comment.
*/
}
attribute replies : Collections::List {
doc
/*
* A list of replies to this comment.
*/
feature :>> elements : Reply;
}
}
metadata def Reply {
doc
/*
* Reply metadata is used to represent a comment reply.
*/
attribute id : ScalarValues::String {
doc
/*
* A unique identifier for the reply.
*/
}
attribute created_at : ScalarValues::String {
/*
* The timestamp when the reply was created in ISO 8601 format.
*/
}
attribute edited_at : ScalarValues::String {
/*
* The timestamp when the reply was most recently edited in ISO 8601 format.
*/
}
attribute name : ScalarValues::String {
doc
/*
* The full name of the user who authored the reply.
*/
}
attribute email : ScalarValues::String {
doc
/*
* The email address of the user who authored the reply.
*/
}
attribute username : ScalarValues::String {
doc
/*
* The git provider username of the user who authored the reply.
*/
}
attribute text : ScalarValues::String {
/*
* The text of the reply.
*/
}
}
attribute def ColorValue {
doc
/*
* Base attribute def for enum values that carry a display color.
* Specialize your enum def with :> ColorValue, then redefine hexColor
* on each enum value: high { :>> hexColor = "#ef4444"; }
*/
attribute hexColor : ScalarValues::String {
doc
/*
* A CSS hex color string (e.g. "#ef4444") associated with this enum value.
*/
}
}
attribute def URL {
doc
/*
* URL attribute type for storing external links with a display name.
* Used within CustomRequirementMetadata to attach URLs to requirements.
*/
attribute href : ScalarValues::String {
doc
/*
* The URL/hyperlink reference.
*/
}
attribute linkName : ScalarValues::String {
doc
/*
* The display name for the link.
*/
}
}
metadata def Owner {
doc
/*
* Owner metadata is used to identify the owner of an annotated element.
*/
attribute name : ScalarValues::String {
doc
/*
* The full name of the owner.
*/
}
attribute email : ScalarValues::String {
doc
/*
* The email address of the owner.
*/
}
attribute username : ScalarValues::String {
doc
/*
* The git provider username of the owner.
*/
}
}
metadata def CommentMetadata {
doc
/*
* Metadata for SysML v2 comments (comment <name> about <element>).
* Tracks authorship, creation time, and edit status.
*/
attribute name : ScalarValues::String {
doc
/*
* The full name of the comment author.
*/
}
attribute email : ScalarValues::String {
doc
/*
* The email address of the comment author.
*/
}
attribute username : ScalarValues::String {
doc
/*
* The git provider username of the comment author.
*/
}
attribute created_at : ScalarValues::String {
doc
/*
* The timestamp when the comment was created in ISO 8601 format.
*/
}
attribute edited : ScalarValues::Boolean {
doc
/*
* Whether this comment has been edited since creation.
*/
}
}
metadata def SysGitTag {
doc
/*
* SysGitTag is used to apply a named label to any element.
* Multiple tags can be applied by adding multiple @SysGitTag blocks.
* Tags can be used to filter views cross-sectionally across requirements,
* parts, and verifications.
*/
attribute name : ScalarValues::String {
doc
/*
* The tag label, e.g. "propulsion" or "power".
*/
}
}
metadata def RequirementMetadata {
doc
/*
* Requirement metadata is used to represent additional metadata commonly associated with a requirement.
* This metdata will show up in the SysGit Requirements Management view as additional columns on a given
* table.
*/
attribute rationale : ScalarValues::String {
doc
/*
* The rationale for the requirement.
*/
}
attribute level : ScalarValues::Integer {
doc
/*
* The requirement level, i.e. 1 = "Level 1" requirement.
*/
}
}
See Also#
- Requirements Management — how Owner and RequirementMetadata show up as columns in the requirements table
- Design Reviews — where
Comment/Replymetadata comes from - SysML v2 Language Reference — general SysML v2 syntax