]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.district.network.ontology/graph/DistrictNetwork.pgraph
Added Edge.ThicknessProperty for generic edge-thickness styling
[simantics/district.git] / org.simantics.district.network.ontology / graph / DistrictNetwork.pgraph
index 435bd55d9813e30a19bb8ab66e0ae8c26342d26a..657ffc697edcb246eeb45d01da266764b14018f5 100644 (file)
@@ -13,16 +13,94 @@ DN = <http://www.simantics.org/DistrictNetwork-1.0> : L0.Ontology
     L0.Ontology.global true
     L0.HasResourceClass "org.simantics.district.network.ontology.DistrictNetworkResource"
 
-DN.Layer <T DIA.Layer
+// ----------------------------------------------------------------------------
+
+DN.SCLMain : L0.SCLModule
+    L0.SCLModule.definition
+        """
+        include "Simantics/District/SCLMain"
+        """
 
+// ----------------------------------------------------------------------------
+
+defProperty : L0.Template
+    @template %subject %label %range
+        %subject <R L0.HasProperty : SEL.GenericParameterType
+            L0.HasLabel %label : L0.String
+            L0.HasRange %range
+
+// ----------------------------------------------------------------------------
+
+DN.Diagram <T DIA.Diagram
+DN.Layer <T DIA.Layer
+DN.Connection <T DIA.Connection
 DN.Element <T DIA.Element : L0.Type
 
+DN.Vertex <T DN.Element
+    >-- DN.Vertex.HasElevation
+        @defProperty "Elevation" L0.Double
+    >-- DN.Vertex.HasAddress
+        @defProperty "Address" L0.String
+    >-- DN.Vertex.HasSupplyTemperature
+        @defProperty "Supply Temperature" L0.Double 
+    >-- DN.Vertex.HasReturnTemperature 
+        @defProperty "Return Temperature" L0.Double
+    >-- DN.Vertex.HasSupplyPressure
+        @defProperty "Supply Pressure" L0.Double 
+    >-- DN.Vertex.HasReturnPressure
+        @defProperty "Return Pressure" L0.Double 
+    >-- DN.Vertex.HasDeltaPressure
+        @defProperty "Delta pressure" L0.Double 
+    >-- DN.Vertex.HasDeltaTemperature
+        @defProperty "Delta temperature" L0.Double 
+    >-- DN.Vertex.HasHeatPower
+        @defProperty "Heat Power" L0.Double 
+    >-- DN.Vertex.HasNominalHeadM
+        @defProperty "NominalHeadM" L0.Double 
+    >-- DN.Vertex.HasNominalHeadB
+        @defProperty "NominalHeadB" L0.Double 
+    >-- DN.Vertex.HasNominalFlow
+        @defProperty "Nominal Flow" L0.Double 
+    >-- DN.Vertex.HasMaximumHeadM
+        @defProperty "Maximum head M" L0.Double 
+    >-- DN.Vertex.HasHeatLoadDs
+        @defProperty "Heat Load ds" L0.Double 
+    >-- DN.Vertex.HasMassFlow
+        @defProperty "Mass Flow" L0.Double 
+    >-- DN.Vertex.HasVolFlow
+        @defProperty "Vol Flow" L0.Double 
+    >-- DN.Vertex.HasVelocity
+        @defProperty "Velocity" L0.Double 
+    >-- DN.Vertex.HasFlowArea
+        @defProperty "Flow Area" L0.Double 
+    >-- DN.Vertex.HasValvePosition
+        @defProperty "Valve position" L0.Double 
+    >-- DN.Vertex.HasNominalPressureLoss
+        @defProperty "Nominal Pressure Loss" L0.Double 
+    @L0.assert DN.Vertex.HasElevation 0.0
+
 DN.Edge <T DN.Element
+    >-- DN.Edge.HasLength 
+        @defProperty "Length" L0.Double
+        L0.readOnly true
+    >-- DN.Edge.HasDiameter
+        @defProperty "Diameter" L0.Double
+    >-- DN.Edge.HasOuterDiameter
+        @defProperty "Outer Diameter" L0.Double
+    >-- DN.Edge.HasNominalMassFlow
+        @defProperty "Nominal Mass Flow" L0.Double
+    >-- DN.Edge.HasFlowArea
+        @defProperty "Flow Area" L0.Double
+    >-- DN.Edge.HasKReturn
+        @defProperty "K Return" L0.Double
+    >-- DN.Edge.HasKSupply
+        @defProperty "K Supply" L0.Double
+    >-- DN.Edge.HasTGround
+        @defProperty "T Ground" L0.Double
     @L0.assert DN.Edge.HasDiameter 0.1
     @L0.assert DN.Edge.HasOuterDiameter 0.11
 
