@memoarchitect/ontology 0.6.4 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (327) hide show
  1. package/README.md +1 -1
  2. package/examples/connected-patient-monitor/model/catalog/project.sysml +24 -0
  3. package/examples/connected-patient-monitor/model/catalog/viewpoints/unassigned/viewpoint.sysml +9 -0
  4. package/examples/connected-patient-monitor/model/{viewpoints → catalog/viewpoints/unassigned/views}/connected_patient_monitor_overview.sysml +1 -1
  5. package/examples/embedded-infusion-pump/model/catalog/project.sysml +24 -0
  6. package/examples/embedded-infusion-pump/model/catalog/viewpoints/unassigned/viewpoint.sysml +9 -0
  7. package/examples/embedded-infusion-pump/model/{viewpoints → catalog/viewpoints/unassigned/views}/embedded_infusion_pump_overview.sysml +1 -1
  8. package/examples/extensions/clinical/memo.package.yaml +18 -9
  9. package/examples/extensions/clinical/src/methodology/clinical_methodology.sysml +10 -2
  10. package/examples/extensions/template/memo.package.yaml +17 -9
  11. package/examples/functional-logical-physical/model/catalog/project.sysml +24 -0
  12. package/examples/functional-logical-physical/model/catalog/viewpoints/unassigned/viewpoint.sysml +9 -0
  13. package/examples/functional-logical-physical/model/{viewpoints → catalog/viewpoints/unassigned/views}/functional_logical_physical_overview.sysml +1 -1
  14. package/examples/gpca-pump/analysis/Samples/01-model-overview.ipynb +148 -0
  15. package/examples/gpca-pump/analysis/Samples/02-architecture-hotspots.ipynb +301 -0
  16. package/examples/gpca-pump/analysis/Samples/03-model-quality.ipynb +229 -0
  17. package/examples/gpca-pump/analysis/Samples/04-change-impact-explorer.ipynb +200 -0
  18. package/examples/gpca-pump/analysis/Samples/05-model-charts.ipynb +188 -0
  19. package/examples/gpca-pump/analysis/Samples/06-ownership-graph.ipynb +173 -0
  20. package/examples/gpca-pump/analysis/Samples/07-model-inventory-table.ipynb +180 -0
  21. package/examples/gpca-pump/analysis/Samples/README.md +37 -0
  22. package/examples/gpca-pump/gpca-pump.kpar +0 -0
  23. package/examples/gpca-pump/methodology/gpca_methodology.sysml +7 -8
  24. package/examples/gpca-pump/methodology/gpca_profiles.sysml +89 -11
  25. package/examples/gpca-pump/model/catalog/gpca_analysis.sysml +1 -1
  26. package/examples/gpca-pump/model/catalog/gpca_architecture.sysml +22 -12
  27. package/examples/gpca-pump/model/catalog/gpca_behavior_actions.sysml +2 -2
  28. package/examples/gpca-pump/model/catalog/gpca_behavior_modes.sysml +8 -2
  29. package/examples/gpca-pump/model/catalog/gpca_behavior_subsystems.sysml +5 -5
  30. package/examples/gpca-pump/model/catalog/gpca_context.sysml +3 -8
  31. package/examples/gpca-pump/model/catalog/gpca_cybersecurity.sysml +6 -6
  32. package/examples/gpca-pump/model/catalog/gpca_formal_behavior.sysml +1 -15
  33. package/examples/gpca-pump/model/catalog/gpca_interfaces.sysml +41 -11
  34. package/examples/gpca-pump/model/catalog/gpca_operational.sysml +19 -8
  35. package/examples/gpca-pump/model/catalog/gpca_physical.sysml +2 -2
  36. package/examples/gpca-pump/model/catalog/gpca_requirements.sysml +1 -1
  37. package/examples/gpca-pump/model/catalog/gpca_risk.sysml +10 -1
  38. package/examples/gpca-pump/model/catalog/gpca_system.sysml +34 -30
  39. package/examples/gpca-pump/model/catalog/gpca_trace.sysml +59 -31
  40. package/examples/gpca-pump/model/catalog/gpca_verification.sysml +1 -1
  41. package/examples/gpca-pump/model/catalog/project.sysml +21 -0
  42. package/examples/gpca-pump/model/catalog/viewpoints/context/viewpoint.sysml +8 -0
  43. package/examples/gpca-pump/model/{views → catalog/viewpoints/context/views}/context_system_context_view.sysml +3 -3
  44. package/examples/gpca-pump/model/catalog/viewpoints/cybersecurity/viewpoint.sysml +8 -0
  45. package/examples/gpca-pump/model/{views → catalog/viewpoints/cybersecurity/views}/cybersecurity_cybersecurity_view.sysml +3 -3
  46. package/examples/gpca-pump/model/{views → catalog/viewpoints/cybersecurity/views}/document_cyber_assessment_view.sysml +4 -4
  47. package/examples/gpca-pump/model/{views → catalog/viewpoints/cybersecurity/views}/document_threat_model_view.sysml +4 -4
  48. package/examples/gpca-pump/model/catalog/viewpoints/functional/viewpoint.sysml +8 -0
  49. package/examples/gpca-pump/model/{views → catalog/viewpoints/functional/views}/functional_function_allocation_view.sysml +2 -2
  50. package/examples/gpca-pump/model/{views → catalog/viewpoints/functional/views}/functional_function_browser_view.sysml +3 -3
  51. package/examples/gpca-pump/model/catalog/viewpoints/logical/viewpoint.sysml +8 -0
  52. package/examples/gpca-pump/model/{views → catalog/viewpoints/logical/views}/behavior_action_flow_view.sysml +3 -3
  53. package/examples/gpca-pump/model/{views → catalog/viewpoints/logical/views}/document_architecture_description_view.sysml +7 -7
  54. package/examples/gpca-pump/model/{views → catalog/viewpoints/logical/views}/logical_device_interconnect_view.sysml +5 -5
  55. package/examples/gpca-pump/model/{views → catalog/viewpoints/logical/views}/logical_logical_architecture_view.sysml +3 -3
  56. package/examples/gpca-pump/model/{views → catalog/viewpoints/logical/views}/logical_mode_state_view.sysml +3 -3
  57. package/examples/gpca-pump/model/{views → catalog/viewpoints/logical/views}/logical_system_decomposition_view.sysml +3 -3
  58. package/examples/gpca-pump/model/catalog/viewpoints/operational/viewpoint.sysml +8 -0
  59. package/examples/gpca-pump/model/{views → catalog/viewpoints/operational/views}/operational_scenario_sequence_view.sysml +2 -2
  60. package/examples/gpca-pump/model/{views → catalog/viewpoints/operational/views}/operational_use_case_view.sysml +3 -3
  61. package/examples/gpca-pump/model/catalog/viewpoints/physical/viewpoint.sysml +8 -0
  62. package/examples/gpca-pump/model/{views → catalog/viewpoints/physical/views}/physical_physical_bom_view.sysml +2 -2
  63. package/examples/gpca-pump/model/catalog/viewpoints/requirements/viewpoint.sysml +8 -0
  64. package/examples/gpca-pump/model/{views → catalog/viewpoints/requirements/views}/document_dhf_index_view.sysml +6 -6
  65. package/examples/gpca-pump/model/{views → catalog/viewpoints/requirements/views}/requirements_requirements_trace_view.sysml +2 -2
  66. package/examples/gpca-pump/model/catalog/viewpoints/risk/viewpoint.sysml +8 -0
  67. package/examples/gpca-pump/model/{views → catalog/viewpoints/risk/views}/document_hazard_analysis_view.sysml +3 -3
  68. package/examples/gpca-pump/model/{views → catalog/viewpoints/risk/views}/document_rmf_view.sysml +3 -3
  69. package/examples/gpca-pump/model/{views → catalog/viewpoints/risk/views}/risk_fmea_view.sysml +2 -2
  70. package/examples/gpca-pump/model/{views → catalog/viewpoints/risk/views}/risk_risk_chain_view.sysml +3 -3
  71. package/examples/gpca-pump/model/catalog/viewpoints/software/viewpoint.sysml +8 -0
  72. package/examples/gpca-pump/model/{views → catalog/viewpoints/software/views}/document_sdd_view.sysml +3 -3
  73. package/examples/gpca-pump/model/{views → catalog/viewpoints/software/views}/software_software_architecture_view.sysml +3 -3
  74. package/examples/gpca-pump/model/catalog/viewpoints/usability/viewpoint.sysml +8 -0
  75. package/examples/gpca-pump/model/{views → catalog/viewpoints/usability/views}/document_usability_view.sysml +4 -4
  76. package/examples/gpca-pump/model/catalog/viewpoints/verification/viewpoint.sysml +8 -0
  77. package/examples/gpca-pump/model/{views → catalog/viewpoints/verification/views}/document_vv_view.sysml +3 -3
  78. package/examples/gpca-pump/model/{views → catalog/viewpoints/verification/views}/verification_verification_coverage_view.sysml +2 -2
  79. package/examples/ivd-laboratory-system/model/catalog/project.sysml +24 -0
  80. package/examples/ivd-laboratory-system/model/catalog/viewpoints/unassigned/viewpoint.sysml +9 -0
  81. package/examples/ivd-laboratory-system/model/{viewpoints → catalog/viewpoints/unassigned/views}/ivd_laboratory_system_overview.sysml +1 -1
  82. package/examples/manual-surgical-instrument/model/catalog/manual_surgical_instrument.sysml +1 -0
  83. package/examples/manual-surgical-instrument/model/catalog/project.sysml +24 -0
  84. package/examples/manual-surgical-instrument/model/catalog/viewpoints/unassigned/viewpoint.sysml +9 -0
  85. package/examples/manual-surgical-instrument/model/{viewpoints → catalog/viewpoints/unassigned/views}/manual_surgical_instrument_overview.sysml +1 -1
  86. package/examples/multidimensional-layers/model/catalog/project.sysml +24 -0
  87. package/examples/multidimensional-layers/model/catalog/viewpoints/unassigned/viewpoint.sysml +9 -0
  88. package/examples/multidimensional-layers/model/{viewpoints → catalog/viewpoints/unassigned/views}/multidimensional_layers_overview.sysml +1 -1
  89. package/examples/nested-architecture-dsm/README.md +49 -0
  90. package/examples/nested-architecture-dsm/model/catalog/architecture/functional/functions.sysml +174 -0
  91. package/examples/nested-architecture-dsm/model/catalog/architecture/logical/structure.sysml +183 -0
  92. package/examples/nested-architecture-dsm/model/catalog/assurance/requirements/needs.sysml +53 -0
  93. package/examples/nested-architecture-dsm/model/catalog/assurance/requirements/requirements.sysml +89 -0
  94. package/examples/nested-architecture-dsm/model/catalog/assurance/verification_validation/verification_validation.sysml +90 -0
  95. package/examples/nested-architecture-dsm/model/catalog/project.sysml +28 -0
  96. package/examples/nested-architecture-dsm/model/catalog/traces.sysml +49 -0
  97. package/examples/reusable-instrument/model/catalog/project.sysml +24 -0
  98. package/examples/reusable-instrument/model/catalog/reusable_instrument.sysml +7 -6
  99. package/examples/reusable-instrument/model/catalog/viewpoints/unassigned/viewpoint.sysml +9 -0
  100. package/examples/reusable-instrument/model/{viewpoints → catalog/viewpoints/unassigned/views}/reusable_instrument_overview.sysml +1 -1
  101. package/examples/software-only-medical-device/model/catalog/project.sysml +24 -0
  102. package/examples/software-only-medical-device/model/catalog/viewpoints/unassigned/viewpoint.sysml +9 -0
  103. package/examples/software-only-medical-device/model/{viewpoints → catalog/viewpoints/unassigned/views}/software_only_medical_device_overview.sysml +1 -1
  104. package/examples/surgical-closure-workflow/model/catalog/project.sysml +24 -0
  105. package/examples/surgical-closure-workflow/model/catalog/surgical_closure_workflow.sysml +23 -19
  106. package/examples/surgical-closure-workflow/model/catalog/viewpoints/unassigned/viewpoint.sysml +9 -0
  107. package/examples/surgical-closure-workflow/model/{viewpoints → catalog/viewpoints/unassigned/views}/surgical_closure_workflow_overview.sysml +1 -1
  108. package/examples/surgical-robot/model/catalog/project.sysml +24 -0
  109. package/examples/surgical-robot/model/catalog/surgical_robot.sysml +5 -3
  110. package/examples/surgical-robot/model/catalog/viewpoints/unassigned/viewpoint.sysml +9 -0
  111. package/examples/surgical-robot/model/{viewpoints → catalog/viewpoints/unassigned/views}/surgical_robot_overview.sysml +1 -1
  112. package/examples/sysml-diagram-samples/README.md +7 -0
  113. package/examples/sysml-diagram-samples/dhf/documents/DOC-HAR-001.md +11 -0
  114. package/examples/sysml-diagram-samples/memo.package.yaml +11 -5
  115. package/examples/sysml-diagram-samples/model/catalog/project.sysml +33 -0
  116. package/examples/sysml-diagram-samples/model/catalog/viewpoints/unassigned/viewpoint.sysml +9 -0
  117. package/examples/sysml-diagram-samples/model/{samples → catalog/viewpoints/unassigned/views}/action_flow_view.sysml +18 -10
  118. package/examples/sysml-diagram-samples/model/{samples → catalog/viewpoints/unassigned/views}/context_view.sysml +4 -2
  119. package/examples/sysml-diagram-samples/model/catalog/viewpoints/unassigned/views/context_view.viewlayout +47 -0
  120. package/examples/sysml-diagram-samples/model/{samples → catalog/viewpoints/unassigned/views}/functional_flow_view.sysml +23 -20
  121. package/examples/sysml-diagram-samples/model/{samples → catalog/viewpoints/unassigned/views}/interconnection_view.sysml +17 -14
  122. package/examples/sysml-diagram-samples/model/catalog/viewpoints/unassigned/views/interconnection_view.viewlayout +94 -0
  123. package/examples/sysml-diagram-samples/model/{samples → catalog/viewpoints/unassigned/views}/operational_behaviour_view.sysml +23 -20
  124. package/examples/sysml-diagram-samples/model/catalog/viewpoints/unassigned/views/operational_behaviour_view.viewlayout +13 -0
  125. package/examples/sysml-diagram-samples/model/{samples → catalog/viewpoints/unassigned/views}/requirements_view.sysml +3 -1
  126. package/examples/sysml-diagram-samples/model/catalog/viewpoints/unassigned/views/standard_activity_view.sysml +51 -0
  127. package/examples/sysml-diagram-samples/model/{samples → catalog/viewpoints/unassigned/views}/state_transition_view.sysml +3 -1
  128. package/examples/sysml-diagram-samples/model/{samples → catalog/viewpoints/unassigned/views}/tree_view.sysml +3 -1
  129. package/examples/sysml-diagram-samples/model/{samples → catalog/viewpoints/unassigned/views}/use_case_view.sysml +3 -1
  130. package/examples/sysml-diagram-samples/model/sysml_v2_activity_example.sysml +93 -0
  131. package/examples/temperature-alarm/model/catalog/project.sysml +24 -0
  132. package/examples/temperature-alarm/model/catalog/temperature_alarm.sysml +2 -1
  133. package/examples/temperature-alarm/model/catalog/viewpoints/unassigned/viewpoint.sysml +9 -0
  134. package/examples/temperature-alarm/model/{viewpoints → catalog/viewpoints/unassigned/views}/temperature_alarm_overview.sysml +1 -1
  135. package/examples/ui-screen-regions/README.md +117 -0
  136. package/examples/ui-screen-regions/model/catalog/architecture/functional/functions.sysml +60 -0
  137. package/examples/ui-screen-regions/model/catalog/architecture/implementation/ui.sysml +189 -0
  138. package/examples/ui-screen-regions/model/catalog/artifacts/assets/catalog.sysml +61 -0
  139. package/examples/ui-screen-regions/model/catalog/artifacts/assets/screen-captures/drugSelectorRegion/drug-selector-expanded-2.4.1.png +0 -0
  140. package/examples/ui-screen-regions/model/catalog/artifacts/assets/screen-captures/mainScreenLayout/main-screen-2.4.1.png +0 -0
  141. package/examples/ui-screen-regions/model/catalog/artifacts/assets/screen-captures/settingsScreenLayout/settings-screen-2.4.1.png +0 -0
  142. package/examples/ui-screen-regions/model/catalog/artifacts/reviews/comments.sysml +51 -0
  143. package/examples/ui-screen-regions/model/catalog/artifacts/reviews/notes.sysml +27 -0
  144. package/examples/ui-screen-regions/model/catalog/artifacts/reviews/rationales.sysml +27 -0
  145. package/examples/ui-screen-regions/model/catalog/assurance/human_factors/human_factors.sysml +59 -0
  146. package/examples/ui-screen-regions/model/catalog/assurance/requirements/needs.sysml +25 -0
  147. package/examples/ui-screen-regions/model/catalog/assurance/requirements/requirements.sysml +178 -0
  148. package/examples/ui-screen-regions/model/catalog/assurance/safety_risk/risk.sysml +93 -0
  149. package/examples/ui-screen-regions/model/catalog/assurance/verification_validation/verification_validation.sysml +60 -0
  150. package/examples/ui-screen-regions/model/catalog/project.sysml +45 -0
  151. package/examples/ui-screen-regions/model/catalog/traces.sysml +276 -0
  152. package/examples/ui-screen-regions/model/catalog/viewpoints/functional/viewpoint.sysml +8 -0
  153. package/examples/ui-screen-regions/model/catalog/viewpoints/functional/views/ui_functional_tree.sysml +62 -0
  154. package/examples/ui-screen-regions/model/catalog/viewpoints/requirements/viewpoint.sysml +8 -0
  155. package/examples/ui-screen-regions/model/catalog/viewpoints/requirements/views/ui_requirements_trace.sysml +62 -0
  156. package/examples/ui-screen-regions/model/catalog/viewpoints/risk/viewpoint.sysml +8 -0
  157. package/examples/ui-screen-regions/model/catalog/viewpoints/risk/views/ui_risk_chain.sysml +62 -0
  158. package/examples/ui-screen-regions/model/catalog/viewpoints/ui_layout/viewpoint.sysml +8 -0
  159. package/examples/ui-screen-regions/model/catalog/viewpoints/ui_layout/views/main_screen_layout.sysml +57 -0
  160. package/examples/ui-screen-regions/model/catalog/viewpoints/ui_layout/views/settings_screen_layout.sysml +52 -0
  161. package/examples/ui-screen-regions/model/catalog/viewpoints/ui_layout/views/ui_region_trace.sysml +54 -0
  162. package/memo.manifest.yaml +2 -0
  163. package/methodologies/default/memo.package.yaml +19 -9
  164. package/methodologies/gpca/memo.package.yaml +18 -9
  165. package/ontology/memo.package.yaml +23 -8
  166. package/package.json +1 -3
  167. package/profile/memo.package.yaml +18 -9
  168. package/src/architecture/decisions/memo_decisions.sysml +7 -0
  169. package/src/architecture/functional/behavior/memo_behavior.sysml +1 -1
  170. package/src/architecture/functional/functions/memo_functions.sysml +5 -12
  171. package/src/architecture/implementation/software/runtime/memo_software_runtime.sysml +1 -3
  172. package/src/architecture/implementation/software/structure/memo_software_structure.sysml +18 -5
  173. package/src/architecture/implementation/ui/memo_ui.sysml +210 -27
  174. package/src/architecture/logical/interfaces/memo_interfaces.sysml +1 -2
  175. package/src/architecture/logical/structure/memo_logical_structure.sysml +71 -15
  176. package/src/architecture/operational/activities/memo_activities.sysml +0 -1
  177. package/src/architecture/operational/scenarios/memo_scenarios.sysml +2 -2
  178. package/src/architecture/operational/workflows/memo_workflows.sysml +0 -6
  179. package/src/{compliance/change/memo_change.sysml → artifacts/configuration_management/memo_configuration_management.sysml} +5 -3
  180. package/src/artifacts/core/memo_controlled_artifacts.sysml +33 -0
  181. package/src/artifacts/documents/risk_management/memo_risk_management.sysml +12 -0
  182. package/src/assurance/cybersecurity/memo_cybersecurity.sysml +1 -1
  183. package/src/assurance/human_factors/memo_human_factors.sysml +1 -1
  184. package/src/assurance/safety_risk/postmarket_surveillance/memo_postmarket_surveillance.sysml +11 -0
  185. package/src/assurance/verification_validation/clinical_evaluation/memo_clinical_evaluation.sysml +11 -0
  186. package/src/assurance/verification_validation/memo_assurance.sysml +1 -1
  187. package/src/core/annotations/memo_annotations.sysml +77 -0
  188. package/src/core/common/memo_common.sysml +20 -3
  189. package/src/core/consistency_rules/consistency_rules.sysml +7 -0
  190. package/src/core/dimensions/dimensions.sysml +5 -1
  191. package/src/core/enumerations/memo_enumerations.sysml +41 -6
  192. package/src/core/methodology_scope/methodology_scope.sysml +7 -15
  193. package/src/core/relationships/memo_relationships.sysml +4 -2
  194. package/src/memo_namespaces.sysml +97 -67
  195. package/src/methodology/core/memo_core.sysml +45 -2
  196. package/src/methodology/profiles/memo_profiles.sysml +30 -40
  197. package/src/methodology/workflow/memo_workflow.sysml +7 -2
  198. package/src/rules/closure/closure_rules.sysml +104 -31
  199. package/src/rules/coverage/coverage_rules.sysml +4 -256
  200. package/src/rules/crosslayer/cross_layer_rules.sysml +6 -15
  201. package/src/rules/lifecycle/lifecycle_rules.sysml +4 -39
  202. package/src/rules/ontology/ontology_invariants.sysml +38 -68
  203. package/src/rules/quantitative/quantitative_rules.sysml +8 -8
  204. package/src/viewpoints/catalog/memo_viewpoint_catalog.sysml +7 -0
  205. package/src/viewpoints/clinical/clinical_viewpoint.sysml +3 -1
  206. package/src/viewpoints/clinical/{clinical_evidence_view → views/clinical_evidence_view}/clinical_evidence_view.sysml +2 -2
  207. package/src/viewpoints/context/context_viewpoint.sysml +3 -1
  208. package/src/viewpoints/context/{system_context_view → views/system_context_view}/system_context_view.sysml +2 -2
  209. package/src/viewpoints/cybersecurity/cybersecurity_viewpoint.sysml +3 -1
  210. package/src/viewpoints/cybersecurity/{cybersecurity_assessment_view → views/cybersecurity_assessment_view}/cybersecurity_assessment_view.sysml +2 -2
  211. package/src/viewpoints/cybersecurity/{threat_model_view → views/threat_model_view}/threat_model_view.sysml +2 -2
  212. package/src/viewpoints/definitions/memo_viewpoint_definitions.sysml +6 -0
  213. package/src/viewpoints/functional/functional_viewpoint.sysml +3 -1
  214. package/src/viewpoints/functional/{function_allocation_view → views/function_allocation_view}/function_allocation_view.sysml +2 -2
  215. package/src/viewpoints/functional/{system_functional_tree_view → views/system_functional_tree_view}/system_functional_tree_view.sysml +2 -2
  216. package/src/viewpoints/logical/logical_viewpoint.sysml +3 -1
  217. package/src/viewpoints/logical/{logical_architecture_view → views/logical_architecture_view}/logical_architecture_view.sysml +2 -2
  218. package/src/viewpoints/operational/operational_viewpoint.sysml +3 -1
  219. package/src/viewpoints/operational/{use_case_view → views/use_case_view}/use_case_view.sysml +2 -2
  220. package/src/viewpoints/physical/physical_viewpoint.sysml +3 -1
  221. package/src/viewpoints/physical/{network_topology_view → views/network_topology_view}/network_topology_view.sysml +2 -2
  222. package/src/viewpoints/physical/{physical_bom_view → views/physical_bom_view}/physical_bom_view.sysml +2 -2
  223. package/src/viewpoints/rendering/memo_rendering.sysml +354 -0
  224. package/src/viewpoints/requirements/requirements_viewpoint.sysml +3 -1
  225. package/src/viewpoints/requirements/{requirements_traceability_view → views/requirements_traceability_view}/requirements_traceability_view.sysml +2 -2
  226. package/src/viewpoints/risk/risk_viewpoint.sysml +3 -1
  227. package/src/viewpoints/risk/{risk_chain_view → views/risk_chain_view}/risk_chain_view.sysml +2 -2
  228. package/src/viewpoints/software/software_viewpoint.sysml +3 -1
  229. package/src/viewpoints/software/{software_architecture_view → views/software_architecture_view}/software_architecture_view.sysml +2 -2
  230. package/src/viewpoints/ui_layout/ui_layout_viewpoint.sysml +28 -0
  231. package/src/viewpoints/ui_layout/views/screen_layout_view/screen_layout_view.sysml +23 -0
  232. package/src/viewpoints/usability/usability_viewpoint.sysml +3 -1
  233. package/src/viewpoints/usability/{usability_engineering_view → views/usability_engineering_view}/usability_engineering_view.sysml +2 -2
  234. package/src/viewpoints/verification/verification_viewpoint.sysml +3 -1
  235. package/src/viewpoints/verification/{verification_coverage_view → views/verification_coverage_view}/verification_coverage_view.sysml +2 -2
  236. package/templates/connected-device/memo.package.yaml +11 -5
  237. package/templates/connected-device/model/catalog/project.sysml +28 -0
  238. package/templates/connected-device/syside.toml +1 -1
  239. package/templates/default/memo.package.yaml +11 -5
  240. package/templates/default/model/catalog/project.sysml +28 -0
  241. package/templates/default/syside.toml +1 -1
  242. package/templates/infusion-pump/memo.package.yaml +11 -5
  243. package/templates/infusion-pump/model/catalog/project.sysml +28 -0
  244. package/templates/infusion-pump/syside.toml +1 -1
  245. package/templates/monitoring-device/memo.package.yaml +11 -5
  246. package/templates/monitoring-device/model/catalog/project.sysml +28 -0
  247. package/templates/monitoring-device/syside.toml +1 -1
  248. package/templates/samd/memo.package.yaml +11 -5
  249. package/templates/samd/model/catalog/project.sysml +28 -0
  250. package/templates/samd/syside.toml +1 -1
  251. package/examples/connected-patient-monitor/model/connected_patient_monitor.sysml +0 -3
  252. package/examples/embedded-infusion-pump/model/embedded_infusion_pump.sysml +0 -3
  253. package/examples/functional-logical-physical/model/functional_logical_physical.sysml +0 -3
  254. package/examples/gpca-pump/memo.config.yaml +0 -9
  255. package/examples/gpca-pump/methodology/gpca_scope.sysml +0 -25
  256. package/examples/ivd-laboratory-system/model/ivd_laboratory_system.sysml +0 -3
  257. package/examples/manual-surgical-instrument/model/manual_surgical_instrument.sysml +0 -3
  258. package/examples/multidimensional-layers/model/multidimensional_layers.sysml +0 -4
  259. package/examples/reusable-instrument/model/reusable_instrument.sysml +0 -4
  260. package/examples/software-only-medical-device/model/software_only_medical_device.sysml +0 -4
  261. package/examples/surgical-closure-workflow/model/surgical_closure_workflow.sysml +0 -4
  262. package/examples/surgical-robot/model/surgical_robot.sysml +0 -4
  263. package/examples/temperature-alarm/model/temperature_alarm.sysml +0 -4
  264. package/ontology/memo.rendering.yaml +0 -84
  265. package/src/compliance/artifacts/memo_artifacts.sysml +0 -12
  266. package/src/compliance/document_views/memo_document_views.sysml +0 -7
  267. package/src/compliance/iso14971/risk_management_file.sysml +0 -16
  268. package/src/compliance/postmarket/memo_postmarket.sysml +0 -16
  269. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/21cfr820/change-record.md +0 -0
  270. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/21cfr820/design-input.md +0 -0
  271. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/21cfr820/design-output.md +0 -0
  272. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/21cfr820/design-review.md +0 -0
  273. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/21cfr820/design-validation.md +0 -0
  274. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/21cfr820/design-verification.md +0 -0
  275. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/21cfr820/dhf-index.md +0 -0
  276. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/21cfr820/transfer-plan.md +0 -0
  277. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/21cfr820/user-needs.md +0 -0
  278. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/21cfr820/vv-plan.md +0 -0
  279. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/21cfr820/vv-report.md +0 -0
  280. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/fda-cybersecurity/incident-response.md +0 -0
  281. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/fda-cybersecurity/postmarket-surveillance.md +0 -0
  282. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/fda-cybersecurity/security-arch.md +0 -0
  283. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/fda-cybersecurity/threat-model.md +0 -0
  284. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/fda-cybersecurity/vuln-assessment.md +0 -0
  285. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iec-62304/change-control.md +0 -0
  286. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iec-62304/detailed-design.md +0 -0
  287. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iec-62304/integration-test.md +0 -0
  288. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iec-62304/sad.md +0 -0
  289. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iec-62304/sbom.md +0 -0
  290. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iec-62304/sdp.md +0 -0
  291. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iec-62304/soup.md +0 -0
  292. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iec-62304/srs.md +0 -0
  293. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iec-62304/sw-traceability.md +0 -0
  294. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iec-62304/system-test.md +0 -0
  295. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iec-62366/formative-eval.md +0 -0
  296. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iec-62366/summative-eval.md +0 -0
  297. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iec-62366/task-analysis.md +0 -0
  298. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iec-62366/ue-plan.md +0 -0
  299. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iec-62366/ui-spec.md +0 -0
  300. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iec-62366/urra.md +0 -0
  301. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iec-62366/use-spec.md +0 -0
  302. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iso-14971/fmea.md +0 -0
  303. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iso-14971/fta.md +0 -0
  304. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iso-14971/har.md +0 -0
  305. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iso-14971/risk-benefit.md +0 -0
  306. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iso-14971/risk-matrix.md +0 -0
  307. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iso-14971/rmp.md +0 -0
  308. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/iso-14971/rmr.md +0 -0
  309. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/shared/snippets/approval-block.md +0 -0
  310. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/shared/snippets/document-control-header.md +0 -0
  311. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/shared/snippets/references-section.md +0 -0
  312. /package/src/{compliance/dhf-templates → artifacts/templates/dhf}/shared/snippets/revision-history-table.md +0 -0
  313. /package/templates/connected-device/{src → model/catalog}/architecture/system.sysml +0 -0
  314. /package/templates/connected-device/{src/artifacts/artifacts.sysml → model/catalog/artifacts/catalog.sysml} +0 -0
  315. /package/templates/connected-device/{src → model/catalog}/assurance/requirements.sysml +0 -0
  316. /package/templates/default/{src → model/catalog}/architecture/system.sysml +0 -0
  317. /package/templates/default/{src/artifacts/artifacts.sysml → model/catalog/artifacts/catalog.sysml} +0 -0
  318. /package/templates/default/{src → model/catalog}/assurance/requirements.sysml +0 -0
  319. /package/templates/infusion-pump/{src → model/catalog}/architecture/system.sysml +0 -0
  320. /package/templates/infusion-pump/{src/artifacts/artifacts.sysml → model/catalog/artifacts/catalog.sysml} +0 -0
  321. /package/templates/infusion-pump/{src → model/catalog}/assurance/requirements.sysml +0 -0
  322. /package/templates/monitoring-device/{src → model/catalog}/architecture/system.sysml +0 -0
  323. /package/templates/monitoring-device/{src/artifacts/artifacts.sysml → model/catalog/artifacts/catalog.sysml} +0 -0
  324. /package/templates/monitoring-device/{src → model/catalog}/assurance/requirements.sysml +0 -0
  325. /package/templates/samd/{src → model/catalog}/architecture/system.sysml +0 -0
  326. /package/templates/samd/{src/artifacts/artifacts.sysml → model/catalog/artifacts/catalog.sysml} +0 -0
  327. /package/templates/samd/{src → model/catalog}/assurance/requirements.sysml +0 -0
