Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing how Stereotypes and Profiles are identified and consumed by Player Piano #23

Merged
merged 4 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion ingrid/src/model_processing/patterns/ActorContext.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@
"Vertex Stereotypes": {
"A_composite owner_component": null,
"Atomic Thing": null,
"Composite Thing": "Block",
"Composite Thing": [
{
"profile": "SysML",
"stereotype": "Block"
}
],
"component": null,
"composite owner": null
}
Expand Down
14 changes: 12 additions & 2 deletions ingrid/src/model_processing/patterns/ActorRefiner.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,18 @@
"actor": null
},
"Vertex Stereotypes": {
"block": "Block",
"refiner": "Refine",
"block": [
{
"profile": "SysML",
"stereotype": "Block"
}
],
"refiner": [
{
"profile": "SysML",
"stereotype": "Refine"
}
],
"actor": null
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
],
"func": [
{
"profile": "SysML",
"profile": "MD Customization for SysML::additional_stereotypes",
"stereotype": "ReferenceProperty"
}
],
Expand All @@ -224,7 +224,7 @@
"performed by": null,
"performs": [
{
"profile": "SysML",
"profile": "MD Customization for SysML::additional_stereotypes",
"stereotype": "ReferenceProperty"
}
],
Expand Down
2 changes: 1 addition & 1 deletion ingrid/src/model_processing/patterns/Composition.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
],
"component": [
{
"profile": "SysML",
"profile": "MD Customization for SysML::additional_stereotypes",
"stereotype": "PartProperty"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
],
"component": [
{
"profile": "SysML",
"profile": "MD Customization for SysML::additional_stereotypes",
"stereotype": "PartProperty"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"performed by": null,
"performs": [
{
"profile": "SysML",
"profile": "MD Customization for SysML::additional_stereotypes",
"stereotype": "ReferenceProperty"
}
]
Expand Down
4 changes: 2 additions & 2 deletions ingrid/src/model_processing/patterns/InterfaceConnection.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@
],
"Comp A": [
{
"profile": "SysML",
"profile": "MD Customization for SysML::additional_stereotypes",
"stereotype": "PartProperty"
}
],
"Comp B": [
{
"profile": "SysML",
"profile": "MD Customization for SysML::additional_stereotypes",
"stereotype": "PartProperty"
}
],
Expand Down
4 changes: 2 additions & 2 deletions ingrid/src/model_processing/patterns/InterfaceDataFlow.json
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,14 @@
],
"Comp A": [
{
"profile": "SysML",
"profile": "MD Customization for SysML::additional_stereotypes",
"stereotype": "PartProperty"
}
],
"Comp A Context": null,
"Comp B": [
{
"profile": "SysML",
"profile": "MD Customization for SysML::additional_stereotypes",
"stereotype": "PartProperty"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
],
"Comp A": [
{
"profile": "SysML",
"profile": "MD Customization for SysML::additional_stereotypes",
"stereotype": "PartProperty"
}
],
Expand Down
6 changes: 3 additions & 3 deletions ingrid/src/model_processing/patterns/Parametric.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
],
"blockValue": [
{
"profile": "SysML",
"profile": "MD Customization for SysML::additional_stereotypes",
"stereotype": "ValueProperty"
}
],
Expand All @@ -244,15 +244,15 @@
],
"constUse": [
{
"profile": "SysML",
"profile": "MD Customization for SysML::additional_stereotypes",
"stereotype": "ConstraintProperty"
}
],
"constUse context2": null,
"context1": null,
"value": [
{
"profile": "SysML",
"profile": "MD Customization for SysML::additional_stereotypes",
"stereotype": "ConstraintParameter"
}
],
Expand Down
50 changes: 41 additions & 9 deletions ingrid/src/model_processing/patterns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ Since both the UML-based modeling pattern and the spreadsheet template share the
[
"Graph Edge 1 source name",
"Graph Edge 1 target name",
"UML metaproperty"
"UML metaproperty"
],
[
"Graph Edge N source name",
"Graph Edge N target name",
"UML metaproperty"
"UML metaproperty"
]
],
"Root Node": "Root Node name",
Expand All @@ -81,15 +81,20 @@ Since both the UML-based modeling pattern and the spreadsheet template share the
},
"Vertex Settings": {
"Graph Node 1 name": {
"pattern element UML metaproperty setting 1, e.g. 'aggregation : composite'": "value",
"pattern element UML metaproperty setting 1, e.g. 'aggregation : composite'": "value",
"pattern element UML metaproperty setting N": "value2"
},
"Graph Node N name": null //use null type if no settings applied
},
"Vertex Stereotypes": {
"Graph Node 1 name": "pattern element applied stereotype name, e.g. Block",
"Vertex Stereotypes": {
"Graph Node 1 name":[
{
"profile": "name of profile with the applied stereotype, e.g. SysML",
"stereotype": "pattern element applied stereotype name, e.g. Block",
}
],
"Graph Node N name": null //use null type if no applied stereotypes
//currently only supports one applied stereotype
//currently only supports one applied stereotype
}
}
```
Expand Down Expand Up @@ -164,14 +169,41 @@ The JSON for the Composition pattern is shown below:
},
"Vertex Stereotypes": {
"A_composite owner_component": null,
"Atomic Thing": "Block",
"Composite Thing": "Block",
"component": "PartProperty",
"Atomic Thing": [
{
"profile": "SysML",
"stereotype": "Block"
}
],
"Composite Thing": [
{
"profile": "SysML",
"stereotype": "Block"
}
],
"component": [
{
"profile": "MD Customization for SysML::additional_stereotypes",
"stereotype": "PartProperty"
}
],
"composite owner": null
}
}
```