-DN.Vertex <T DN.Element
-    @L0.assert DN.Vertex.HasElevation 0.0
+// ----------------------------------------------------------------------------
 
 DN.EdgeDefaultMapping <R L0.HasProperty : DN.EdgeMappingParameterType
     L0.HasLabel "Default Edge mapping"
@@ -30,6 +108,8 @@ DN.EdgeDefaultMapping <R L0.HasProperty : DN.EdgeMappingParameterType
 DN.VertexDefaultMapping <R L0.HasProperty : DN.VertexMappingParameterType
     L0.HasLabel "Default Vertex mapping"
 
+// ----------------------------------------------------------------------------
+
 DN.Functions : L0.Library
 
 DN.VertexMappingParameterType <T SEL.GenericParameterType
@@ -50,152 +130,13 @@ DN.MappingParameterType <T SEL.GenericParameterType
       SEL.HasEnumerationValues DN.Functions.enumerationValues
       SEL.HasCustomModifier DN.Functions.mappingModifier : L0.Function
 
+// ----------------------------------------------------------------------------
+
 DN.HasMapping <R L0.HasProperty : DN.MappingParameterType
     L0.HasLabel "Mapping"
 
-DN.HasId <R L0.HasProperty : SEL.GenericParameterType
+DN.HasId --> L0.String <R L0.HasProperty : SEL.GenericParameterType
     L0.HasLabel "Id"
-    L0.HasRange L0.String
-    L0.readOnly false
-
-DN.Vertex.HasElevation <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Elevation"
-    L0.HasRange L0.Double
-    L0.readOnly false
-    
-DN.Vertex.HasAddress <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Address"
-    L0.HasRange L0.String
-    L0.readOnly false
-
-DN.Vertex.HasSupplyTemperature <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Supply Temperature"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Vertex.HasReturnTemperature <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Return Temperature"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Vertex.HasSupplyPressure <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Supply Pressure"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Vertex.HasReturnPressure <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Return Pressure"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Vertex.HasDeltaPressure <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Delta pressure"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Vertex.HasDeltaTemperature <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Delta temperature"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Vertex.HasHeatPower <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Heat Power"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Vertex.HasNominalHeadM <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "NominalHeadM"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Vertex.HasNominalHeadB <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "NominalHeadB"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Vertex.HasNominalFlow <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Nominal Flow"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Vertex.HasMaximumHeadM <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Maximum head M"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Vertex.HasHeatLoadDs <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Heat Load ds"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Vertex.HasMassFlow <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Mass Flow"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Vertex.HasVolFlow <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Vol Flow"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Vertex.HasVelocity <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Velocity"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Vertex.HasFlowArea <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Flow Area"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Vertex.HasValvePosition <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Valve position"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Vertex.HasNominalPressureLoss <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Nominal Pressure Loss"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Edge.HasLength <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Length"
-    L0.HasRange L0.Double
-    L0.readOnly true
-
-DN.Edge.HasDiameter <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Diameter"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Edge.HasOuterDiameter <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Outer Diameter"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Edge.HasNominalMassFlow <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Nominal Mass Flow"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Edge.HasFlowArea <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "Flow Area"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Edge.HasKReturn <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "K Return"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Edge.HasKSupply <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "K Supply"
-    L0.HasRange L0.Double
-    L0.readOnly false
-
-DN.Edge.HasTGround <R L0.HasProperty : SEL.GenericParameterType
-    L0.HasLabel "T Ground"
-    L0.HasRange L0.Double
     L0.readOnly false
 
 DN.InLayer
@@ -205,16 +146,12 @@ DN.InLayer
 DN.HasInLayerTag <R L0.HasProperty
     L0.HasRange L0.Tag
 
-DN.Connection <T DIA.Connection
-
 // For associating typical diagram source and instance structures with each other
 DN.Diagram.MappedDiagram <R L0.IsWeaklyRelatedTo
     L0.InverseOf DN.Diagram.MappedFromDiagram <R L0.IsWeaklyRelatedTo
 DN.MappedComponent <R L0.IsWeaklyRelatedTo
     L0.InverseOf DN.MappedFromElement <R L0.IsWeaklyRelatedTo
 
-DN.Diagram <T DIA.Diagram
-
 DN.AddLayerToDNDiagramTemplate <T L0.Template
 
 DN.EPSG_4326 : DN.SpatialRefSystem
@@ -254,40 +191,7 @@ DN.HasEndVertex <R L0.DependsOn
     L0.HasRange DN.Vertex
     L0.InverseOf DN.HasEndVertex_Inverse <R L0.IsRelatedTo
 
