Skip to content

Commit

Permalink
Baseline and package renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
JanBliznicenko committed Nov 10, 2024
1 parent c7fbaee commit 1412676
Show file tree
Hide file tree
Showing 23 changed files with 1,450 additions and 1,450 deletions.

This file was deleted.

1 change: 0 additions & 1 deletion src/BaselineOfOntoUMLTransformationFramework/package.st

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Class {
#name : 'BaselineOfOpenPonkOntoUMLTransformations',
#superclass : 'BaselineOf',
#category : 'BaselineOfOpenPonkOntoUMLTransformations',
#package : 'BaselineOfOpenPonkOntoUMLTransformations'
}

{ #category : 'baselines' }
BaselineOfOpenPonkOntoUMLTransformations >> baseline: spec [
<baseline>
spec
for: #common
do: [ spec
baseline: 'OpenPonkOntoUMLModelQuery-Plugin'
with: [ spec
className: 'BaselineOfOpenPonkOntoUMLModelQuery';
repository: 'github://openponk/ontouml-modelquery';
loads: 'plugin' ].
spec
project: 'OpenPonkOntoUMLModelQuery'
copyFrom: 'OpenPonkOntoUMLModelQuery-Plugin'
with: [ spec loads: 'default' ].
spec package: 'OpenPonk-OntoUML-Transformations'.
spec
group: 'plugin'
with: #('OpenPonkOntoUMLModelQuery-Plugin' 'OpenPonk-OntoUML-Transformations').
spec
group: 'default'
with: #(OpenPonkOntoUMLModelQuery 'OpenPonk-OntoUML-Transformations') ]
]
1 change: 1 addition & 0 deletions src/BaselineOfOpenPonkOntoUMLTransformations/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : 'BaselineOfOpenPonkOntoUMLTransformations' }
1 change: 0 additions & 1 deletion src/OntoUML-TransformationFramework/package.st

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
Class {
#name : 'OntoUMLAssociationTransformer',
#superclass : 'OntoUMLTransformer',
#category : 'OntoUML-TransformationFramework-Transformers',
#package : 'OntoUML-TransformationFramework',
#tag : 'Transformers'
}

{ #category : 'accessing' }
OntoUMLAssociationTransformer class >> defaultTransformation [
^ OntoUMLTransformAssociation.
]

{ #category : 'transforming' }
OntoUMLAssociationTransformer class >> getTransformation: aAssocitaion [
| stereotypeClass |
stereotypeClass := OntoUMLModelQuery getStereotypeClass: aAssocitaion.
^ super getTransformation: stereotypeClass.
]

{ #category : 'transforming' }
OntoUMLAssociationTransformer class >> initializeTransformationIndex [
transformationIndex := Dictionary new.
transformationIndex add: (OntoUMLSubQuantityOf -> OntoUMLTransformSubQuantityOf).
]

{ #category : 'transforming' }
OntoUMLAssociationTransformer >> transform [
transformed memberEnds first type = transformed memberEnds second type ifTrue: [ ^nil. ].
^ (self class getTransformation: transformed) transform: transformed withController: controller withTransformer: self.
]
Class {
#name : 'OntoUMLAssociationTransformer',
#superclass : 'OntoUMLTransformer',
#category : 'OpenPonk-OntoUML-Transformations-Transformers',
#package : 'OpenPonk-OntoUML-Transformations',
#tag : 'Transformers'
}

{ #category : 'accessing' }
OntoUMLAssociationTransformer class >> defaultTransformation [
^ OntoUMLTransformAssociation.
]

{ #category : 'transforming' }
OntoUMLAssociationTransformer class >> getTransformation: aAssocitaion [
| stereotypeClass |
stereotypeClass := OntoUMLModelQuery getStereotypeClass: aAssocitaion.
^ super getTransformation: stereotypeClass.
]

{ #category : 'transforming' }
OntoUMLAssociationTransformer class >> initializeTransformationIndex [
transformationIndex := Dictionary new.
transformationIndex add: (OntoUMLSubQuantityOf -> OntoUMLTransformSubQuantityOf).
]

{ #category : 'transforming' }
OntoUMLAssociationTransformer >> transform [
transformed memberEnds first type = transformed memberEnds second type ifTrue: [ ^nil. ].
^ (self class getTransformation: transformed) transform: transformed withController: controller withTransformer: self.
]
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
Class {
#name : 'OntoUMLClassTransformer',
#superclass : 'OntoUMLTransformer',
#category : 'OntoUML-TransformationFramework-Transformers',
#package : 'OntoUML-TransformationFramework',
#tag : 'Transformers'
}

{ #category : 'transforming' }
OntoUMLClassTransformer class >> defaultTransformation [
^ OntoUMLTransformClass.
]

{ #category : 'transforming' }
OntoUMLClassTransformer class >> getTransformation: aClass [
| stereotypeClass |
stereotypeClass := OntoUMLModelQuery getStereotypeClass: aClass.
^ super getTransformation: stereotypeClass.
]

{ #category : 'transforming' }
OntoUMLClassTransformer class >> initializeTransformationIndex [
transformationIndex := Dictionary new.
"Currently there are no class specific transformations."
]

{ #category : 'transforming' }
OntoUMLClassTransformer >> transform [
^ (self class getTransformation: transformed) transform: transformed withController: controller withTransformer: self.
]
Class {
#name : 'OntoUMLClassTransformer',
#superclass : 'OntoUMLTransformer',
#category : 'OpenPonk-OntoUML-Transformations-Transformers',
#package : 'OpenPonk-OntoUML-Transformations',
#tag : 'Transformers'
}

{ #category : 'transforming' }
OntoUMLClassTransformer class >> defaultTransformation [
^ OntoUMLTransformClass.
]

{ #category : 'transforming' }
OntoUMLClassTransformer class >> getTransformation: aClass [
| stereotypeClass |
stereotypeClass := OntoUMLModelQuery getStereotypeClass: aClass.
^ super getTransformation: stereotypeClass.
]

{ #category : 'transforming' }
OntoUMLClassTransformer class >> initializeTransformationIndex [
transformationIndex := Dictionary new.
"Currently there are no class specific transformations."
]

{ #category : 'transforming' }
OntoUMLClassTransformer >> transform [
^ (self class getTransformation: transformed) transform: transformed withController: controller withTransformer: self.
]
Original file line number Diff line number Diff line change
@@ -1,96 +1,96 @@
Class {
#name : 'OntoUMLGeneralizationSetTransformer',
#superclass : 'OntoUMLTransformer',
#instVars : [
'generalizations',
'name'
],
#classInstVars : [
'savedTransformation'
],
#category : 'OntoUML-TransformationFramework-Transformers',
#package : 'OntoUML-TransformationFramework',
#tag : 'Transformers'
}

{ #category : 'transforming' }
OntoUMLGeneralizationSetTransformer class >> defaultTransformation [
^ [ :generalizations :controller :transformer | OntoUMLTransformGeneralizationSet transform: generalizations withController: controller withTransformer: transformer. ].
]

{ #category : 'transforming' }
OntoUMLGeneralizationSetTransformer class >> generalizationSetGroups [
"Order of elements in collection determines order of the transformation"
^ { 'Phase'. 'Role'. 'RoleMixin'. 'Mixin'. 'Object'. "Object = all remaining GenSet groups" }.
]

{ #category : 'transforming' }
OntoUMLGeneralizationSetTransformer class >> initializeTransformationIndex [
transformationIndex := Dictionary new.
transformationIndex add: ('Phase' -> [ :generalizations :controller :transformer | OntoUMLTransformGeneralizationSet transformAsComposition: generalizations withController: controller withTransformer: transformer. ]).
transformationIndex add: ('Role' -> [ :generalizations :controller :transformer | OntoUMLTransformGeneralizationSet transformAsComposition: generalizations withController: controller withTransformer: transformer. ]).
transformationIndex add: ('RoleMixin' -> [ :generalizations :controller :transformer | OntoUMLTransformGeneralizationSet transformAsComposition: generalizations withController: controller withTransformer: transformer. ]).
transformationIndex add: ('Mixin' -> [ :generalizations :controller :transformer | OntoUMLTransformGeneralizationSet transformAsComposition: generalizations withController: controller withTransformer: transformer. ]).
]

{ #category : 'accessing' }
OntoUMLGeneralizationSetTransformer class >> savedTransformation [

^ savedTransformation
]

{ #category : 'accessing' }
OntoUMLGeneralizationSetTransformer class >> savedTransformation: anObject [

savedTransformation := anObject
]

{ #category : 'accessing' }
OntoUMLGeneralizationSetTransformer >> general [
^ controller getTransfomedElementFrom: transformed generalizations first general.
]

{ #category : 'accessing' }
OntoUMLGeneralizationSetTransformer >> name [

^ name
]

{ #category : 'accessing' }
OntoUMLGeneralizationSetTransformer >> name: anObject [

name := anObject
]

{ #category : 'transforming' }
OntoUMLGeneralizationSetTransformer >> transform [
transformed generalizations ifEmpty: [ ^{}. ].
(OntoUMLModelQuery isStereotypeOf: transformed generalizations first general oclKindOf: 'Sortal')
ifTrue: [ ^ self transformSortalGenSet. ]
ifFalse: [ ^ self transformNonSortalGenSet. ].
]

{ #category : 'transforming' }
OntoUMLGeneralizationSetTransformer >> transformGroup: aGroup [
| transformedGeneralizations transformation result |
transformedGeneralizations := generalizations select: [ :generalization | OntoUMLModelQuery isStereotypeOf: generalization specific oclKindOf: aGroup. ].
transformedGeneralizations ifEmpty: [ ^{}. ].
transformation := self class getTransformation: aGroup.
result := transformation value: transformedGeneralizations value: controller value: self.
generalizations removeAll: transformedGeneralizations.
^ result.
]

{ #category : 'transforming' }
OntoUMLGeneralizationSetTransformer >> transformNonSortalGenSet [
generalizations := OrderedCollection new.
generalizations addAll: transformed generalizations.
^ OntoUMLTransformGeneralizationSet transformWithoutCombination: generalizations withController: controller withTransformer: self.
]

{ #category : 'transforming' }
OntoUMLGeneralizationSetTransformer >> transformSortalGenSet [
generalizations := OrderedCollection new.
generalizations addAll: transformed generalizations.
^ self class generalizationSetGroups collect: [ :group | self transformGroup: group. ].
]
Class {
#name : 'OntoUMLGeneralizationSetTransformer',
#superclass : 'OntoUMLTransformer',
#instVars : [
'generalizations',
'name'
],
#classInstVars : [
'savedTransformation'
],
#category : 'OpenPonk-OntoUML-Transformations-Transformers',
#package : 'OpenPonk-OntoUML-Transformations',
#tag : 'Transformers'
}

{ #category : 'transforming' }
OntoUMLGeneralizationSetTransformer class >> defaultTransformation [
^ [ :generalizations :controller :transformer | OntoUMLTransformGeneralizationSet transform: generalizations withController: controller withTransformer: transformer. ].
]

{ #category : 'transforming' }
OntoUMLGeneralizationSetTransformer class >> generalizationSetGroups [
"Order of elements in collection determines order of the transformation"
^ { 'Phase'. 'Role'. 'RoleMixin'. 'Mixin'. 'Object'. "Object = all remaining GenSet groups" }.
]

{ #category : 'transforming' }
OntoUMLGeneralizationSetTransformer class >> initializeTransformationIndex [
transformationIndex := Dictionary new.
transformationIndex add: ('Phase' -> [ :generalizations :controller :transformer | OntoUMLTransformGeneralizationSet transformAsComposition: generalizations withController: controller withTransformer: transformer. ]).
transformationIndex add: ('Role' -> [ :generalizations :controller :transformer | OntoUMLTransformGeneralizationSet transformAsComposition: generalizations withController: controller withTransformer: transformer. ]).
transformationIndex add: ('RoleMixin' -> [ :generalizations :controller :transformer | OntoUMLTransformGeneralizationSet transformAsComposition: generalizations withController: controller withTransformer: transformer. ]).
transformationIndex add: ('Mixin' -> [ :generalizations :controller :transformer | OntoUMLTransformGeneralizationSet transformAsComposition: generalizations withController: controller withTransformer: transformer. ]).
]

{ #category : 'accessing' }
OntoUMLGeneralizationSetTransformer class >> savedTransformation [

^ savedTransformation
]

{ #category : 'accessing' }
OntoUMLGeneralizationSetTransformer class >> savedTransformation: anObject [

savedTransformation := anObject
]

{ #category : 'accessing' }
OntoUMLGeneralizationSetTransformer >> general [
^ controller getTransfomedElementFrom: transformed generalizations first general.
]

{ #category : 'accessing' }
OntoUMLGeneralizationSetTransformer >> name [

^ name
]

{ #category : 'accessing' }
OntoUMLGeneralizationSetTransformer >> name: anObject [

name := anObject
]

{ #category : 'transforming' }
OntoUMLGeneralizationSetTransformer >> transform [
transformed generalizations ifEmpty: [ ^{}. ].
(OntoUMLModelQuery isStereotypeOf: transformed generalizations first general oclKindOf: 'Sortal')
ifTrue: [ ^ self transformSortalGenSet. ]
ifFalse: [ ^ self transformNonSortalGenSet. ].
]

{ #category : 'transforming' }
OntoUMLGeneralizationSetTransformer >> transformGroup: aGroup [
| transformedGeneralizations transformation result |
transformedGeneralizations := generalizations select: [ :generalization | OntoUMLModelQuery isStereotypeOf: generalization specific oclKindOf: aGroup. ].
transformedGeneralizations ifEmpty: [ ^{}. ].
transformation := self class getTransformation: aGroup.
result := transformation value: transformedGeneralizations value: controller value: self.
generalizations removeAll: transformedGeneralizations.
^ result.
]

{ #category : 'transforming' }
OntoUMLGeneralizationSetTransformer >> transformNonSortalGenSet [
generalizations := OrderedCollection new.
generalizations addAll: transformed generalizations.
^ OntoUMLTransformGeneralizationSet transformWithoutCombination: generalizations withController: controller withTransformer: self.
]

{ #category : 'transforming' }
OntoUMLGeneralizationSetTransformer >> transformSortalGenSet [
generalizations := OrderedCollection new.
generalizations addAll: transformed generalizations.
^ self class generalizationSetGroups collect: [ :group | self transformGroup: group. ].
]
Loading

0 comments on commit 1412676

Please sign in to comment.