]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.district.network.ontology/graph/DistrictNetwork.pgraph
Adding new mappable attributes for vertices and edges
[simantics/district.git] / org.simantics.district.network.ontology / graph / DistrictNetwork.pgraph
index 64dbb60f89f6be5c06e581af81842d59145eed79..839b54b183688560414de51948cefeb0b00599a2 100644 (file)
@@ -13,21 +13,193 @@ 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.Edge <T DIA.Element : L0.Type
-    @L0.assert DN.Edge.HasDiameter 0.1
-    @L0.assert DN.Edge.HasOuterDiameter 0.11
+// ----------------------------------------------------------------------------
 
-DN.Vertex <T DIA.Element : L0.Type
+DN.Diagram <T DIA.Diagram
+    >-- DN.Diagram.trackChangesEnabled <R L0.HasProperty : SEL.GenericParameterType
+        --> L0.Boolean
+        L0.HasLabel "Track changes"
+    >-- DN.Diagram.splitToMultipleEnabled <R L0.HasProperty : SEL.GenericParameterType
+        --> L0.Boolean
+        L0.HasLabel "Split To Multiple Diagrams"
+    
+    @L0.assert DN.Diagram.trackChangesEnabled true
+    @L0.assert DN.Diagram.splitToMultipleEnabled true
+
+DN.Layer <T DIA.Layer
+DN.Connection <T DIA.Connection
+DN.Element <T DIA.Element : L0.Type
+
+DN.Vertex <T DN.Element
+    >-- DN.Vertex.HasDiameter
+        @defProperty "Diameter" L0.Double
+    >-- DN.Vertex.HasElevation
+        @defProperty "Elevation" L0.Double
+    >-- DN.Vertex.HasAltElevation
+        @defProperty "Alternative 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.HasNominalDT
+        @defProperty "Nominal DT" L0.Double
+    >-- DN.Vertex.HasHeatPower
+        @defProperty "Heat Power" L0.Double
+    >-- DN.Vertex.HasPeakPower
+        @defProperty "Peak 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
+    >-- DN.Vertex.HasPumpInReturnLine
+        @defProperty "Pump in Return Line" L0.Double
+    >-- DN.Vertex.HasHeadPumpMaximum
+        @defProperty "Head pump maximum" L0.Double
+    >-- DN.Vertex.HasHeadPumpNominal
+        @defProperty "Head pump nominal" L0.Double
+    >-- DN.Vertex.HasFrequencyConverterControlled
+        @defProperty "Frequency Converter Controlled" L0.Double
+    >-- DN.Vertex.HasInternalValveMeasurement
+        @defProperty "Internal Valve Measurement" L0.Double
+    >-- DN.Vertex.HasPumpMassFlowNominal
+        @defProperty "Pump Mass Flow Nominal" L0.Double
+    >-- DN.Vertex.HasPumpMeMax
+        @defProperty "Pump Me Max" L0.Double
+    >-- DN.Vertex.HasPumpMeMin
+        @defProperty "Pump Me Min" L0.Double
+    >-- DN.Vertex.HasPumpSpeedMax
+        @defProperty "Pump Speed Max" L0.Double
+    >-- DN.Vertex.HasPumpSpeedMin
+        @defProperty "Pump Speed Min" L0.Double
+    >-- DN.Vertex.HasPumpSupplyOn
+        @defProperty "Pump Supply On" L0.Boolean
+    >-- DN.Vertex.HasPumpReturnOn
+        @defProperty "Pump Return On" L0.Boolean
+    >-- DN.Vertex.HasPumpInSupplyLine
+        @defProperty "Pump In Supply Line" L0.Boolean
+    >-- DN.Vertex.HasValveReturnLine
+        @defProperty "Valve Return Line" L0.Double
+    >-- DN.Vertex.HasValveMeMax
+        @defProperty "Valve Me Max" L0.Double
+    >-- DN.Vertex.HasValveMeMin
+        @defProperty "Valve Me Min" L0.Double
+    >-- DN.Vertex.HasValveMinPosition
+        @defProperty "Valve Min Position" L0.Double
+    >-- DN.Vertex.HasValveOutletMode
+        @defProperty "Valve Outlet Mode" L0.Double
+    >-- DN.Vertex.HasValvePressLossNominal
+        @defProperty "Valve Press Loss Nominal" L0.Double
+    >-- DN.Vertex.HasOpeningTime 
+        @defProperty "Opening Time" L0.Double
     @L0.assert DN.Vertex.HasElevation 0.0
 
