2022-03 - SysML v2 Pilot Implementation
This is an incremental update to the 2022-02 release. It corresponds to Eclipse plugin version 0.22.0.
Language Features
-
Metadata annotation.
- Definition. Previously, metadata was defined simply as a
datatypein KerML or anattribute defin SysML. Now it is defined using ametaclassin KerML (which is a kind ofstruct) or ametadata defin SysML (which is a kind ofitem def). - Usage. Most syntactic restrictions on a feature declared in the body of a
metadatadeclaration have been removed. In particular, it is now possible for a feature defined in the body of ametadatadeclaration to itself have nested subfeatures. However, some additional validation checks have also been implemented for such features (see details under "Backwards Incompatibilities" below). - Annotated elements. A metadata definition or usage now, by default, inherits an
annotatedElementfeature from the Kernel base metaclassMetaobject. If this feature is (concretely) subsetted or redefined in a metadata definition or usage to have a more restrictive metaclass (using the reflectiveKerMLorSysMLmodels) than the default ofKerML::Element, then the metadata can only annotate elements consistent with that metaclass. For example, if a metadata definition includes the redefinition:>> annotatedElement : SysML::PartUsage;, then any usage of that definition can only annotate part usages.
[PR #347]
- Definition. Previously, metadata was defined simply as a
-
Semantic metadata. The new Kernel Library package
Metaobjectsdefines the metaclassSemanticMetadata(see below). Any metaclass or metadata definition that specializesSemanticMetadatashould bind the inheritedbaseTypefeature to a reference to a feature or usage from a user library model (see "Casting" below on how to do this). When such a specialization ofSemanticMetadatais used to annotate an appropriate type declaration, the specifiedbaseTypeis used as the implicit base specialization of the annotated type.- If the annotated type is a Feature/Usage, then the annotated feature implicitly subsets the
baseType. - If the annotated type is a Classifier/Definition, then the annotated classifier implicitly subclassifies each type of the
baseType.
Note. It is currently only possible to specify a feature or usage as a
baseType. This will be expanded to also allow classifiers in the future.
[PR #349] - If the annotated type is a Feature/Usage, then the annotated feature implicitly subsets the
-
Casting. The cast operator
ashas been implemented for model-level evaluable expressions. In addition, if the target type of the case is a metaclass, and the argument expression evaluates to a feature whose abstract syntax metaclass conforms to the given metaclass, then the result is a "meta-upcast" to the metaobject representation of the feature. E.g., ifvehicleis a part usage, thenvehicleasKerML::Featureevaluates, as a model-level evaluable expression, to a MetadataFeature forvehiclewith typeSysML::PartUsage. This can be used, for example, to bindbaseType = vehicleasKerML::Feature;forSemanticMetadata.
[PR #349] -
Keywords (SysML only). A user-defined keyword is a (possibly qualified) metaclass/metadata definition name or human ID preceded by the symbol
#. Such a keyword can be used in the SysML textual notation in package, dependency, definition and usage declarations.- The user-defined keyword is placed immediately before the language-defined (reserved) keyword for the declaration and specifies a metadata annotation of the declared element. For example, if
SafetyCriticalis a visible metadata definition, then#SafetyCriticalpartbrakes;is equivalent topartbrakes { @SafetyCritical; }. It is not possible to specify nested features for a metadata feature annotation in the keyword notation. - If the given metaclass or metadata definition is a kind of
SemanticMetadata, then the implicit specialization rules given above for "Semantic metadata" apply. In addition, a user-defined keyword for semantic metadata may also be used to declare a definition or usage without using any language-defined keyword. For example, ifprovideris the human ID of a specialization ofSemanticMetadatawhosebaseTypeis the featureserviceProviders : ServiceProvider, then#providerdefBankingService;is a definition with an implicit subclassification ofServiceProviderand#provider bankingService;is a usage with an implicit subsetting ofserviceProviders.
[PR #349]
- The user-defined keyword is placed immediately before the language-defined (reserved) keyword for the declaration and specifies a metadata annotation of the declared element. For example, if
Model Library
Kernel Library
-
Metaobjects. This is a new package with the following members.
- Metaclass
Metaobject(subclassifiesObjects::Object) is the implicit base type of all metaclasses. - Metaclass
SemanticMetadata(subclassifiesMetaobject) is used to extend the language implicit specialization mechanism for use with user-defined semantic libararies (see "Semantic metadata" above). - Feature
metaobjectsis the implicit base type of all metadata features. (This is not itself a metadata features, because a metadata feature is an annotating element, whilemetaobjectsis not.)
[PR #347]
- Metaclass
-
KerML. All
structdeclarations in theKerMLpackage have been changed tometaclass(withElementimplicitly subclassifyingMetaobject). (Note that the reflectiveKerMLabstract syntax model still does not include any features on these metaclasses.)
[PR #347]
Systems Library
-
Metadata. This is new package with the following members.
- Metadata definition
MetadataItem(subclassifiesItems::ItemandMetaobjects::Metaobject) is the implicit base type of all metadata definitions. - Item usage
metadataItemsis the implicit base type of all metadata usages. (This is not itself a metadata usage, because a metadata usages is an annotating element, whilemetadataItemsis not.)
[PR #347]
- Metadata definition
-
SysML. All
item defdeclarations in theSysMLpackage have been changed tometadata def. (Note that the reflectiveSysMLabstract syntax model still does not include any features on these metadata definitions.)
[PR #347]
Analysis and Metadata Domain Libraries
- Metadata definitions. Those attribute definitions in packages
AnalysisTooling,ModelingMetadataandRiskMetadatathat were intended to be used to define metadata have been changed to metadata definitions.
[PR #347]
Backward Incompatibilities
-
Keywords. KerML: added
metaclass. SysML: removedfeature. -
Annotations. An annotation relationship is no longer added to an annotating element that is an owned member of a namespace and does not explicitly specify any annotated elements (i.e., no
aboutpart). Instead, its owning namespace is simply considered to be the annotated element by default, without the need for an annotation relationship. (There is no change to the concrete syntax notation.)
[PR #347] -
Documentation. Documentation is now a special kind of comment that always has its owning element as its single annotated element, rather than a special kind of annotation association to a regular comment element. (There is no change to the
docnotation, just a different mapping to the abstract syntax.)
[PR #347] -
Prefix Comments. The
commentkeyword is now used for a prefix comment (/**...*/), e.g., to give it a name, rather than thedockeyword. Previously, prefix comments were supposed comments owned by the following element using a documentation relationship, but it was difficult to implement them that way. They are now ordinary (non-documentation) comments that are just always about the lexically following element.
[PR #347] -
Metadata.
- The following validation checks are now performed on the declaration of a metadata feature or usage:
- It must be defined by a concrete metaclass (in KerML) or metadata definition (in SysML).
- Each of its nested features/usages (if any) must pass the following validation checks:
- It must redefine a feature (owned or inherited) of a generalization of its owning feature.
- If it has a feature value, the value expression must be model-level-evaluable.
- Each of its nested features (if any) must also pass these validation checks.
- Usages declared in the body of a metadata usage are now parsed as reference usages. The optional keyword for their declaration is therefore now
refinstead offeature.
[PR #347]
- The following validation checks are now performed on the declaration of a metadata feature or usage:
-
Classifier base type. A validation check has been added that a classifier or definition directly or indirectly specializes the correct library base type. This will typically only be violated for vacuous circular specializations or invalid circular conjugations.
[PR #351]
Jupyter
None.
Visualization
-
PlantUML
- Improve rendering of connections.
- Support visualization of
- inherited feature ends or expressions.
- nested features in metadata annotations
- ports with directed features
[PR #348]
-
Tom Sawyer
None.
Technical Updates
- Vulnerability. Updated
yarn.lockto address security alerts.
[PR #346]
Bug Fixes
- Multiplicity subsetting. Fixed the KerML grammar for
MultiplicitySubset.
[PR #350] - Circular conjugation. Fixed stack overflow caused by a circular conjugation declaration.
[PR #351] - Non-ASCII characters. Revised the loading of libraries for Jupyter so that UTF-8 is always used as the character encoding (regardless of the platform default).
[PR #352] - Space modeling. Corrected errors related to space modeling in the Kernel Library
OccurrencesandObjectsmodels, in the Geometry Domain LibraryShapeItemsmodel and in the exampleCarWithShapeAndCSG. Also addedPlanarCurvetoShapeItems.
[PR #355]