]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.layer0/graph/Layer0Migration.pgraph
Alternative Namespace migration step for Shared Libs
[simantics/platform.git] / bundles / org.simantics.layer0 / graph / Layer0Migration.pgraph
1 L0 = <http://www.simantics.org/Layer0-1.1>
2
3
4 L0.Migration <T L0.Entity
5     >-- L0.Migration.from --> L0.Integer <R L0.HasProperty : L0.TotalFunction
6     >-- L0.Migration.format --> L0.String <R L0.HasProperty : L0.TotalFunction
7     >-- L0.Migration.step --> L0.MigrationStep <R L0.HasProperty
8     >-- L0.Migration.priority --> L0.Double <R L0.HasProperty : L0.TotalFunction
9
10 /* 
11  * Migration step
12  */
13 L0.MigrationStep <T L0.Entity
14    
15
16 /*
17  * A sequence of migration steps
18  */
19 L0.MigrationSequence <T L0.MigrationStep <T L0.List
20
21
22 /* 
23  * If a migration step inherits SCLMigrationStep,
24  * the migration step action is obtained with scl command L0.MigrationStep.stepAction
25  * Given SCL expression must return MigrationStep
26  */
27 L0.SCLMigrationStep <T L0.Entity
28     >-- L0.MigrationStep.stepAction --> L0.SCLMigrationStep.SCLMigrationStepAction <R L0.HasProperty : L0.FunctionalRelation
29
30 L0.SCLMigrationStep.SCLMigrationStepAction <T L0.SCLValue
31     @L0.assert L0.HasValueType "MigrationStep"      
32     
33     
34 /*
35  * Namespace migration is a basic transformation needed for import
36  *
37  * Consists of L0.NamespaceMigrationStep.Prefix
38  */
39 L0.NamespaceMigrationStep <T L0.MigrationStep  <T L0.List
40
41 L0.NamespaceMigrationStep.Prefix <T L0.Entity
42     >-- L0.NamespaceMigrationStep.Prefix.base --> L0.String <R L0.HasProperty : L0.TotalFunction
43     >-- L0.NamespaceMigrationStep.Prefix.from --> L0.String <R L0.HasProperty : L0.TotalFunction
44     >-- L0.NamespaceMigrationStep.Prefix.to --> L0.String <R L0.HasProperty : L0.TotalFunction
45
46 /*
47  * Due to poor MigrationStep and Model/SHared Library implementation, we need alternative implementation for
48  * Shared Librarty NameSpace migrations
49  */
50 L0.SLNamespaceMigrationStep <T L0.MigrationStep  <T L0.List
51
52 /*
53  * Ordered sets may be replaced with lists.
54  * Consists of L0.OrderedSetToListStep.change
55  */
56 L0.OrderedSetToListMigrationStep <T L0.MigrationStep <T L0.List
57
58 L0.OrderedSetToListMigrationStep.Change <T L0.Entity
59     >-- L0.OrderedSetToListMigrationStep.entityType --> L0.String <T L0.HasProperty : L0.TotalFunction
60     >-- L0.OrderedSetToListMigrationStep.orderedSetRelation --> L0.String <T L0.HasProperty : L0.TotalFunction
61     >-- L0.OrderedSetToListMigrationStep.orderedSetType --> L0.String <T L0.HasProperty : L0.TotalFunction
62     >-- L0.OrderedSetToListMigrationStep.listRelation --> L0.String <T L0.HasProperty : L0.TotalFunction
63     >-- L0.OrderedSetToListMigrationStep.listType --> L0.String <T L0.HasProperty : L0.TotalFunction
64
65 L0.InstanceOfMigrationStep <T L0.MigrationStep <T L0.List
66     L0.HasDescription """Simple migration step that switches one InstanceOf statement for another.
67 Useful for cases where the type hierarchy in an ontology changes.
68 The list is expected to contain an even number of URI string literals
69 where the first literal specifies the type whose instances shall have
70 their InstanceOf statements changed to the type pointed to by the second URI.
71 The list can contain multiple of these pairs."""