@@ -0,0 +1,200 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "id": "memo-1",
6
+ "metadata": {},
7
+ "source": [
8
+ "# Change-impact explorer\n",
9
+ "\n",
10
+ "Search any element and inspect its owner, children, and directly related elements.\n",
11
+ "\n",
12
+ "This sample uses only standard SysML v2 concepts and automatically discovers the project's `model/` or `src/` directory."
13
+ ]
14
+ },
15
+ {
16
+ "cell_type": "code",
17
+ "execution_count": 1,
18
+ "id": "memo-2",
19
+ "metadata": {
20
+ "execution": {
21
+ "iopub.execute_input": "2026-07-29T22:31:52.751165Z",
22
+ "iopub.status.busy": "2026-07-29T22:31:52.750921Z",
23
+ "iopub.status.idle": "2026-07-29T22:31:53.037061Z",
24
+ "shell.execute_reply": "2026-07-29T22:31:53.036612Z"
25
+ }
26
+ },
27
+ "outputs": [
28
+ {
29
+ "name": "stdout",
30
+ "output_type": "stream",
31
+ "text": [
32
+ "Loaded 42 SysML files from /Users/poojakashyap/sandbox/memo-meta/memo/examples/gpca-pump/model\n"
33
+ ]
34
+ }
35
+ ],
36
+ "source": [
37
+ "from pathlib import Path\n",
38
+ "from collections import Counter, defaultdict\n",
39
+ "import syside\n",
40
+ "\n",
41
+ "def find_sysml_root(start=Path.cwd()):\n",
42
+ " \"\"\"Find the nearest model/ or src/ folder containing textual SysML.\"\"\"\n",
43
+ " for directory in (start, *start.parents):\n",
44
+ " for folder_name in ('model', 'src'):\n",
45
+ " candidate = directory / folder_name\n",
46
+ " if candidate.is_dir() and next(candidate.rglob('*.sysml'), None):\n",
47
+ " return candidate\n",
48
+ " raise FileNotFoundError('No model/ or src/ directory containing .sysml files was found')\n",
49
+ "\n",
50
+ "SYSML_ROOT = find_sysml_root()\n",
51
+ "SYSML_FILES = sorted(SYSML_ROOT.rglob('*.sysml'))\n",
52
+ "model, diagnostics = syside.try_load_model([str(path) for path in SYSML_FILES])\n",
53
+ "print(f'Loaded {len(SYSML_FILES)} SysML files from {SYSML_ROOT}')"
54
+ ]
55
+ },
56
+ {
57
+ "cell_type": "code",
58
+ "execution_count": 2,
59
+ "id": "memo-3",
60
+ "metadata": {
61
+ "execution": {
62
+ "iopub.execute_input": "2026-07-29T22:31:53.038369Z",
63
+ "iopub.status.busy": "2026-07-29T22:31:53.038278Z",
64
+ "iopub.status.idle": "2026-07-29T22:31:53.044194Z",
65
+ "shell.execute_reply": "2026-07-29T22:31:53.043828Z"
66
+ }
67
+ },
68
+ "outputs": [
69
+ {
70
+ "name": "stdout",
71
+ "output_type": "stream",
72
+ "text": [
73
+ "Set QUERY to a name fragment. Suggestions:\n",
74
+ " - memo_examples_gpca_pump_model_catalog_gpca_analysis::fmeaDelivery\n",
75
+ " - memo_examples_gpca_pump_model_catalog_gpca_analysis::fmMotorRunaway\n",
76
+ " - memo_examples_gpca_pump_model_catalog_gpca_analysis::fmAirSensorSilent\n",
77
+ " - memo_examples_gpca_pump_model_catalog_gpca_analysis::fmOcclusionDrift\n",
78
+ " - memo_examples_gpca_pump_model_catalog_gpca_analysis::fmStuckBolusButton\n",
79
+ " - memo_examples_gpca_pump_model_catalog_gpca_analysis::fmBatteryEarlyDepletion\n",
80
+ " - memo_examples_gpca_pump_model_catalog_gpca_analysis::feOverdose\n",
81
+ " - memo_examples_gpca_pump_model_catalog_gpca_analysis::feAirDelivered\n",
82
+ " - memo_examples_gpca_pump_model_catalog_gpca_analysis::feTherapyInterrupted\n",
83
+ " - memo_examples_gpca_pump_model_catalog_gpca_analysis::fcMotorDriverFault\n",
84
+ " - memo_examples_gpca_pump_model_catalog_gpca_analysis::fcTransducerAging\n",
85
+ " - memo_examples_gpca_pump_model_catalog_gpca_analysis::fcPendantAbuse\n",
86
+ " - memo_examples_gpca_pump_model_catalog_gpca_analysis::dmFlowCrossCheck\n",
87
+ " - memo_examples_gpca_pump_model_catalog_gpca_analysis::dmPostSensorCheck\n",
88
+ " - memo_examples_gpca_pump_model_catalog_gpca_analysis::dmStuckInputMonitor\n",
89
+ " - memo_examples_gpca_pump_model_catalog_gpca_analysis::fmeaActionAirSensor\n",
90
+ " - memo_examples_gpca_pump_model_catalog_gpca_analysis::ftaOverdose\n",
91
+ " - memo_examples_gpca_pump_model_catalog_gpca_analysis::fteOverdoseTop\n",
92
+ " - memo_examples_gpca_pump_model_catalog_gpca_analysis::fteMotorRunaway\n",
93
+ " - memo_examples_gpca_pump_model_catalog_gpca_analysis::fteCrossCheckFails\n"
94
+ ]
95
+ },
96
+ {
97
+ "data": {
98
+ "text/plain": [
99
+ "[]"
100
+ ]
101
+ },
102
+ "execution_count": 2,
103
+ "metadata": {},
104
+ "output_type": "execute_result"
105
+ }
106
+ ],
107
+ "source": [
108
+ "QUERY = '' # Example: 'pump', 'controller', 'safety', or a requirement name\n",
109
+ "\n",
110
+ "semantic_elements = (\n",
111
+ " list(model.elements(syside.Usage, include_subtypes=True))\n",
112
+ " + list(model.elements(syside.Definition, include_subtypes=True))\n",
113
+ ")\n",
114
+ "\n",
115
+ "def label(element):\n",
116
+ " value = element.qualified_name or element.name or element.declared_name\n",
117
+ " return str(value) if value else '<unnamed>'\n",
118
+ "\n",
119
+ "if not QUERY:\n",
120
+ " print('Set QUERY to a name fragment. Suggestions:')\n",
121
+ " for suggestion in [label(item) for item in semantic_elements if item.name][:20]:\n",
122
+ " print(' -', suggestion)\n",
123
+ " matches = []\n",
124
+ "else:\n",
125
+ " matches = [item for item in semantic_elements if QUERY.casefold() in label(item).casefold()]\n",
126
+ " print(f'{len(matches)} match(es) for {QUERY!r}')\n",
127
+ "\n",
128
+ "[(type(item).__name__, label(item)) for item in matches[:100]]"
129
+ ]
130
+ },
131
+ {
132
+ "cell_type": "code",
133
+ "execution_count": 3,
134
+ "id": "memo-4",
135
+ "metadata": {
136
+ "execution": {
137
+ "iopub.execute_input": "2026-07-29T22:31:53.045051Z",
138
+ "iopub.status.busy": "2026-07-29T22:31:53.045000Z",
139
+ "iopub.status.idle": "2026-07-29T22:31:53.047642Z",
140
+ "shell.execute_reply": "2026-07-29T22:31:53.047288Z"
141
+ }
142
+ },
143
+ "outputs": [
144
+ {
145
+ "data": {
146
+ "text/plain": [
147
+ "[]"
148
+ ]
149
+ },
150
+ "execution_count": 3,
151
+ "metadata": {},
152
+ "output_type": "execute_result"
153
+ }
154
+ ],
155
+ "source": [
156
+ "def neighborhood(element):\n",
157
+ " owner = getattr(element, 'owner', None)\n",
158
+ " children = [child for child in element.owned_elements if isinstance(child, (syside.Usage, syside.Definition))]\n",
159
+ " related = []\n",
160
+ " for relationship in element.owned_relationships:\n",
161
+ " for candidate in relationship.related_elements:\n",
162
+ " if candidate is not element:\n",
163
+ " related.append(candidate)\n",
164
+ " return {\n",
165
+ " 'selected': (type(element).__name__, label(element)),\n",
166
+ " 'owner': None if owner is None else (type(owner).__name__, label(owner)),\n",
167
+ " 'children': [(type(child).__name__, label(child)) for child in children[:50]],\n",
168
+ " 'directly related': [(type(item).__name__, label(item)) for item in related[:50]],\n",
169
+ " }\n",
170
+ "\n",
171
+ "[neighborhood(item) for item in matches[:10]]"
172
+ ]
173
+ }
174
+ ],
175
+ "metadata": {
176
+ "kernelspec": {
177
+ "display_name": "Python 3 (ipykernel)",
178
+ "language": "python",
179
+ "name": "python3"
180
+ },
181
+ "language_info": {
182
+ "codemirror_mode": {
183
+ "name": "ipython",
184
+ "version": 3
185
+ },
186
+ "file_extension": ".py",
187
+ "mimetype": "text/x-python",
188
+ "name": "python",
189
+ "nbconvert_exporter": "python",
190
+ "pygments_lexer": "ipython3",
191
+ "version": "3.12.13"
192
+ },
193
+ "memo": {
194
+ "description": "Search any element and inspect its owner, children, and directly related elements.",
195
+ "starter": true
196
+ }
197
+ },
198
+ "nbformat": 4,
199
+ "nbformat_minor": 5
200
+ }
@@ -0,0 +1,188 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "id": "memo-1",
6
+ "metadata": {},
7
+ "source": [
8
+ "# Model charts\n",
9
+ "\n",
10
+ "Render semantic composition and diagnostic charts without external plotting packages.\n",
11
+ "\n",
12
+ "This sample uses only standard SysML v2 concepts and automatically discovers the project's `model/` or `src/` directory."
13
+ ]
14
+ },
15
+ {
16
+ "cell_type": "code",
17
+ "execution_count": 1,
18
+ "id": "memo-2",
19
+ "metadata": {
20
+ "execution": {
21
+ "iopub.execute_input": "2026-07-29T22:35:00.883178Z",
22
+ "iopub.status.busy": "2026-07-29T22:35:00.882949Z",
23
+ "iopub.status.idle": "2026-07-29T22:35:01.265420Z",
24
+ "shell.execute_reply": "2026-07-29T22:35:01.265083Z"
25
+ }
26
+ },
27
+ "outputs": [
28
+ {
29
+ "name": "stdout",
30
+ "output_type": "stream",
31
+ "text": [
32
+ "Loaded 42 SysML files from /Users/poojakashyap/sandbox/memo-meta/memo/examples/gpca-pump/model\n"
33
+ ]
34
+ }
35
+ ],
36
+ "source": [
37
+ "from pathlib import Path\n",
38
+ "from collections import Counter, defaultdict\n",
39
+ "import syside\n",
40
+ "\n",
41
+ "def find_sysml_root(start=Path.cwd()):\n",
42
+ " \"\"\"Find the nearest model/ or src/ folder containing textual SysML.\"\"\"\n",
43
+ " for directory in (start, *start.parents):\n",
44
+ " for folder_name in ('model', 'src'):\n",
45
+ " candidate = directory / folder_name\n",
46
+ " if candidate.is_dir() and next(candidate.rglob('*.sysml'), None):\n",
47
+ " return candidate\n",
48
+ " raise FileNotFoundError('No model/ or src/ directory containing .sysml files was found')\n",
49
+ "\n",
50
+ "SYSML_ROOT = find_sysml_root()\n",
51
+ "SYSML_FILES = sorted(SYSML_ROOT.rglob('*.sysml'))\n",
52
+ "model, diagnostics = syside.try_load_model([str(path) for path in SYSML_FILES])\n",
53
+ "print(f'Loaded {len(SYSML_FILES)} SysML files from {SYSML_ROOT}')"
54
+ ]
55
+ },
56
+ {
57
+ "cell_type": "code",
58
+ "execution_count": 2,
59
+ "id": "memo-3",
60
+ "metadata": {
61
+ "execution": {
62
+ "iopub.execute_input": "2026-07-29T22:35:01.266692Z",
63
+ "iopub.status.busy": "2026-07-29T22:35:01.266622Z",
64
+ "iopub.status.idle": "2026-07-29T22:35:01.282674Z",
65
+ "shell.execute_reply": "2026-07-29T22:35:01.282322Z"
66
+ }
67
+ },
68
+ "outputs": [
69
+ {
70
+ "data": {
71
+ "text/html": [
72
+ "<div style=\"font-family:system-ui;max-width:900px\">\n",
73
+ " <h2>Semantic composition</h2><div style=\"display:grid;grid-template-columns:180px 1fr 70px;gap:12px;align-items:center;margin:7px 0\">\n",
74
+ " <div>AttributeUsage</div><div style=\"background:#edf2f4;border-radius:6px;overflow:hidden\"><div style=\"width:100.0%;height:20px;background:#2d8d70\"></div></div><strong>5,056</strong>\n",
75
+ " </div><div style=\"display:grid;grid-template-columns:180px 1fr 70px;gap:12px;align-items:center;margin:7px 0\">\n",
76
+ " <div>ConnectionUsage</div><div style=\"background:#edf2f4;border-radius:6px;overflow:hidden\"><div style=\"width:13.7%;height:20px;background:#3887c7\"></div></div><strong>691</strong>\n",
77
+ " </div><div style=\"display:grid;grid-template-columns:180px 1fr 70px;gap:12px;align-items:center;margin:7px 0\">\n",
78
+ " <div>PartUsage</div><div style=\"background:#edf2f4;border-radius:6px;overflow:hidden\"><div style=\"width:8.4%;height:20px;background:#e58a2b\"></div></div><strong>425</strong>\n",
79
+ " </div><div style=\"display:grid;grid-template-columns:180px 1fr 70px;gap:12px;align-items:center;margin:7px 0\">\n",
80
+ " <div>RequirementUsage</div><div style=\"background:#edf2f4;border-radius:6px;overflow:hidden\"><div style=\"width:2.1%;height:20px;background:#8357b6\"></div></div><strong>105</strong>\n",
81
+ " </div><div style=\"display:grid;grid-template-columns:180px 1fr 70px;gap:12px;align-items:center;margin:7px 0\">\n",
82
+ " <div>ItemUsage</div><div style=\"background:#edf2f4;border-radius:6px;overflow:hidden\"><div style=\"width:1.0%;height:20px;background:#cf5c62\"></div></div><strong>49</strong>\n",
83
+ " </div><div style=\"display:grid;grid-template-columns:180px 1fr 70px;gap:12px;align-items:center;margin:7px 0\">\n",
84
+ " <div>ActionUsage</div><div style=\"background:#edf2f4;border-radius:6px;overflow:hidden\"><div style=\"width:1.0%;height:20px;background:#4f9d9d\"></div></div><strong>44</strong>\n",
85
+ " </div><div style=\"display:grid;grid-template-columns:180px 1fr 70px;gap:12px;align-items:center;margin:7px 0\">\n",
86
+ " <div>StateUsage</div><div style=\"background:#edf2f4;border-radius:6px;overflow:hidden\"><div style=\"width:1.0%;height:20px;background:#2d8d70\"></div></div><strong>10</strong>\n",
87
+ " </div><div style=\"display:grid;grid-template-columns:180px 1fr 70px;gap:12px;align-items:center;margin:7px 0\">\n",
88
+ " <div>ActionDefinition</div><div style=\"background:#edf2f4;border-radius:6px;overflow:hidden\"><div style=\"width:1.0%;height:20px;background:#3887c7\"></div></div><strong>6</strong>\n",
89
+ " </div><div style=\"display:grid;grid-template-columns:180px 1fr 70px;gap:12px;align-items:center;margin:7px 0\">\n",
90
+ " <div>PortDefinition</div><div style=\"background:#edf2f4;border-radius:6px;overflow:hidden\"><div style=\"width:1.0%;height:20px;background:#e58a2b\"></div></div><strong>1</strong>\n",
91
+ " </div><div style=\"display:grid;grid-template-columns:180px 1fr 70px;gap:12px;align-items:center;margin:7px 0\">\n",
92
+ " <div>PortUsage</div><div style=\"background:#edf2f4;border-radius:6px;overflow:hidden\"><div style=\"width:1.0%;height:20px;background:#8357b6\"></div></div><strong>0</strong>\n",
93
+ " </div><div style=\"display:grid;grid-template-columns:180px 1fr 70px;gap:12px;align-items:center;margin:7px 0\">\n",
94
+ " <div>PartDefinition</div><div style=\"background:#edf2f4;border-radius:6px;overflow:hidden\"><div style=\"width:1.0%;height:20px;background:#cf5c62\"></div></div><strong>0</strong>\n",
95
+ " </div><div style=\"display:grid;grid-template-columns:180px 1fr 70px;gap:12px;align-items:center;margin:7px 0\">\n",
96
+ " <div>RequirementDefinition</div><div style=\"background:#edf2f4;border-radius:6px;overflow:hidden\"><div style=\"width:1.0%;height:20px;background:#4f9d9d\"></div></div><strong>0</strong>\n",
97
+ " </div>\n",
98
+ " <h2 style=\"margin-top:28px\">Diagnostics</h2>\n",
99
+ " <div style=\"display:flex;align-items:center;gap:24px\">\n",
100
+ " <div style=\"width:150px;height:150px;border-radius:50%;background:conic-gradient(#cf5c62 0 100.0%, #e5a52b 100.0% 100.0%, #3887c7 100.0% 100%);position:relative\">\n",
101
+ " <div style=\"position:absolute;inset:28px;background:white;border-radius:50%;display:grid;place-items:center;font-size:24px;font-weight:700\">8009</div>\n",
102
+ " </div>\n",
103
+ " <table><tr><th>Severity</th><th>Count</th></tr><tr><td>Errors</td><td>8009</td></tr><tr><td>Warnings</td><td>0</td></tr><tr><td>Information</td><td>0</td></tr></table>\n",
104
+ " </div>\n",
105
+ "</div>"
106
+ ],
107
+ "text/plain": [
108
+ "<IPython.core.display.HTML object>"
109
+ ]
110
+ },
111
+ "metadata": {},
112
+ "output_type": "display_data"
113
+ }
114
+ ],
115
+ "source": [
116
+ "from html import escape\n",
117
+ "from IPython.display import HTML, display\n",
118
+ "\n",
119
+ "type_names = [\n",
120
+ " 'PartUsage', 'RequirementUsage', 'ActionUsage', 'PortUsage',\n",
121
+ " 'ConnectionUsage', 'StateUsage', 'AttributeUsage', 'ItemUsage',\n",
122
+ " 'PartDefinition', 'RequirementDefinition', 'ActionDefinition', 'PortDefinition'\n",
123
+ "]\n",
124
+ "counts = {}\n",
125
+ "for type_name in type_names:\n",
126
+ " node_type = getattr(syside, type_name, None)\n",
127
+ " if node_type is not None:\n",
128
+ " counts[type_name] = len(list(model.elements(node_type)))\n",
129
+ "\n",
130
+ "palette = ['#2d8d70', '#3887c7', '#e58a2b', '#8357b6', '#cf5c62', '#4f9d9d']\n",
131
+ "largest = max(counts.values(), default=1)\n",
132
+ "bars = []\n",
133
+ "for index, (name, count) in enumerate(sorted(counts.items(), key=lambda item: item[1], reverse=True)):\n",
134
+ " width = max(1, count * 100 / largest)\n",
135
+ " color = palette[index % len(palette)]\n",
136
+ " bars.append(f'''<div style=\"display:grid;grid-template-columns:180px 1fr 70px;gap:12px;align-items:center;margin:7px 0\">\n",
137
+ " <div>{escape(name)}</div><div style=\"background:#edf2f4;border-radius:6px;overflow:hidden\"><div style=\"width:{width:.1f}%;height:20px;background:{color}\"></div></div><strong>{count:,}</strong>\n",
138
+ " </div>''')\n",
139
+ "\n",
140
+ "error_count = len(list(diagnostics.errors))\n",
141
+ "warning_count = len(list(diagnostics.warnings))\n",
142
+ "info_count = len(list(diagnostics.infos))\n",
143
+ "total_diagnostics = max(1, error_count + warning_count + info_count)\n",
144
+ "diagnostic_gradient = (\n",
145
+ " f'#cf5c62 0 {error_count / total_diagnostics * 100:.1f}%, '\n",
146
+ " f'#e5a52b {error_count / total_diagnostics * 100:.1f}% {(error_count + warning_count) / total_diagnostics * 100:.1f}%, '\n",
147
+ " f'#3887c7 {(error_count + warning_count) / total_diagnostics * 100:.1f}% 100%'\n",
148
+ ")\n",
149
+ "\n",
150
+ "display(HTML(f'''<div style=\"font-family:system-ui;max-width:900px\">\n",
151
+ " <h2>Semantic composition</h2>{''.join(bars)}\n",
152
+ " <h2 style=\"margin-top:28px\">Diagnostics</h2>\n",
153
+ " <div style=\"display:flex;align-items:center;gap:24px\">\n",
154
+ " <div style=\"width:150px;height:150px;border-radius:50%;background:conic-gradient({diagnostic_gradient});position:relative\">\n",
155
+ " <div style=\"position:absolute;inset:28px;background:white;border-radius:50%;display:grid;place-items:center;font-size:24px;font-weight:700\">{error_count + warning_count + info_count}</div>\n",
156
+ " </div>\n",
157
+ " <table><tr><th>Severity</th><th>Count</th></tr><tr><td>Errors</td><td>{error_count}</td></tr><tr><td>Warnings</td><td>{warning_count}</td></tr><tr><td>Information</td><td>{info_count}</td></tr></table>\n",
158
+ " </div>\n",
159
+ "</div>'''))"
160
+ ]
161
+ }
162
+ ],
163
+ "metadata": {
164
+ "kernelspec": {
165
+ "display_name": "Python 3 (ipykernel)",
166
+ "language": "python",
167
+ "name": "python3"
168
+ },
169
+ "language_info": {
170
+ "codemirror_mode": {
171
+ "name": "ipython",
172
+ "version": 3
173
+ },
174
+ "file_extension": ".py",
175
+ "mimetype": "text/x-python",
176
+ "name": "python",
177
+ "nbconvert_exporter": "python",
178
+ "pygments_lexer": "ipython3",
179
+ "version": "3.12.13"
180
+ },
181
+ "memo": {
182
+ "description": "Render semantic composition and diagnostic charts without external plotting packages.",
183
+ "starter": true
184
+ }
185
+ },
186
+ "nbformat": 4,
187
+ "nbformat_minor": 5
188
+ }
@@ -0,0 +1,173 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "id": "memo-1",
6
+ "metadata": {},
7
+ "source": [
8
+ "# Ownership graph\n",
9
+ "\n",
10
+ "Draw an SVG network of model elements and their ownership relationships.\n",
11
+ "\n",
12
+ "This sample uses only standard SysML v2 concepts and automatically discovers the project's `model/` or `src/` directory."
13
+ ]
14
+ },
15
+ {
16
+ "cell_type": "code",
17
+ "execution_count": 1,
18
+ "id": "memo-2",
19
+ "metadata": {
20
+ "execution": {
21
+ "iopub.execute_input": "2026-07-29T22:35:03.359159Z",
22
+ "iopub.status.busy": "2026-07-29T22:35:03.359073Z",
23
+ "iopub.status.idle": "2026-07-29T22:35:04.055958Z",
24
+ "shell.execute_reply": "2026-07-29T22:35:04.055425Z"
25
+ }
26
+ },
27
+ "outputs": [
28
+ {
29
+ "name": "stdout",
30
+ "output_type": "stream",
31
+ "text": [
32
+ "Loaded 42 SysML files from /Users/poojakashyap/sandbox/memo-meta/memo/examples/gpca-pump/model\n"
33
+ ]
34
+ }
35
+ ],
36
+ "source": [
37
+ "from pathlib import Path\n",
38
+ "from collections import Counter, defaultdict\n",
39
+ "import syside\n",
40
+ "\n",
41
+ "def find_sysml_root(start=Path.cwd()):\n",
42
+ " \"\"\"Find the nearest model/ or src/ folder containing textual SysML.\"\"\"\n",
43
+ " for directory in (start, *start.parents):\n",
44
+ " for folder_name in ('model', 'src'):\n",
45
+ " candidate = directory / folder_name\n",
46
+ " if candidate.is_dir() and next(candidate.rglob('*.sysml'), None):\n",
47
+ " return candidate\n",
48
+ " raise FileNotFoundError('No model/ or src/ directory containing .sysml files was found')\n",
49
+ "\n",
50
+ "SYSML_ROOT = find_sysml_root()\n",
51
+ "SYSML_FILES = sorted(SYSML_ROOT.rglob('*.sysml'))\n",
52
+ "model, diagnostics = syside.try_load_model([str(path) for path in SYSML_FILES])\n",
53
+ "print(f'Loaded {len(SYSML_FILES)} SysML files from {SYSML_ROOT}')"
54
+ ]
55
+ },
56
+ {
57
+ "cell_type": "code",
58
+ "execution_count": 2,
59
+ "id": "memo-3",
60
+ "metadata": {
61
+ "execution": {
62
+ "iopub.execute_input": "2026-07-29T22:35:04.060045Z",
63
+ "iopub.status.busy": "2026-07-29T22:35:04.059950Z",
64
+ "iopub.status.idle": "2026-07-29T22:35:04.079755Z",
65
+ "shell.execute_reply": "2026-07-29T22:35:04.079003Z"
66
+ }
67
+ },
68
+ "outputs": [
69
+ {
70
+ "data": {
71
+ "image/svg+xml": [
72
+ "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100%\" viewBox=\"0 0 500 3550\" style=\"background:#fbfcfc;border:1px solid #d9e3e8;border-radius:10px\"><g><rect x=\"30\" y=\"30\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#e8eefb\" stroke=\"#547180\"/><text x=\"39\" y=\"47\" font-size=\"11\" font-weight=\"700\">reqDoorOpen</text><text x=\"39\" y=\"62\" font-size=\"9\" fill=\"#587487\">RequirementUsage</text></g><g><rect x=\"30\" y=\"88\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#e8eefb\" stroke=\"#547180\"/><text x=\"39\" y=\"105\" font-size=\"11\" font-weight=\"700\">reqWatchdogSafeState</text><text x=\"39\" y=\"120\" font-size=\"9\" fill=\"#587487\">RequirementUsage</text></g><g><rect x=\"30\" y=\"146\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#fff0dc\" stroke=\"#547180\"/><text x=\"39\" y=\"163\" font-size=\"11\" font-weight=\"700\">infusionDeliveryFlow</text><text x=\"39\" y=\"178\" font-size=\"9\" fill=\"#587487\">ActionUsage</text></g><g><rect x=\"30\" y=\"204\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#e8eefb\" stroke=\"#547180\"/><text x=\"39\" y=\"221\" font-size=\"11\" font-weight=\"700\">reqDrugLibraryLimits</text><text x=\"39\" y=\"236\" font-size=\"9\" fill=\"#587487\">RequirementUsage</text></g><g><rect x=\"30\" y=\"262\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#e8eefb\" stroke=\"#547180\"/><text x=\"39\" y=\"279\" font-size=\"11\" font-weight=\"700\">reqPost</text><text x=\"39\" y=\"294\" font-size=\"9\" fill=\"#587487\">RequirementUsage</text></g><g><rect x=\"30\" y=\"320\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#e8eefb\" stroke=\"#547180\"/><text x=\"39\" y=\"337\" font-size=\"11\" font-weight=\"700\">reqPowerLossRetention</text><text x=\"39\" y=\"352\" font-size=\"9\" fill=\"#587487\">RequirementUsage</text></g><g><rect x=\"30\" y=\"378\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"395\" font-size=\"11\" font-weight=\"700\">gpcaSystemDecompositionView</text><text x=\"39\" y=\"410\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"436\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"453\" font-size=\"11\" font-weight=\"700\">gpcaActionFlowView</text><text x=\"39\" y=\"468\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"494\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"511\" font-size=\"11\" font-weight=\"700\">gpcaSystemContextView</text><text x=\"39\" y=\"526\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"552\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"569\" font-size=\"11\" font-weight=\"700\">gpcaCybersecurityView</text><text x=\"39\" y=\"584\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"610\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"627\" font-size=\"11\" font-weight=\"700\">architectureDescriptionView</text><text x=\"39\" y=\"642\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"668\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"685\" font-size=\"11\" font-weight=\"700\">dhfIndexView</text><text x=\"39\" y=\"700\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"726\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"743\" font-size=\"11\" font-weight=\"700\">gpcaDeviceInterconnectView</text><text x=\"39\" y=\"758\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"784\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"801\" font-size=\"11\" font-weight=\"700\">gpcaLogicalArchitectureView</text><text x=\"39\" y=\"816\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"842\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"859\" font-size=\"11\" font-weight=\"700\">gpcaModeStateView</text><text x=\"39\" y=\"874\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"900\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"917\" font-size=\"11\" font-weight=\"700\">gpcaUseCaseView</text><text x=\"39\" y=\"932\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"958\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"975\" font-size=\"11\" font-weight=\"700\">gpcaRiskChainView</text><text x=\"39\" y=\"990\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"1016\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"1033\" font-size=\"11\" font-weight=\"700\">gpcaSoftwareArchitectureVie</text><text x=\"39\" y=\"1048\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"1074\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#e8eefb\" stroke=\"#547180\"/><text x=\"39\" y=\"1091\" font-size=\"11\" font-weight=\"700\">reqAuthenticatedServiceAcce</text><text x=\"39\" y=\"1106\" font-size=\"9\" fill=\"#587487\">RequirementUsage</text></g><g><rect x=\"30\" y=\"1132\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"1149\" font-size=\"11\" font-weight=\"700\">gpcaFunctionAllocationView</text><text x=\"39\" y=\"1164\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"1190\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"1207\" font-size=\"11\" font-weight=\"700\">gpcaFunctionBrowserView</text><text x=\"39\" y=\"1222\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"1248\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"1265\" font-size=\"11\" font-weight=\"700\">gpcaScenarioSequenceView</text><text x=\"39\" y=\"1280\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"1306\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"1323\" font-size=\"11\" font-weight=\"700\">gpcaPhysicalBomView</text><text x=\"39\" y=\"1338\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"1364\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"1381\" font-size=\"11\" font-weight=\"700\">gpcaRequirementsTraceView</text><text x=\"39\" y=\"1396\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"1422\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"1439\" font-size=\"11\" font-weight=\"700\">gpcaFmeaView</text><text x=\"39\" y=\"1454\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"1480\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"1497\" font-size=\"11\" font-weight=\"700\">gpcaVerificationCoverageVie</text><text x=\"39\" y=\"1512\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"1538\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#e8eefb\" stroke=\"#547180\"/><text x=\"39\" y=\"1555\" font-size=\"11\" font-weight=\"700\">reqOcclusion</text><text x=\"39\" y=\"1570\" font-size=\"9\" fill=\"#587487\">RequirementUsage</text></g><g><rect x=\"30\" y=\"1596\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#e8eefb\" stroke=\"#547180\"/><text x=\"39\" y=\"1613\" font-size=\"11\" font-weight=\"700\">reqMaxHourlyDose</text><text x=\"39\" y=\"1628\" font-size=\"9\" fill=\"#587487\">RequirementUsage</text></g><g><rect x=\"30\" y=\"1654\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#e8eefb\" stroke=\"#547180\"/><text x=\"39\" y=\"1671\" font-size=\"11\" font-weight=\"700\">reqEventLogging</text><text x=\"39\" y=\"1686\" font-size=\"9\" fill=\"#587487\">RequirementUsage</text></g><g><rect x=\"30\" y=\"1712\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#e8eefb\" stroke=\"#547180\"/><text x=\"39\" y=\"1729\" font-size=\"11\" font-weight=\"700\">reqStuckButton</text><text x=\"39\" y=\"1744\" font-size=\"9\" fill=\"#587487\">RequirementUsage</text></g><g><rect x=\"30\" y=\"1770\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#e8eefb\" stroke=\"#547180\"/><text x=\"39\" y=\"1787\" font-size=\"11\" font-weight=\"700\">reqFlowCrossCheck</text><text x=\"39\" y=\"1802\" font-size=\"9\" fill=\"#587487\">RequirementUsage</text></g><g><rect x=\"30\" y=\"1828\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#e8eefb\" stroke=\"#547180\"/><text x=\"39\" y=\"1845\" font-size=\"11\" font-weight=\"700\">reqPumpAccuracy</text><text x=\"39\" y=\"1860\" font-size=\"9\" fill=\"#587487\">RequirementUsage</text></g><g><rect x=\"30\" y=\"1886\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#e8eefb\" stroke=\"#547180\"/><text x=\"39\" y=\"1903\" font-size=\"11\" font-weight=\"700\">reqAlarmLoudness</text><text x=\"39\" y=\"1918\" font-size=\"9\" fill=\"#587487\">RequirementUsage</text></g><g><rect x=\"30\" y=\"1944\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#e8eefb\" stroke=\"#547180\"/><text x=\"39\" y=\"1961\" font-size=\"11\" font-weight=\"700\">reqBatteryBackup</text><text x=\"39\" y=\"1976\" font-size=\"9\" fill=\"#587487\">RequirementUsage</text></g><g><rect x=\"30\" y=\"2002\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#e8eefb\" stroke=\"#547180\"/><text x=\"39\" y=\"2019\" font-size=\"11\" font-weight=\"700\">reqFreeFlowPrevention</text><text x=\"39\" y=\"2034\" font-size=\"9\" fill=\"#587487\">RequirementUsage</text></g><g><rect x=\"30\" y=\"2060\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"2077\" font-size=\"11\" font-weight=\"700\">hazardAnalysisView</text><text x=\"39\" y=\"2092\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"2118\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"2135\" font-size=\"11\" font-weight=\"700\">rmfView</text><text x=\"39\" y=\"2150\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"2176\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"2193\" font-size=\"11\" font-weight=\"700\">sddView</text><text x=\"39\" y=\"2208\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"2234\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"2251\" font-size=\"11\" font-weight=\"700\">vvView</text><text x=\"39\" y=\"2266\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"2292\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"2309\" font-size=\"11\" font-weight=\"700\">ddPrescription</text><text x=\"39\" y=\"2324\" font-size=\"9\" fill=\"#587487\">ItemUsage</text></g><g><rect x=\"30\" y=\"2350\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"2367\" font-size=\"11\" font-weight=\"700\">cyberAssessmentView</text><text x=\"39\" y=\"2382\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"2408\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"2425\" font-size=\"11\" font-weight=\"700\">threatModelView</text><text x=\"39\" y=\"2440\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"2466\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#f4f6f7\" stroke=\"#547180\"/><text x=\"39\" y=\"2483\" font-size=\"11\" font-weight=\"700\">usabilityView</text><text x=\"39\" y=\"2498\" font-size=\"9\" fill=\"#587487\">ViewUsage</text></g><g><rect x=\"30\" y=\"2524\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#dff4ee\" stroke=\"#547180\"/><text x=\"39\" y=\"2541\" font-size=\"11\" font-weight=\"700\">gpcaIntendedUse</text><text x=\"39\" y=\"2556\" font-size=\"9\" fill=\"#587487\">PartUsage</text></g><g><rect x=\"30\" y=\"2582\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#dff4ee\" stroke=\"#547180\"/><text x=\"39\" y=\"2599\" font-size=\"11\" font-weight=\"700\">configurationTamperingRisk</text><text x=\"39\" y=\"2614\" font-size=\"9\" fill=\"#587487\">PartUsage</text></g><g><rect x=\"30\" y=\"2640\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#dff4ee\" stroke=\"#547180\"/><text x=\"39\" y=\"2657\" font-size=\"11\" font-weight=\"700\">exSensorVector</text><text x=\"39\" y=\"2672\" font-size=\"9\" fill=\"#587487\">PartUsage</text></g><g><rect x=\"30\" y=\"2698\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#dff4ee\" stroke=\"#547180\"/><text x=\"39\" y=\"2715\" font-size=\"11\" font-weight=\"700\">exFlowCommand</text><text x=\"39\" y=\"2730\" font-size=\"9\" fill=\"#587487\">PartUsage</text></g><g><rect x=\"30\" y=\"2756\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#dff4ee\" stroke=\"#547180\"/><text x=\"39\" y=\"2773\" font-size=\"11\" font-weight=\"700\">exAlarmAnnunciation</text><text x=\"39\" y=\"2788\" font-size=\"9\" fill=\"#587487\">PartUsage</text></g><g><rect x=\"30\" y=\"2814\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#dff4ee\" stroke=\"#547180\"/><text x=\"39\" y=\"2831\" font-size=\"11\" font-weight=\"700\">exPrescriptionEntry</text><text x=\"39\" y=\"2846\" font-size=\"9\" fill=\"#587487\">PartUsage</text></g><g><rect x=\"30\" y=\"2872\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#dff4ee\" stroke=\"#547180\"/><text x=\"39\" y=\"2889\" font-size=\"11\" font-weight=\"700\">osNominalTherapy</text><text x=\"39\" y=\"2904\" font-size=\"9\" fill=\"#587487\">PartUsage</text></g><g><rect x=\"30\" y=\"2930\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#dff4ee\" stroke=\"#547180\"/><text x=\"39\" y=\"2947\" font-size=\"11\" font-weight=\"700\">osLockoutBolus</text><text x=\"39\" y=\"2962\" font-size=\"9\" fill=\"#587487\">PartUsage</text></g><g><rect x=\"30\" y=\"2988\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#dff4ee\" stroke=\"#547180\"/><text x=\"39\" y=\"3005\" font-size=\"11\" font-weight=\"700\">osOcclusionAlarm</text><text x=\"39\" y=\"3020\" font-size=\"9\" fill=\"#587487\">PartUsage</text></g><g><rect x=\"30\" y=\"3046\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#dff4ee\" stroke=\"#547180\"/><text x=\"39\" y=\"3063\" font-size=\"11\" font-weight=\"700\">osAirInLine</text><text x=\"39\" y=\"3078\" font-size=\"9\" fill=\"#587487\">PartUsage</text></g><g><rect x=\"30\" y=\"3104\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#dff4ee\" stroke=\"#547180\"/><text x=\"39\" y=\"3121\" font-size=\"11\" font-weight=\"700\">osEmptyReservoir</text><text x=\"39\" y=\"3136\" font-size=\"9\" fill=\"#587487\">PartUsage</text></g><g><rect x=\"30\" y=\"3162\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#dff4ee\" stroke=\"#547180\"/><text x=\"39\" y=\"3179\" font-size=\"11\" font-weight=\"700\">osPowerLoss</text><text x=\"39\" y=\"3194\" font-size=\"9\" fill=\"#587487\">PartUsage</text></g><g><rect x=\"30\" y=\"3220\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#dff4ee\" stroke=\"#547180\"/><text x=\"39\" y=\"3237\" font-size=\"11\" font-weight=\"700\">notifDrugSafeValueNotPresen</text><text x=\"39\" y=\"3252\" font-size=\"9\" fill=\"#587487\">PartUsage</text></g><g><rect x=\"30\" y=\"3278\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#dff4ee\" stroke=\"#547180\"/><text x=\"39\" y=\"3295\" font-size=\"11\" font-weight=\"700\">riskBefore</text><text x=\"39\" y=\"3310\" font-size=\"9\" fill=\"#587487\">PartUsage</text></g><g><rect x=\"30\" y=\"3336\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#dff4ee\" stroke=\"#547180\"/><text x=\"39\" y=\"3353\" font-size=\"11\" font-weight=\"700\">riskBeforeUnderdose</text><text x=\"39\" y=\"3368\" font-size=\"9\" fill=\"#587487\">PartUsage</text></g><g><rect x=\"30\" y=\"3394\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#dff4ee\" stroke=\"#547180\"/><text x=\"39\" y=\"3411\" font-size=\"11\" font-weight=\"700\">riskBeforeAir</text><text x=\"39\" y=\"3426\" font-size=\"9\" fill=\"#587487\">PartUsage</text></g><g><rect x=\"30\" y=\"3452\" width=\"190\" height=\"40\" rx=\"7\" fill=\"#dff4ee\" stroke=\"#547180\"/><text x=\"39\" y=\"3469\" font-size=\"11\" font-weight=\"700\">riskBeforeWrongDose</text><text x=\"39\" y=\"3484\" font-size=\"9\" fill=\"#587487\">PartUsage</text></g></svg>"
73
+ ],
74
+ "text/plain": [
75
+ "<IPython.core.display.SVG object>"
76
+ ]
77
+ },
78
+ "metadata": {},
79
+ "output_type": "display_data"
80
+ },
81
+ {
82
+ "name": "stdout",
83
+ "output_type": "stream",
84
+ "text": [
85
+ "Displayed 60 elements and 0 ownership edges\n"
86
+ ]
87
+ }
88
+ ],
89
+ "source": [
90
+ "from html import escape\n",
91
+ "from IPython.display import SVG, display\n",
92
+ "\n",
93
+ "semantic_elements = (\n",
94
+ " list(model.elements(syside.Usage, include_subtypes=True))\n",
95
+ " + list(model.elements(syside.Definition, include_subtypes=True))\n",
96
+ ")\n",
97
+ "\n",
98
+ "def node_name(element):\n",
99
+ " value = element.name or element.declared_name or element.qualified_name\n",
100
+ " return str(value) if value else '<unnamed>'\n",
101
+ "\n",
102
+ "# Prefer named elements with semantic children, then fill with other named elements.\n",
103
+ "ranked = sorted(\n",
104
+ " (item for item in semantic_elements if item.name or item.declared_name),\n",
105
+ " key=lambda item: sum(isinstance(child, (syside.Usage, syside.Definition)) for child in item.owned_elements),\n",
106
+ " reverse=True,\n",
107
+ ")\n",
108
+ "selected = ranked[:60]\n",
109
+ "selected_ids = {id(item) for item in selected}\n",
110
+ "\n",
111
+ "def depth(element):\n",
112
+ " value, current, seen = 0, element.owner, set()\n",
113
+ " while current is not None and id(current) not in seen:\n",
114
+ " seen.add(id(current)); value += 1; current = getattr(current, 'owner', None)\n",
115
+ " return value\n",
116
+ "\n",
117
+ "columns = defaultdict(list)\n",
118
+ "for item in selected:\n",
119
+ " columns[depth(item)].append(item)\n",
120
+ "depths = sorted(columns)\n",
121
+ "positions = {}\n",
122
+ "for column_index, level in enumerate(depths):\n",
123
+ " for row_index, item in enumerate(columns[level]):\n",
124
+ " positions[id(item)] = (30 + column_index * 240, 30 + row_index * 58)\n",
125
+ "\n",
126
+ "width = max(500, 260 * max(1, len(depths)))\n",
127
+ "height = max(240, 70 + 58 * max((len(items) for items in columns.values()), default=1))\n",
128
+ "edges = []\n",
129
+ "nodes = []\n",
130
+ "colors = {'PartUsage':'#dff4ee', 'RequirementUsage':'#e8eefb', 'ActionUsage':'#fff0dc', 'PortUsage':'#efe5fa'}\n",
131
+ "for item in selected:\n",
132
+ " x, y = positions[id(item)]\n",
133
+ " owner = getattr(item, 'owner', None)\n",
134
+ " if owner is not None and id(owner) in selected_ids:\n",
135
+ " ox, oy = positions[id(owner)]\n",
136
+ " edges.append(f'<path d=\"M {ox + 190} {oy + 20} C {ox + 215} {oy + 20}, {x - 25} {y + 20}, {x} {y + 20}\" fill=\"none\" stroke=\"#91a7b3\" stroke-width=\"1.5\"/>')\n",
137
+ " kind = type(item).__name__\n",
138
+ " fill = colors.get(kind, '#f4f6f7')\n",
139
+ " label = escape(node_name(item)[:27])\n",
140
+ " nodes.append(f'<g><rect x=\"{x}\" y=\"{y}\" width=\"190\" height=\"40\" rx=\"7\" fill=\"{fill}\" stroke=\"#547180\"/><text x=\"{x + 9}\" y=\"{y + 17}\" font-size=\"11\" font-weight=\"700\">{label}</text><text x=\"{x + 9}\" y=\"{y + 32}\" font-size=\"9\" fill=\"#587487\">{kind}</text></g>')\n",
141
+ "\n",
142
+ "svg = f'''<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100%\" viewBox=\"0 0 {width} {height}\" style=\"background:#fbfcfc;border:1px solid #d9e3e8;border-radius:10px\">{''.join(edges)}{''.join(nodes)}</svg>'''\n",
143
+ "display(SVG(svg))\n",
144
+ "print(f'Displayed {len(selected)} elements and {len(edges)} ownership edges')"
145
+ ]
146
+ }
147
+ ],
148
+ "metadata": {
149
+ "kernelspec": {
150
+ "display_name": "Python 3 (ipykernel)",
151
+ "language": "python",
152
+ "name": "python3"
153
+ },
154
+ "language_info": {
155
+ "codemirror_mode": {
156
+ "name": "ipython",
157
+ "version": 3
158
+ },
159
+ "file_extension": ".py",
160
+ "mimetype": "text/x-python",
161
+ "name": "python",
162
+ "nbconvert_exporter": "python",
163
+ "pygments_lexer": "ipython3",
164
+ "version": "3.12.13"
165
+ },
166
+ "memo": {
167
+ "description": "Draw an SVG network of model elements and their ownership relationships.",
168
+ "starter": true
169
+ }
170
+ },
171
+ "nbformat": 4,
172
+ "nbformat_minor": 5
173
+ }