-MBC = MOD.ModelingBrowseContext
-
-DNAC.newDiagramContribution : L0.Template
-    @template %actionContext %label %image %action
-        %actionContext
-            VP.BrowseContext.HasActionContribution _ : VP.ActionContribution
-                L0.HasLabel %label
-                VP.ActionContribution.HasImage %image
-                VP.ActionContribution.HasCategory VP.NewActionCategory
-                VP.ActionContribution.HasNodeType MBC.Configuration
-                VP.ActionContribution.HasAction %action
-
-DNAC = DN.ActionContext : VP.BrowseContext
-    VP.BrowseContext.IsIncludedIn MOD.ModelingActionContext
-    @DNAC.newDiagramContribution "Network Diagram" IMAGES.MapImage ACTIONS.NewDNDiagram
-
-DNBC = DN.BrowseContext : VP.BrowseContext
-    VP.BrowseContext.IsIncludedIn MOD.ModelingBrowseContext
-    VP.BrowseContext.Includes SEL_UI.StandardPropertiesBase.BrowseContext
-    
-    @VP.customModifierRule    DN.Edge    VP.ResourceLabelModifierRule
-    @VP.constantImageRule     DN.Composite   IMAGES.MapImage
-
-
-ACTIONS = DN.Actions : L0.Library
-
-ACTIONS.NewDNDiagram : MOD.NewComposite
-    MOD.NewComposite.HasCompositeType DN.Composite
-    MOD.NewComposite.HasDefaultName "NewNetworkDiagram"
-
-IMAGES = DN.Images : L0.Library
-
-IMAGES.MapImage : IMAGE.PngImage
-    @L0.loadBytes "images/map.png"
+// ----------------------------------------------------------------------------
 
 // Component MAPPING
 DN.Mapping <T L0.Library
@@ -346,65 +250,3 @@ DN.Mapping.EdgeMapping <T DN.Mapping.Base
     >-- DN.Mapping.EdgeMapping.KSupplyAttribute --> L0.String <R L0.HasProperty
     >-- DN.Mapping.EdgeMapping.TGroundAttribute --> L0.String <R L0.HasProperty
     >-- DN.Mapping.Terminals
-
-DN.SCLMain : L0.SCLModule
-    L0.SCLModule.definition
-        """
-        include "Simantics/District/SCLMain"
-        """
-
-DN.DistrictProfile : DIA.Profile
-    L0.HasLabel "District Network Profile"
-    DIA.Profile.priority 0.0
-    DIA.HasEntries
-      _ : DIA.Profile
-        @L0.list
-          DN.DistrictProfile.entry
-            L0.HasLabel "Component names"
-            @DIA.groupStyleProfileEntry DN.ComponentNameStyle DN.Groups.ElementGroup
-          DN.DistrictProfile.entry1
-            L0.HasLabel "Id"
-            @DIA.groupStyleProfileEntry DN.ComponentIdStyle DN.Groups.ElementGroup
-          DN.DistrictProfile.entry2
-            L0.HasLabel "Edge Node Styling"
-            @DIA.groupStyleProfileEntry DN.EdgeNodeStyle DN.Groups.ElementGroup
-
-DN.Groups : L0.Library
-
-DN.Groups.ElementGroup : DIA.TypeGroup
-  DIA.TypeGroup.HasType DN.Element
-
-DN.ComponentNameStyle : DIA.ResourceSCLTextGridStyle
-    @MOD.scl DIA.ResourceSCLTextGridStyle.texts 
-        """
-        districtNetworkProfileStyle "http://www.simantics.org/Layer0-1.1/HasName"
-        """
-        "String -> Variable -> <ReadGraph> (String, String, String)"
-    @G2D.fontProperty DIA.TextElement.font "Arial" 30 G2D.FontStyle.normal_font_style
-
-DN.ComponentIdStyle : DIA.ResourceSCLTextGridStyle
-    @MOD.scl DIA.ResourceSCLTextGridStyle.texts 
-        """
-        districtNetworkProfileStyle "http://www.simantics.org/Layer0-1.1/HasName" 
-        """
-        "String -> Variable -> <ReadGraph> (String, String, String)"
-    @G2D.fontProperty DIA.TextElement.font "Arial" 30 G2D.FontStyle.normal_font_style
-
-//DN.EdgeNodeGroup : DIA.Group
-
-//DN.Profiles : L0.Library
-
-DN.EdgeNodeStyle : DIA.Style
-
-// Templates
-
-//groupStyleEntry : L0.Template
-//    @template %subject %style %group
-//        %subject : DIA.GroupStyleProfileEntry
-//            DIA.ProfileEntry.HasStyle %style
-//            DIA.ProfileEntry.HasGroup %group
-
-
-//DN.Profiles.EdgeNodeStyle
-//    L0.HasLabel "Edge Node Style"
-//    @groupStyleEntry DN.EdgeNodeStyle DN.EdgeNodeGroup