+DN.Edge <T DN.Element
+    >-- DN.Edge.HasElevation
+        @defProperty "Elevation" L0.Double
+    >-- DN.Edge.HasLength 
+        @defProperty "Length" L0.Double
+        L0.readOnly true
+    >-- DN.Edge.HasGeometry
+        @defProperty "Detailed Geometry" L0.DoubleArray
+    >-- 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
+    >-- DN.Edge.HasType
+        @defProperty "Pipe Type" L0.String
+    >-- DN.Edge.HasPipeCode
+        @defProperty "Pipe Code" L0.String
+    >-- DN.Edge.HasInstallationYear
+        @defProperty "Installation Year" L0.Integer
+    >-- DN.Edge.HasWallThickness
+        @defProperty "Wall Thickness" L0.Double
+    >-- DN.Edge.HasInsulationConductivity
+        @defProperty "Insulation Conductivity" L0.Double
+    >-- DN.Edge.HasPipeSizeDN
+        @defProperty "Pipe Size DN" L0.Integer
+    >-- DN.Edge.HasRoughness
+        @defProperty "Roughness" L0.Double
+    >-- DN.Edge.HasStructure
+        @defProperty "Structure" L0.String
+    >-- DN.Edge.HasInsulationClass
+        @defProperty "Insulation Class" L0.String
+    @L0.assert DN.Edge.HasDiameter 100.0
+    @L0.assert DN.Edge.HasOuterDiameter 125.0
+
+// ----------------------------------------------------------------------------
+
 DN.EdgeDefaultMapping <R L0.HasProperty : DN.EdgeMappingParameterType
     L0.HasLabel "Default Edge mapping"
 
 DN.VertexDefaultMapping <R L0.HasProperty : DN.VertexMappingParameterType
     L0.HasLabel "Default Vertex mapping"
 
+DN.RightClickDefaultMapping <R L0.HasProperty : DN.VertexMappingParameterType
+    L0.HasLabel "Right click Vertex mapping"
+
+DN.LeftClickDefaultMapping <R L0.HasProperty : DN.VertexMappingParameterType
+    L0.HasLabel "Left click Vertex mapping"
+
+DN.Diagram.DefaultPipeTechTypeId <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Default Pipe Tech Type ID"
+
+
+// ----------------------------------------------------------------------------
+
 DN.Functions : L0.Library
 
 DN.VertexMappingParameterType <T SEL.GenericParameterType
@@ -48,147 +220,17 @@ 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.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
+DN.HasRegion --> L0.String <R L0.HasProperty : SEL.GenericParameterType
+    L0.HasLabel "Region"
     L0.readOnly false
 
 DN.InLayer
@@ -198,25 +240,140 @@ DN.InLayer
 DN.HasInLayerTag <R L0.HasProperty
     L0.HasRange L0.Tag
 
