]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Changed strengths in Redeclaration relations. If enumeration is removed, also redecla...
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 19 Jan 2012 13:46:16 +0000 (13:46 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 19 Jan 2012 13:46:16 +0000 (13:46 +0000)
SYSDYN.Redeclaration <T L0.Entity
    >-- SYSDYN.Redeclaration.replacedEnumeration --> SYSDYN.Enumeration <R L0.IsRelatedTo : L0.TotalFunction
        L0.InverseOf SYSDYN.Redeclaration.replacedIn <R L0.DependsOn : L0.FunctionalRelation
    >-- SYSDYN.Redeclaration.replacingEnumeration --> SYSDYN.Enumeration <R L0.IsRelatedTo : L0.TotalFunction
        L0.InverseOf SYSDYN.Redeclaration.replacesEnumerationIn <R L0.DependsOn : L0.FunctionalRelation

git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@24006 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ontology/graph.tg
org.simantics.sysdyn.ontology/graph/Sysdyn.pgraph
org.simantics.sysdyn.ontology/src/org/simantics/sysdyn/SysdynResource.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/EnumerationNode.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/exports/ExportModuleHandler.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/wizards/modules/WizardModulesExportPage.java
org.simantics.sysdyn/src/org/simantics/sysdyn/representation/Enumeration.java

index c85ecfc9ecd2052dd594f3b3ac192cf8923c6de9..61bd5b20718f346f8e8802c143e8c47af9e43bfd 100644 (file)
Binary files a/org.simantics.sysdyn.ontology/graph.tg and b/org.simantics.sysdyn.ontology/graph.tg differ
index 969d00b6b7ec2cf8b514291154b371b33921bd66..750b47ebbbddc4bb0e544e39aa6067e25fc285b4 100644 (file)
@@ -229,9 +229,11 @@ SYSDYN.EnumerationIndex <T L0.Entity
 //#####################################################################
         
 SYSDYN.Redeclaration <T L0.Entity
-    >-- SYSDYN.Redeclaration.replacedEnumeration --> SYSDYN.Enumeration <R L0.HasProperty : L0.TotalFunction
-    >-- SYSDYN.Redeclaration.replacingEnumeration --> SYSDYN.Enumeration <R L0.HasProperty : L0.TotalFunction    
-    
+    >-- SYSDYN.Redeclaration.replacedEnumeration --> SYSDYN.Enumeration <R L0.IsRelatedTo : L0.TotalFunction
+        L0.InverseOf SYSDYN.Redeclaration.replacedIn <R L0.DependsOn : L0.FunctionalRelation 
+    >-- SYSDYN.Redeclaration.replacingEnumeration --> SYSDYN.Enumeration <R L0.IsRelatedTo : L0.TotalFunction    
+        L0.InverseOf SYSDYN.Redeclaration.replacesEnumerationIn <R L0.DependsOn : L0.FunctionalRelation 
+            
 //#####################################################################
 // Functions
 //#####################################################################    
index 54096d1cd76cee4692554ca259d3cdca598da6a1..17524a49495008cb95662fb1062a80b8302b095d 100644 (file)
@@ -199,9 +199,9 @@ public class SysdynResource {
     public final Resource ProjectBrowseContext_SharedFunctionsFolder;\r
     public final Resource Redeclaration;\r
     public final Resource Redeclaration_replacedEnumeration;\r
-    public final Resource Redeclaration_replacedEnumeration_Inverse;\r
+    public final Resource Redeclaration_replacedIn;\r
+    public final Resource Redeclaration_replacesEnumerationIn;\r
     public final Resource Redeclaration_replacingEnumeration;\r
-    public final Resource Redeclaration_replacingEnumeration_Inverse;\r
     public final Resource Result;\r
     public final Resource Result_parameterFile;\r
     public final Resource Result_parameterFile_Inverse;\r
@@ -493,9 +493,9 @@ public class SysdynResource {
         public static final String ProjectBrowseContext_SharedFunctionsFolder = "http://www.simantics.org/Sysdyn-1.1/ProjectBrowseContext/SharedFunctionsFolder";\r
         public static final String Redeclaration = "http://www.simantics.org/Sysdyn-1.1/Redeclaration";\r
         public static final String Redeclaration_replacedEnumeration = "http://www.simantics.org/Sysdyn-1.1/Redeclaration/replacedEnumeration";\r
-        public static final String Redeclaration_replacedEnumeration_Inverse = "http://www.simantics.org/Sysdyn-1.1/Redeclaration/replacedEnumeration/Inverse";\r
+        public static final String Redeclaration_replacedIn = "http://www.simantics.org/Sysdyn-1.1/Redeclaration/replacedIn";\r
+        public static final String Redeclaration_replacesEnumerationIn = "http://www.simantics.org/Sysdyn-1.1/Redeclaration/replacesEnumerationIn";\r
         public static final String Redeclaration_replacingEnumeration = "http://www.simantics.org/Sysdyn-1.1/Redeclaration/replacingEnumeration";\r
-        public static final String Redeclaration_replacingEnumeration_Inverse = "http://www.simantics.org/Sysdyn-1.1/Redeclaration/replacingEnumeration/Inverse";\r
         public static final String Result = "http://www.simantics.org/Sysdyn-1.1/Result";\r
         public static final String Result_parameterFile = "http://www.simantics.org/Sysdyn-1.1/Result/parameterFile";\r
         public static final String Result_parameterFile_Inverse = "http://www.simantics.org/Sysdyn-1.1/Result/parameterFile/Inverse";\r
@@ -797,9 +797,9 @@ public class SysdynResource {
         ProjectBrowseContext_SharedFunctionsFolder = getResourceOrNull(graph, URIs.ProjectBrowseContext_SharedFunctionsFolder);\r
         Redeclaration = getResourceOrNull(graph, URIs.Redeclaration);\r
         Redeclaration_replacedEnumeration = getResourceOrNull(graph, URIs.Redeclaration_replacedEnumeration);\r
-        Redeclaration_replacedEnumeration_Inverse = getResourceOrNull(graph, URIs.Redeclaration_replacedEnumeration_Inverse);\r
+        Redeclaration_replacedIn = getResourceOrNull(graph, URIs.Redeclaration_replacedIn);\r
+        Redeclaration_replacesEnumerationIn = getResourceOrNull(graph, URIs.Redeclaration_replacesEnumerationIn);\r
         Redeclaration_replacingEnumeration = getResourceOrNull(graph, URIs.Redeclaration_replacingEnumeration);\r
-        Redeclaration_replacingEnumeration_Inverse = getResourceOrNull(graph, URIs.Redeclaration_replacingEnumeration_Inverse);\r
         Result = getResourceOrNull(graph, URIs.Result);\r
         Result_parameterFile = getResourceOrNull(graph, URIs.Result_parameterFile);\r
         Result_parameterFile_Inverse = getResourceOrNull(graph, URIs.Result_parameterFile_Inverse);\r
index 21f08d511e623be08b97d69b6c66a22ec671c67e..6c370b0c1f3eb283e7f44e21a64150701e93fad0 100644 (file)
@@ -31,11 +31,11 @@ public class EnumerationNode extends VariableNode<Resource> implements IDeletabl
                 @Override\r
                 public void perform(WriteGraph graph) throws DatabaseException, CancelTransactionException {\r
                     SysdynResource sr = SysdynResource.getInstance(graph);\r
-                    for(Resource redeclaration : graph.getObjects(data, sr.Redeclaration_replacedEnumeration_Inverse)) {\r
+                    for(Resource redeclaration : graph.getObjects(data, sr.Redeclaration_replacedIn)) {\r
                        graph.deny(redeclaration, sr.Module_redeclaration_Inverse);\r
                     }\r
                     \r
-                    for(Resource redeclaration : graph.getObjects(data, sr.Redeclaration_replacingEnumeration_Inverse)) {\r
+                    for(Resource redeclaration : graph.getObjects(data, sr.Redeclaration_replacedIn)) {\r
                        graph.deny(redeclaration, sr.Module_redeclaration_Inverse);\r
                     }\r
                     \r
index 7b12325e14b17408ecf437ab3ba6e9d5fad37db7..b7ca5c457f04a4b7278b493ae6b8acac7d0db832 100644 (file)
@@ -235,21 +235,21 @@ public class ExportModuleHandler extends AbstractHandler {
                        ArrayList<Pair<Resource, Resource>> replacements = new ArrayList<Pair<Resource, Resource>>();\r
 \r
                        for(Resource enumeration : graph.syncRequest(new ObjectsWithType(configuration, l0.ConsistsOf, sr.Enumeration))) {\r
-                               if(graph.hasStatement(enumeration, sr.Redeclaration_replacedEnumeration_Inverse)) {\r
-                                       for(Resource replacement : graph.getObjects(enumeration, sr.Redeclaration_replacedEnumeration_Inverse)) {\r
+                               if(graph.hasStatement(enumeration, sr.Redeclaration_replacedIn)) {\r
+                                       for(Resource replacement : graph.getObjects(enumeration, sr.Redeclaration_replacedIn)) {\r
                                                replacements.add(new Pair<Resource, Resource>(enumeration, replacement));\r
                                        }\r
                                }\r
                        }\r
                        \r
                        for(Pair<Resource,Resource> replacement : replacements)\r
-                               graph.deny(replacement.first, sr.Redeclaration_replacedEnumeration_Inverse, replacement.second);\r
+                               graph.deny(replacement.first, sr.Redeclaration_replacedIn, replacement.second);\r
                        \r
                        TransferableGraph1 tg = graph.syncRequest(new TransferableGraphRequest2(roots, component));\r
                        Files.createFile(new File(path), Bindings.getBindingUnchecked(TransferableGraph1.class), tg);\r
                        \r
                        for(Pair<Resource,Resource> replacement : replacements)\r
-                               graph.claim(replacement.first, sr.Redeclaration_replacedEnumeration_Inverse, replacement.second);\r
+                               graph.claim(replacement.first, sr.Redeclaration_replacedIn, replacement.second);\r
 \r
                } catch (RuntimeBindingConstructionException e) {\r
                        e.printStackTrace();\r
index d14135a9a039f24eff5638f6fa6c555359ee6340..91d6036d6a0eeae25951031722e852068a74392a 100644 (file)
@@ -392,21 +392,21 @@ public class WizardModulesExportPage extends WizardPage {
                        ArrayList<Pair<Resource, Resource>> replacements = new ArrayList<Pair<Resource, Resource>>();\r
 \r
                        for(Resource enumeration : graph.syncRequest(new ObjectsWithType(configuration, l0.ConsistsOf, sr.Enumeration))) {\r
-                               if(graph.hasStatement(enumeration, sr.Redeclaration_replacedEnumeration_Inverse)) {\r
-                                       for(Resource replacement : graph.getObjects(enumeration, sr.Redeclaration_replacedEnumeration_Inverse)) {\r
+                               if(graph.hasStatement(enumeration, sr.Redeclaration_replacedIn)) {\r
+                                       for(Resource replacement : graph.getObjects(enumeration, sr.Redeclaration_replacedIn)) {\r
                                                replacements.add(new Pair<Resource, Resource>(enumeration, replacement));\r
                                        }\r
                                }\r
                        }\r
                        \r
                        for(Pair<Resource,Resource> replacement : replacements)\r
-                               graph.deny(replacement.first, sr.Redeclaration_replacedEnumeration_Inverse, replacement.second);\r
+                               graph.deny(replacement.first, sr.Redeclaration_replacedIn, replacement.second);\r
                        \r
                        TransferableGraph1 tg = graph.syncRequest(new TransferableGraphRequest2(roots, component));\r
                        Files.createFile(new File(path), Bindings.getBindingUnchecked(TransferableGraph1.class), tg);\r
                        \r
                        for(Pair<Resource,Resource> replacement : replacements)\r
-                               graph.claim(replacement.first, sr.Redeclaration_replacedEnumeration_Inverse, replacement.second);\r
+                               graph.claim(replacement.first, sr.Redeclaration_replacedIn, replacement.second);\r
 \r
                } catch (RuntimeBindingConstructionException e) {\r
                        e.printStackTrace();\r
index 51996a197f2657531652f7f46537e75944532a1f..c8a49888f7de6154246668a905cc1a029d3365ed 100644 (file)
@@ -30,7 +30,7 @@ public class Enumeration extends Variable {
     private Boolean isReplaceable;\r
     \r
     @RelatedElements(\r
-            value = SysdynResource.URIs.Redeclaration_replacedEnumeration_Inverse,\r
+            value = SysdynResource.URIs.Redeclaration_replacedIn,\r
             composition = true)\r
             private ArrayList<Redeclaration> redeclarations = new ArrayList<Redeclaration>();\r
 \r