## Applying Stereotypes

(discuss how to apply stereotypes first)

The stereotypes applied to an element are called out by profile and stereotype name. For example, see how the SysML "Block" stereotype is applied to "Atomic Thing" and "Composite Thing" in the Composition pattern (above). Using stereotype names in combination with full qualified profile names eliminates ambiguity when applying stereotypes. For example, see how the "PartProperty" stereotype is applied to "component" in the Composition pattern (above). Since the "additional_stereotypes" profile name is not unique in MagicDraw/Cameo Systems Modeler-produced SysML models, the profile containing the "PartProperty" stereotype is called out with the full qualified name: "MD Customization for SysML::additional_stereotypes."

Using a pattern successfully requires that all profiles used in the pattern are already available in the model through usages.

### Limitations

The intent of the JSON pattern format is to capture any UML-based modeling pattern, independent of the tool used to actually model elements with the pattern (e.g. Cameo Systems Modeler). However, implementation of the SysML v1.x metamodel varies between tools. Since Rapid Modeling Tools currently only support MagicDraw/Cameo Systems Modeler, the profiles and stereotypes shown are tool-specific. Future support of any other tools would require additional tool-specific information.

## Pattern Builder

GTRI is currently gathering a set of patterns in a Cameo Systems Modeler project as guidance for modeling. The opportunity is here to capture the patterns both to show good modeling practice but also to allow for rapid import and export from the model via easy-to-use forms like spreadsheets. Each UML modeling pattern has an accompanying graph representation leveraging a custom UML profile to convey the syntax and semantics needed to canonicalize the graph to a JSON. Additional customizations and a macro are built into the tool to generate an `ingrid` conformant JSON pattern stored in this directory.
Expand Down
9 changes: 7 additions & 2 deletions ingrid/src/model_processing/patterns/RelSys.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,13 @@
"ucend": null
},
"Vertex Stereotypes": {
"usecase": "requirementUseCase",
"relsys": "Block",
"usecase": null,
"relsys": [
{
"profile": "SysML",
"stereotype": "Block"
}
],
"relation": null,
"relsysend": null,
"ucend": null
Expand Down
4 changes: 2 additions & 2 deletions ingrid/src/model_processing/patterns/SystemIndexParts.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
],
"component": [
{
"profile": "SysML",
"profile": "MD Customization for SysML::additional_stereotypes",
"stereotype": "PartProperty"
}
],
Expand All @@ -169,7 +169,7 @@
],
"spatial": [
{
"profile": "SysML",
"profile": "MD Customization for SysML::additional_stereotypes",
"stereotype": "ValueProperty"
}
],
Expand Down
2 changes: 1 addition & 1 deletion ingrid/src/model_processing/patterns/SystemParts.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
],
"component": [
{
"profile": "SysML",
"profile": "MD Customization for SysML::additional_stereotypes",
"stereotype": "PartProperty"
}
],
Expand Down
4 changes: 2 additions & 2 deletions ingrid/src/model_processing/patterns/SystemSpatialParts.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
],
"component": [
{
"profile": "SysML",
"profile": "MD Customization for SysML::additional_stereotypes",
"stereotype": "PartProperty"
}
],
Expand All @@ -169,7 +169,7 @@
],
"spatial": [
{
"profile": "SysML",
"profile": "MD Customization for SysML::additional_stereotypes",
"stereotype": "ValueProperty"
}
],
Expand Down
23 changes: 19 additions & 4 deletions ingrid/src/model_processing/patterns/UCElements.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,26 @@
},
"Vertex Stereotypes": {
"A_composite owner_component": null,
"Atomic Thing": "Block",
"Composite Thing": "Block",
"component": "PartProperty",
"Atomic Thing": [
{
"profile": "SysML",
"stereotype": "Block"
}
],
"Composite Thing": [
{
"profile": "SysML",
"stereotype": "Block"
}
],
"component": [
{
"profile": "MD Customization for SysML::additional_stereotypes",
"stereotype": "PartProperty"
}
],
"composite owner": null,
"element": "requirementUseCase",
"element": null,
"activity": null
}
}
9 changes: 7 additions & 2 deletions ingrid/src/model_processing/patterns/UCOverview.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,13 @@
"ucend": null
},
"Vertex Stereotypes": {
"context": "Block",
"usecase": "requirementUseCase",
"context": [
{
"profile": "SysML",
"stereotype": "Block"
}
],
"usecase": null,
"actor": null,
"relation": null,
"actorend": null,
Expand Down
2 changes: 1 addition & 1 deletion ingrid/src/model_processing/patterns/UCTriggers.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"trigger": null
},
"Vertex Stereotypes": {
"usecase": "requirementUseCase",
"usecase": null,
"activity": null,
"trigger": null
}
Expand Down
Loading