-DN.Connection <T DIA.Connection
-
+// For associating 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
-
-DN.Diagram <T DIA.Diagram
+    L0.InverseOf DN.MappedFromElement <R L0.IsWeaklyRelatedTo
+
+// Dynamic Visualisations
+
+DN.VisualisationsFolder <T L0.Entity
+
+DN.Diagram.Visualisations <T L0.Entity
+    >-- DN.Diagram.Visualisations.Interval
+        @defProperty "Interval" L0.Long
+    >-- DN.Diagram.Visualisations.DisabledUpdates
+        @defProperty "Disabled Updates" L0.Boolean
+    >-- DN.Diagram.Visualisations.ResetVisualisation
+        @defProperty "Reset Visualisations" L0.Boolean
+    >-- DN.Diagram.Visualisations.ShowColorBars
+        @defProperty "Show Color Bars" L0.Boolean
+    >-- DN.Diagram.Visualisations.ShowColorBarTicks
+        @defProperty "Show Color Bar Ticks" L0.Boolean
+    >-- DN.Diagram.Visualisations.UseColorBarGradients
+        @defProperty "Use Color Bar Gradients" L0.Boolean
+    >-- DN.Diagram.Visualisations.ColorBarLocation
+        @defProperty "Color Bar Location" L0.String
+    >-- DN.Diagram.Visualisations.ColorBarSize
+        @defProperty "Color Bar Size" L0.String
+    >-- DN.Diagram.Visualisations.ShowSizeBars
+        @defProperty "Show Size Bars" L0.Boolean
+    >-- DN.Diagram.Visualisations.ShowSizeBarTicks
+        @defProperty "Show Size Bar Ticks" L0.Boolean
+    >-- DN.Diagram.Visualisations.UseSizeBarGradients
+        @defProperty "Use Size Bar Gradients" L0.Boolean
+    >-- DN.Diagram.Visualisations.SizeBarLocation
+        @defProperty "Size Bar Location" L0.String
+    >-- DN.Diagram.Visualisations.SizeBarSize
+        @defProperty "Size Bar Size" L0.String
+    >-- DN.Diagram.Visualisations.HideEdges
+        @defProperty "Hide Edges" L0.Boolean
+    >-- DN.Diagram.Visualisations.HidePoints
+        @defProperty "Hide Points" L0.Boolean
+    >-- DN.Diagram.Visualisations.HideConsumers
+        @defProperty "Hide Consumers" L0.Boolean
+    >-- DN.Diagram.Visualisations.HideProducers
+        @defProperty "Hide Producers" L0.Boolean
+    >-- DN.Diagram.Visualisations.HideValves
+        @defProperty "Hide Valves" L0.Boolean
+    >-- DN.Diagram.Visualisations.HidePumpingStations
+        @defProperty "Hide Pumping Stations" L0.Boolean
+    >-- DN.Diagram.Visualisations.StaticPropertiesNetworkBranches
+        @defProperty "Static Properties Network Branches" L0.Boolean
+    >-- DN.Diagram.Visualisations.StaticPropertiesPoints
+        @defProperty "Static Properties Points" L0.Boolean
+    >-- DN.Diagram.Visualisations.StaticPropertiesConsumers
+        @defProperty "Static Properties Consumers" L0.Boolean
+    >-- DN.Diagram.Visualisations.DynamicSymbolsShutoffValves
+        @defProperty "Dynamic Symbols Shutoff Valves" L0.Boolean
+    >-- DN.Diagram.Visualisations.DynamicSymbolsProducers
+        @defProperty "Dynamic Symbols Producers" L0.Boolean
+    >-- DN.Diagram.Visualisations.DynamicSymbolsValves
+        @defProperty "Dynamic Symbols Valves" L0.Boolean
+    >-- DN.Diagram.Visualisations.DynamicSymbolsPumpingStations
+        @defProperty "Dynamic Symbols Pumping Stations" L0.Boolean
+    >-- DN.Diagram.Visualisations.KeyVariableVertexHover
+        @defProperty "Key Variables for Vertices on Hover" L0.Boolean
+    >-- DN.Diagram.Visualisations.KeyVariableEdgeHover
+        @defProperty "Key Variables for Edges on Hover" L0.Boolean
+    >-- DN.Diagram.Visualisations.ShowElevationServerBoundingBox
+        @defProperty "Show Elevation server bounding box" L0.Boolean
+    >-- DN.Diagram.Visualisations.NotInSimulation
+        @defProperty "Not in Simulation" L0.Boolean
+    >-- DN.Diagram.Visualisations.ShowConnectedComponents
+        @defProperty "Show Connected Components" L0.Boolean
+
+DN.Diagram.Visualisations.ColorContribution <T L0.Entity
+DN.Diagram.Visualisations.SizeContribution <T L0.Entity
+DN.Diagram.Visualisations.ArrowContribution <T L0.Entity
+
+DN.Diagram.Visualisations.colorContributions <R L0.HasProperty
+DN.Diagram.Visualisations.sizeContributions <R L0.HasProperty
+DN.Diagram.Visualisations.arrowContributions <R L0.HasProperty
+
+DN.Diagram.Visualisations.colorContributionContributorName <R L0.HasProperty
+DN.Diagram.Visualisations.colorContributionLabel <R L0.HasProperty
+DN.Diagram.Visualisations.colorContributionModuleName <R L0.HasProperty
+DN.Diagram.Visualisations.colorContributionModuleAttribute <R L0.HasProperty
+DN.Diagram.Visualisations.colorContributionUnit <R L0.HasProperty
+DN.Diagram.Visualisations.colorContributionVariableGain <R L0.HasProperty
+DN.Diagram.Visualisations.colorContributionVariableBias <R L0.HasProperty
+DN.Diagram.Visualisations.colorContributionDefaultColorMap <R L0.HasProperty
+DN.Diagram.Visualisations.colorContributionDefaultMin <R L0.HasProperty
+DN.Diagram.Visualisations.colorContributionDefaultMax <R L0.HasProperty
+// for graph persistence only
+DN.Diagram.Visualisations.colorContributionUsed <R L0.HasProperty
+DN.Diagram.Visualisations.colorContributionUseDefault <R L0.HasProperty
+
+DN.Diagram.Visualisations.sizeContributionContributorName <R L0.HasProperty
+DN.Diagram.Visualisations.sizeContributionLabel <R L0.HasProperty
+DN.Diagram.Visualisations.sizeContributionModuleName <R L0.HasProperty
+DN.Diagram.Visualisations.sizeContributionModuleAttribute <R L0.HasProperty
+DN.Diagram.Visualisations.sizeContributionUnit <R L0.HasProperty
+DN.Diagram.Visualisations.sizeContributionVariableGain <R L0.HasProperty
+DN.Diagram.Visualisations.sizeContributionVariableBias <R L0.HasProperty
+DN.Diagram.Visualisations.sizeContributionDefaultSizeMap <R L0.HasProperty
+DN.Diagram.Visualisations.sizeContributionDefaultMin <R L0.HasProperty
+DN.Diagram.Visualisations.sizeContributionDefaultMax <R L0.HasProperty
+// for graph persistence only
+DN.Diagram.Visualisations.sizeContributionUsed <R L0.HasProperty
+DN.Diagram.Visualisations.sizeContributionUseDefault <R L0.HasProperty
+
+DN.Diagram.Visualisations.arrowContributionContributorName <R L0.HasProperty
+DN.Diagram.Visualisations.arrowContributionLabel <R L0.HasProperty
+DN.Diagram.Visualisations.arrowContributionModuleName <R L0.HasProperty
+DN.Diagram.Visualisations.arrowContributionModuleAttribute <R L0.HasProperty
+DN.Diagram.Visualisations.arrowContributionVariableGain <R L0.HasProperty
+DN.Diagram.Visualisations.arrowContributionVariableBias <R L0.HasProperty
+// for graph persistence only
+DN.Diagram.Visualisations.arrowContributionUsed <R L0.HasProperty
+DN.Diagram.Visualisations.arrowContributionUseDefault <R L0.HasProperty
+
+// End of dynamic visualisations
 
 DN.AddLayerToDNDiagramTemplate <T L0.Template
 
 DN.EPSG_4326 : DN.SpatialRefSystem
     L0.HasLabel "EPSG:4326"
     DN.HasSRID 4326
