Package Declaration
// A named package containing owned members
package VehicleSystem {
// owned members go here
}
A guided walkthrough of every notation form for Packages in SysML V2, showing both textual and graphical representations side-by-side.
In SysML V2, a Package is the primary namespacing construct for organising model elements. The concepts below cover the full set of notations drawn from Table 3 — Packages: Representative Notation of the SysML V2 Language Specification (OMG formal/2026-03-02). Each entry shows the Textual Notation first, followed by its Graphical Notation.
// A named package containing owned members
package VehicleSystem {
// owned members go here
}
// Elements declared inside a package body
// are owned members of that package (namespace membership)
package VehicleSystem {
part def Engine;
part def Chassis;
}
// Public import makes all public members of the
// imported package visible in the importing namespace,
// AND re-exports them to any further importers.
package AutomotiveLibrary {
part def Engine;
part def Wheel;
}
package VehicleDesign {
import AutomotiveLibrary::*;
// Engine and Wheel are now directly accessible
// and re-exported from VehicleDesign
}
// Private import makes all public members visible
// in the importing namespace but does NOT re-export them.
package AutomotiveLibrary {
part def Engine;
}
package VehicleDesign {
private import AutomotiveLibrary::*;
// Engine is accessible here but NOT re-exported
}
// A filter import applies a filter condition to restrict
// which members are imported from the target package.
// Only members satisfying the filter expression are visible.
package AutomotiveLibrary {
part def Engine { attribute mass : Real; }
part def Wheel { attribute mass : Real; }
}
package LightweightComponents {
import AutomotiveLibrary::* filter mass < 50;
// Only members whose 'mass' attribute is less than 50 are imported
}
// A member import imports a single named member
// rather than all members of a package.
package AutomotiveLibrary {
part def Engine;
part def Wheel;
}
package VehicleDesign {
import AutomotiveLibrary::Engine;
// Only Engine is imported; Wheel is not visible
}
Arrow targets the specific element rather than its containing package.
// An alias import gives a locally-scoped name to
// an imported member, avoiding name collisions.
package AutomotiveLibrary {
part def InternalCombustionEngine;
}
package VehicleDesign {
import AutomotiveLibrary::InternalCombustionEngine as ICEngine;
// Now accessible as 'ICEngine' within VehicleDesign
}
The alias name ICEngine
is shown on or near the import arrow.
// An element filter constrains a package so that
// only elements satisfying the condition are exposed.
// The filter applies to all imports of this package.
// (Element: Package with ElementFilterMembership)
package AutomotiveLibrary {
filter @DetailLevel >= 2;
// Only elements whose metadata DetailLevel >= 2
// will be visible when this package is imported
part def Engine { @DetailLevel = 3; }
part def Sketch { @DetailLevel = 1; }
}
The filter condition is shown inside the package compartment or
as a constraint annotation {filter …}
on the package symbol.