-    DN.HasSRTEXT _ : L0.String
-        @L0.loadString "epsg/EPSG_4326"
 
-DN.SpatialRefSystem <T L0.Entity
+DN.SpatialRefSystem <T L0.Property
+    L0.readOnly true
 
-DN.HasSpatialRefSystem <R L0.HasProperty
+DN.HasSpatialRefSystem <R L0.HasProperty : SEL.GenericParameterType
     L0.HasRange DN.SpatialRefSystem
+    L0.HasLabel "Spatial Reference System"
 
 DN.HasSRID <R L0.HasProperty
     L0.HasRange L0.Integer
@@ -244,40 +401,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
@@ -285,115 +409,183 @@ DN.Mapping <T L0.Library
 DN.Functions.convertToValue : L0.ExternalValue
 
 DN.Mapping.Base <T L0.Value
+  >-- DN.Mapping.Id --> L0.String <R L0.HasProperty
+  >-- DN.Mapping.Region --> L0.String <R L0.HasProperty
+  >-- DN.Mapping.ComponentType --> STR.ComponentType <R L0.DependsOn
+  >-- DN.Mapping.Terminals --> DN.Mapping.TerminalPair <R L0.HasProperty
   @L0.assert L0.ConvertsToValueWith DN.Functions.convertToValue
 
+DN.Mapping.HasPropertyRelation <R L0.HasProperty
+
 DN.Mapping.Terminal <T L0.Entity
+    L0.HasRange L0.String
 
-DN.Mapping.TerminalPair <T L0.Entity
+DN.Mapping.TerminalPair <T L0.Property
     >-- DN.Mapping.InputTerminal --> DN.Mapping.Terminal <R L0.HasProperty
     >-- DN.Mapping.OutputTerminal --> DN.Mapping.Terminal <R L0.HasProperty
 
 DN.Mapping.VertexMapping <T DN.Mapping.Base
     // Common
-    >-- DN.Mapping.Id --> L0.String <R L0.HasProperty
-    >-- DN.Mapping.ComponentType --> STR.ComponentType <R L0.DependsOn
     >-- DN.Mapping.VertexMapping.ElevationAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasElevation
+    >-- DN.Mapping.VertexMapping.ElevationAltAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasAltElevation
     >-- DN.Mapping.VertexMapping.SupplyTemperatureAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasSupplyTemperature
     >-- DN.Mapping.VertexMapping.ReturnTemperatureAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasReturnTemperature
     >-- DN.Mapping.VertexMapping.SupplyPressureAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasSupplyPressure
     >-- DN.Mapping.VertexMapping.ReturnPressureAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasReturnPressure
     >-- DN.Mapping.VertexMapping.DeltaPressureAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasDeltaPressure
     >-- DN.Mapping.VertexMapping.DeltaTemperatureAttribute --> L0.String <R L0.HasProperty
-    >-- DN.Mapping.Terminals --> DN.Mapping.TerminalPair <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasDeltaTemperature
+    >-- DN.Mapping.VertexMapping.XAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.YAttribute --> L0.String <R L0.HasProperty
+    >-- DN.Mapping.VertexMapping.DiameterAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasDiameter
     // Production
     >-- DN.Mapping.VertexMapping.dpAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasDeltaPressure
     >-- DN.Mapping.VertexMapping.dtAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasDeltaTemperature
     >-- DN.Mapping.VertexMapping.HeatPowerAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasHeatPower
+    >-- DN.Mapping.VertexMapping.PeakPowerAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasPeakPower
     >-- DN.Mapping.VertexMapping.NominalHeadMAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasNominalHeadM
     >-- DN.Mapping.VertexMapping.NominalHeadBAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasNominalHeadB
     >-- DN.Mapping.VertexMapping.NominalFlowAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasNominalFlow
     >-- DN.Mapping.VertexMapping.MaximumHeadMAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasMaximumHeadM
     // Consumers
     >-- DN.Mapping.VertexMapping.HeatLoadDsAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasHeatLoadDs
+    >-- DN.Mapping.VertexMapping.AddressAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasAddress
     >-- DN.Mapping.VertexMapping.MassFlowAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasMassFlow
     >-- DN.Mapping.VertexMapping.VolFlowAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasVolFlow
     >-- DN.Mapping.VertexMapping.VelocityAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasVelocity
     >-- DN.Mapping.VertexMapping.FlowAreaAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasFlowArea
     >-- DN.Mapping.VertexMapping.ValvePositionAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasValvePosition
     >-- DN.Mapping.VertexMapping.NominalPressureLossAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasNominalPressureLoss
     >-- DN.Mapping.VertexMapping.NominalMassFlowAttribute --> L0.String <R L0.HasProperty
-
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasNominalFlow
+
+    // pumping station
+    >-- DN.Mapping.VertexMapping.HeadPumpMaximumAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasHeadPumpMaximum
+    >-- DN.Mapping.VertexMapping.HeadPumpNominalAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasHeadPumpNominal
+    >-- DN.Mapping.VertexMapping.FrequencyConverterControlledAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasFrequencyConverterControlled
+    >-- DN.Mapping.VertexMapping.InternalValveMeasurementAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasInternalValveMeasurement
+    >-- DN.Mapping.VertexMapping.PumpInSupplyLineAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasPumpInSupplyLine
+    >-- DN.Mapping.VertexMapping.PumpInReturnLineAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasPumpInReturnLine
+    >-- DN.Mapping.VertexMapping.PumpMassFlowNominalAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasPumpMassFlowNominal
+    >-- DN.Mapping.VertexMapping.PumpMeMaxAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasPumpMeMax
+    >-- DN.Mapping.VertexMapping.PumpMeMinAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasPumpMeMin
+    >-- DN.Mapping.VertexMapping.PumpSpeedMaxAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasPumpSpeedMax
+    >-- DN.Mapping.VertexMapping.PumpSpeedMinAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasPumpSpeedMin
+    >-- DN.Mapping.VertexMapping.ValveReturnLineAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasValveReturnLine
+    >-- DN.Mapping.VertexMapping.ValveMeMaxAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasValveMeMax
+    >-- DN.Mapping.VertexMapping.ValveMeMinAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasValveMeMin
+    >-- DN.Mapping.VertexMapping.ValveMinPositionAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasValveMinPosition
+    >-- DN.Mapping.VertexMapping.ValveOutletModeAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasValveOutletMode
+    >-- DN.Mapping.VertexMapping.ValvePressLossNominalAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasValvePressLossNominal
+    >-- DN.Mapping.VertexMapping.PumpSupplyOnAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasPumpSupplyOn
+    >-- DN.Mapping.VertexMapping.PumpReturnOnAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasPumpReturnOn
+    >-- DN.Mapping.VertexMapping.NominalDTAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasNominalDT
+    
+    // valve
+    >-- DN.Mapping.VertexMapping.OpeningTimeAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Vertex.HasOpeningTime
+    
 DN.Mapping.EdgeMapping <T DN.Mapping.Base
-    >-- DN.Mapping.Id
-    >-- DN.Mapping.ComponentType
     >-- DN.Mapping.EdgeMapping.LengthAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Edge.HasLength 
     >-- DN.Mapping.EdgeMapping.DiameterAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Edge.HasDiameter
     >-- DN.Mapping.EdgeMapping.OuterDiameterAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Edge.HasOuterDiameter
     >-- DN.Mapping.EdgeMapping.NominalMassFlowAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Edge.HasNominalMassFlow
     >-- DN.Mapping.EdgeMapping.FlowAreaAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Edge.HasFlowArea
     >-- DN.Mapping.EdgeMapping.KReturnAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Edge.HasKReturn
     >-- DN.Mapping.EdgeMapping.KSupplyAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Edge.HasKSupply
     >-- 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 DIA.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
+        DN.Mapping.HasPropertyRelation DN.Edge.HasTGround
+    >-- DN.Mapping.EdgeMapping.ElevationAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Edge.HasElevation
+    >-- DN.Mapping.EdgeMapping.PipeTypeAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Edge.HasType
+    >-- DN.Mapping.EdgeMapping.PipeCodeAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Edge.HasPipeCode
+    >-- DN.Mapping.EdgeMapping.InstallationYearAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Edge.HasInstallationYear
+    >-- DN.Mapping.EdgeMapping.WallThicknessAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Edge.HasWallThickness
+    >-- DN.Mapping.EdgeMapping.InsulationConductivityAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Edge.HasInsulationConductivity
+    >-- DN.Mapping.EdgeMapping.PipeSizeDNAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Edge.HasPipeSizeDN
+    >-- DN.Mapping.EdgeMapping.RoughnessAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Edge.HasRoughness
+    >-- DN.Mapping.EdgeMapping.StructureAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Edge.HasStructure
+    >-- DN.Mapping.EdgeMapping.InsulationClassAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Edge.HasInsulationClass
+    >-- DN.Mapping.EdgeMapping.ConductanceAttribute --> L0.String <R L0.HasProperty
+        DN.Mapping.HasPropertyRelation DN.Edge.HasConductance
+
+// Allowed connection types
+DN.SupplyConnectionType <T STR.ConnectionType
+
+DN.SupplyInConnectionType : DN.SupplyConnectionType : STR.InputDirection
+    STR.SupportsDirection DN.SupplyOutConnectionType
+    STR.ConnectionType.isUserSelectable true
+
+DN.SupplyOutConnectionType : DN.SupplyConnectionType : STR.OutputDirection
+    STR.SupportsDirection DN.SupplyInConnectionType
+    STR.ConnectionType.isUserSelectable true
+
+DN.ReturnConnectionType <T STR.ConnectionType
+
+DN.ReturnInConnectionType : DN.ReturnConnectionType : STR.InputDirection
+    STR.SupportsDirection DN.ReturnOutConnectionType
+    STR.ConnectionType.isUserSelectable true
+
+DN.ReturnOutConnectionType : DN.ReturnConnectionType : STR.OutputDirection
+    STR.SupportsDirection DN.ReturnInConnectionType
+    STR.ConnectionType.isUserSelectable true