]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.district.network.ontology/graph/DistrictNetwork.pgraph
Fix copy/paste of pumping station
[simantics/district.git] / org.simantics.district.network.ontology / graph / DistrictNetwork.pgraph
1 L0 = <http://www.simantics.org/Layer0-1.1>
2 DIA = <http://www.simantics.org/Diagram-2.2>
3 STR = <http://www.simantics.org/Structural-1.2>
4 MOD = <http://www.simantics.org/Modeling-1.2>
5 VP = <http://www.simantics.org/Viewpoint-1.2>
6 IMAGE = <http://www.simantics.org/Image2-1.2>
7 SEL = <http://www.simantics.org/SelectionView-1.2>
8 SEL_UI = <http://www.simantics.org/SelectionViewUI-1.1>
9 G2D = <http://www.simantics.org/G2D-1.1>
10
11 DN = <http://www.simantics.org/DistrictNetwork-1.0> : L0.Ontology
12     @L0.new
13     L0.Ontology.global true
14     L0.HasResourceClass "org.simantics.district.network.ontology.DistrictNetworkResource"
15
16 // ----------------------------------------------------------------------------
17
18 DN.SCLMain : L0.SCLModule
19     L0.SCLModule.definition
20         """
21 include "Simantics/District/SCLMain"
22 """
23
24 // ----------------------------------------------------------------------------
25
26 defProperty : L0.Template
27     @template %subject %label %range
28         %subject <R L0.HasProperty : SEL.GenericParameterType
29             L0.HasLabel %label : L0.String
30             L0.HasRange %range
31
32 // ----------------------------------------------------------------------------
33
34 DN.Diagram <T DIA.Diagram
35 DN.Layer <T DIA.Layer
36 DN.Connection <T DIA.Connection
37 DN.Element <T DIA.Element : L0.Type
38
39 DN.Vertex <T DN.Element
40     >-- DN.Vertex.HasElevation
41         @defProperty "Elevation" L0.Double
42     >-- DN.Vertex.HasAddress
43         @defProperty "Address" L0.String
44     >-- DN.Vertex.HasSupplyTemperature
45         @defProperty "Supply Temperature" L0.Double 
46     >-- DN.Vertex.HasReturnTemperature 
47         @defProperty "Return Temperature" L0.Double
48     >-- DN.Vertex.HasSupplyPressure
49         @defProperty "Supply Pressure" L0.Double 
50     >-- DN.Vertex.HasReturnPressure
51         @defProperty "Return Pressure" L0.Double 
52     >-- DN.Vertex.HasDeltaPressure
53         @defProperty "Delta pressure" L0.Double 
54     >-- DN.Vertex.HasDeltaTemperature
55         @defProperty "Delta temperature" L0.Double 
56     >-- DN.Vertex.HasHeatPower
57         @defProperty "Heat Power" L0.Double 
58     >-- DN.Vertex.HasNominalHeadM
59         @defProperty "NominalHeadM" L0.Double 
60     >-- DN.Vertex.HasNominalHeadB
61         @defProperty "NominalHeadB" L0.Double 
62     >-- DN.Vertex.HasNominalFlow
63         @defProperty "Nominal Flow" L0.Double 
64     >-- DN.Vertex.HasMaximumHeadM
65         @defProperty "Maximum head M" L0.Double 
66     >-- DN.Vertex.HasHeatLoadDs
67         @defProperty "Heat Load ds" L0.Double 
68     >-- DN.Vertex.HasMassFlow
69         @defProperty "Mass Flow" L0.Double 
70     >-- DN.Vertex.HasVolFlow
71         @defProperty "Vol Flow" L0.Double 
72     >-- DN.Vertex.HasVelocity
73         @defProperty "Velocity" L0.Double 
74     >-- DN.Vertex.HasFlowArea
75         @defProperty "Flow Area" L0.Double 
76     >-- DN.Vertex.HasValvePosition
77         @defProperty "Valve position" L0.Double 
78     >-- DN.Vertex.HasNominalPressureLoss
79         @defProperty "Nominal Pressure Loss" L0.Double
80     >-- DN.Vertex.HasPumpInReturnLine
81         @defProperty "Pump in Return Line" L0.Double
82     >-- DN.Vertex.HasHeadPumpMaximum
83         @defProperty "Head pump maximum" L0.Double
84     >-- DN.Vertex.HasHeadPumpNominal
85         @defProperty "Head pump nominal" L0.Double
86     >-- DN.Vertex.HasFrequencyConverterControlled
87         @defProperty "Frequency Converter Controlled" L0.Double
88     >-- DN.Vertex.HasInternalValveMeasurement
89         @defProperty "Internal Valve Measurement" L0.Double
90     >-- DN.Vertex.HasPumpMassFlowNominal
91         @defProperty "Pump Mass Flow Nominal" L0.Double
92     >-- DN.Vertex.HasPumpMeMax
93         @defProperty "Pump Me Max" L0.Double
94     >-- DN.Vertex.HasPumpMeMin
95         @defProperty "Pump Me Min" L0.Double
96     >-- DN.Vertex.HasPumpSpeedMax
97         @defProperty "Pump Speed Max" L0.Double
98     >-- DN.Vertex.HasPumpSpeedMin
99         @defProperty "Pump Speed Min" L0.Double
100     >-- DN.Vertex.HasValveReturnLine
101         @defProperty "Valve Return Line" L0.Double
102     >-- DN.Vertex.HasValveMeMax
103         @defProperty "Valve Me Max" L0.Double
104     >-- DN.Vertex.HasValveMeMin
105         @defProperty "Valve Me Min" L0.Double
106     >-- DN.Vertex.HasValveMinPosition
107         @defProperty "Valve Min Position" L0.Double
108     >-- DN.Vertex.HasValveOutletMode
109         @defProperty "Valve Outlet Mode" L0.Double
110     >-- DN.Vertex.HasValvePressLossNominal
111         @defProperty "Valve Press Loss Nominal" L0.Double
112     >-- DN.Vertex.HasOpeningTime 
113         @defProperty "Opening Time" L0.Double
114     @L0.assert DN.Vertex.HasElevation 0.0
115
116 DN.Edge <T DN.Element
117     >-- DN.Edge.HasElevation
118         @defProperty "Elevation" L0.Double
119     >-- DN.Edge.HasLength 
120         @defProperty "Length" L0.Double
121         L0.readOnly true
122     >-- DN.Edge.HasGeometry
123         @defProperty "Detailed Geometry" L0.DoubleArray
124     >-- DN.Edge.HasDiameter
125         @defProperty "Diameter" L0.Double
126     >-- DN.Edge.HasOuterDiameter
127         @defProperty "Outer Diameter" L0.Double
128     >-- DN.Edge.HasNominalMassFlow
129         @defProperty "Nominal Mass Flow" L0.Double
130     >-- DN.Edge.HasFlowArea
131         @defProperty "Flow Area" L0.Double
132     >-- DN.Edge.HasKReturn
133         @defProperty "K Return" L0.Double
134     >-- DN.Edge.HasKSupply
135         @defProperty "K Supply" L0.Double
136     >-- DN.Edge.HasTGround
137         @defProperty "T Ground" L0.Double
138     @L0.assert DN.Edge.HasDiameter 0.1
139     @L0.assert DN.Edge.HasOuterDiameter 0.11
140
141 // ----------------------------------------------------------------------------
142
143 DN.EdgeDefaultMapping <R L0.HasProperty : DN.EdgeMappingParameterType
144     L0.HasLabel "Default Edge mapping"
145
146 DN.VertexDefaultMapping <R L0.HasProperty : DN.VertexMappingParameterType
147     L0.HasLabel "Default Vertex mapping"
148
149 DN.RightClickDefaultMapping <R L0.HasProperty : DN.VertexMappingParameterType
150     L0.HasLabel "Right click Vertex mapping"
151
152 DN.LeftClickDefaultMapping <R L0.HasProperty : DN.VertexMappingParameterType
153     L0.HasLabel "Left click Vertex mapping"
154
155 // ----------------------------------------------------------------------------
156
157 DN.Functions : L0.Library
158
159 DN.VertexMappingParameterType <T SEL.GenericParameterType
160   @L0.assert SEL.HasDisplayValue
161     _ : SEL.DisplayValue
162       SEL.HasEnumerationValues DN.Functions.enumerationValues : L0.Function
163       SEL.HasCustomModifier DN.Functions.defaultVertexMappingModifier : L0.Function
164
165 DN.EdgeMappingParameterType <T SEL.GenericParameterType
166   @L0.assert SEL.HasDisplayValue
167     _ : SEL.DisplayValue
168       SEL.HasEnumerationValues DN.Functions.enumerationValues
169       SEL.HasCustomModifier DN.Functions.defaultEdgeMappingModifier : L0.Function
170
171 DN.MappingParameterType <T SEL.GenericParameterType
172   @L0.assert SEL.HasDisplayValue
173     _ : SEL.DisplayValue
174       SEL.HasEnumerationValues DN.Functions.enumerationValues
175       SEL.HasCustomModifier DN.Functions.mappingModifier : L0.Function
176
177 // ----------------------------------------------------------------------------
178
179 DN.HasMapping <R L0.HasProperty : DN.MappingParameterType
180     L0.HasLabel "Mapping"
181
182 DN.HasId --> L0.String <R L0.HasProperty : SEL.GenericParameterType
183     L0.HasLabel "Id"
184     L0.readOnly false
185
186 DN.InLayer
187     @L0.defTag 
188     @L0.tag L0.Abstract
189
190 DN.HasInLayerTag <R L0.HasProperty
191     L0.HasRange L0.Tag
192
193 // For associating typical diagram source and instance structures with each other
194 DN.Diagram.MappedDiagram <R L0.IsWeaklyRelatedTo
195     L0.InverseOf DN.Diagram.MappedFromDiagram <R L0.IsWeaklyRelatedTo
196 DN.MappedComponent <R L0.IsWeaklyRelatedTo
197     L0.InverseOf DN.MappedFromElement <R L0.IsWeaklyRelatedTo
198
199 DN.Diagram.trackChangesEnabled <R L0.HasProperty : SEL.GenericParameterType
200     L0.HasRange L0.Boolean
201     L0.HasLabel "Track changes"
202
203 DN.Diagram.splitToMultipleEnabled <R L0.HasProperty : SEL.GenericParameterType
204     L0.HasRange L0.Boolean
205     L0.HasLabel "Split To Multiple Diagrams"
206
207 DN.AddLayerToDNDiagramTemplate <T L0.Template
208
209 DN.EPSG_4326 : DN.SpatialRefSystem
210     L0.HasLabel "EPSG:4326"
211     DN.HasSRID 4326
212
213 DN.SpatialRefSystem <T L0.Property
214     L0.readOnly true
215
216 DN.HasSpatialRefSystem <R L0.HasProperty : SEL.GenericParameterType
217     L0.HasRange DN.SpatialRefSystem
218     L0.HasLabel "Spatial Reference System"
219
220 DN.HasSRID <R L0.HasProperty
221     L0.HasRange L0.Integer
222
223 DN.HasSRTEXT <R L0.HasProperty
224     L0.HasRange L0.String
225
226 DN.Functions.compositeInstantiator : L0.ExternalValue
227
228 DN.Composite <T STR.Composite
229     STR.Composite.instantiationFunction DN.Functions.compositeInstantiator
230     @L0.assert MOD.HasModelingTemplate
231         _ : MOD.DiagramTemplate
232             MOD.HasDiagramType DN.Diagram
233     @L0.assert MOD.HasModelingTemplate
234         _ : DN.AddLayerToDNDiagramTemplate
235
236 DN.HasStartVertex <R L0.DependsOn
237     L0.HasDomain DN.Edge
238     L0.HasRange DN.Vertex
239     L0.InverseOf DN.HasStartVertex_Inverse <R L0.IsRelatedTo
240
241 DN.HasEndVertex <R L0.DependsOn
242     L0.HasDomain DN.Edge
243     L0.HasRange DN.Vertex
244     L0.InverseOf DN.HasEndVertex_Inverse <R L0.IsRelatedTo
245
246 // ----------------------------------------------------------------------------
247
248 // Component MAPPING
249 DN.Mapping <T L0.Library
250
251 DN.Functions.convertToValue : L0.ExternalValue
252
253 DN.Mapping.Base <T L0.Value
254   >-- DN.Mapping.Id --> L0.String <R L0.HasProperty
255   >-- DN.Mapping.ComponentType --> STR.ComponentType <R L0.DependsOn
256   >-- DN.Mapping.Terminals --> DN.Mapping.TerminalPair <R L0.HasProperty
257   @L0.assert L0.ConvertsToValueWith DN.Functions.convertToValue
258
259 DN.Mapping.Terminal <T L0.Entity
260     L0.HasRange L0.String
261
262 DN.Mapping.TerminalPair <T L0.Property
263     >-- DN.Mapping.InputTerminal --> DN.Mapping.Terminal <R L0.HasProperty
264     >-- DN.Mapping.OutputTerminal --> DN.Mapping.Terminal <R L0.HasProperty
265
266 DN.Mapping.VertexMapping <T DN.Mapping.Base
267     // Common
268     >-- DN.Mapping.VertexMapping.ElevationAttribute --> L0.String <R L0.HasProperty
269     >-- DN.Mapping.VertexMapping.SupplyTemperatureAttribute --> L0.String <R L0.HasProperty
270     >-- DN.Mapping.VertexMapping.ReturnTemperatureAttribute --> L0.String <R L0.HasProperty
271     >-- DN.Mapping.VertexMapping.SupplyPressureAttribute --> L0.String <R L0.HasProperty
272     >-- DN.Mapping.VertexMapping.ReturnPressureAttribute --> L0.String <R L0.HasProperty
273     >-- DN.Mapping.VertexMapping.DeltaPressureAttribute --> L0.String <R L0.HasProperty
274     >-- DN.Mapping.VertexMapping.DeltaTemperatureAttribute --> L0.String <R L0.HasProperty
275     >-- DN.Mapping.VertexMapping.XAttribute --> L0.String <R L0.HasProperty
276     >-- DN.Mapping.VertexMapping.YAttribute --> L0.String <R L0.HasProperty
277     // Production
278     >-- DN.Mapping.VertexMapping.dpAttribute --> L0.String <R L0.HasProperty
279     >-- DN.Mapping.VertexMapping.dtAttribute --> L0.String <R L0.HasProperty
280     >-- DN.Mapping.VertexMapping.HeatPowerAttribute --> L0.String <R L0.HasProperty
281     >-- DN.Mapping.VertexMapping.NominalHeadMAttribute --> L0.String <R L0.HasProperty
282     >-- DN.Mapping.VertexMapping.NominalHeadBAttribute --> L0.String <R L0.HasProperty
283     >-- DN.Mapping.VertexMapping.NominalFlowAttribute --> L0.String <R L0.HasProperty
284     >-- DN.Mapping.VertexMapping.MaximumHeadMAttribute --> L0.String <R L0.HasProperty
285     // Consumers
286     >-- DN.Mapping.VertexMapping.HeatLoadDsAttribute --> L0.String <R L0.HasProperty
287     >-- DN.Mapping.VertexMapping.AddressAttribute --> L0.String <R L0.HasProperty
288     >-- DN.Mapping.VertexMapping.MassFlowAttribute --> L0.String <R L0.HasProperty
289     >-- DN.Mapping.VertexMapping.VolFlowAttribute --> L0.String <R L0.HasProperty
290     >-- DN.Mapping.VertexMapping.VelocityAttribute --> L0.String <R L0.HasProperty
291     >-- DN.Mapping.VertexMapping.FlowAreaAttribute --> L0.String <R L0.HasProperty
292     >-- DN.Mapping.VertexMapping.ValvePositionAttribute --> L0.String <R L0.HasProperty
293     >-- DN.Mapping.VertexMapping.NominalPressureLossAttribute --> L0.String <R L0.HasProperty
294     >-- DN.Mapping.VertexMapping.NominalMassFlowAttribute --> L0.String <R L0.HasProperty
295
296     // pumping station
297     >-- DN.Mapping.VertexMapping.HeadPumpMaximumAttribute --> L0.String <R L0.HasProperty
298     >-- DN.Mapping.VertexMapping.HeadPumpNominalAttribute --> L0.String <R L0.HasProperty
299     >-- DN.Mapping.VertexMapping.FrequencyConverterControlledAttribute --> L0.String <R L0.HasProperty
300     >-- DN.Mapping.VertexMapping.InternalValveMeasurementAttribute --> L0.String <R L0.HasProperty
301     >-- DN.Mapping.VertexMapping.PumpInReturnLineAttribute --> L0.String <R L0.HasProperty
302     >-- DN.Mapping.VertexMapping.PumpMassFlowNominalAttribute --> L0.String <R L0.HasProperty
303     >-- DN.Mapping.VertexMapping.PumpMeMaxAttribute --> L0.String <R L0.HasProperty
304     >-- DN.Mapping.VertexMapping.PumpMeMinAttribute --> L0.String <R L0.HasProperty
305     >-- DN.Mapping.VertexMapping.PumpSpeedMaxAttribute --> L0.String <R L0.HasProperty
306     >-- DN.Mapping.VertexMapping.PumpSpeedMinAttribute --> L0.String <R L0.HasProperty
307     >-- DN.Mapping.VertexMapping.ValveReturnLineAttribute --> L0.String <R L0.HasProperty
308     >-- DN.Mapping.VertexMapping.ValveMeMaxAttribute --> L0.String <R L0.HasProperty
309     >-- DN.Mapping.VertexMapping.ValveMeMinAttribute --> L0.String <R L0.HasProperty
310     >-- DN.Mapping.VertexMapping.ValveMinPositionAttribute --> L0.String <R L0.HasProperty
311     >-- DN.Mapping.VertexMapping.ValveOutletModeAttribute --> L0.String <R L0.HasProperty
312     >-- DN.Mapping.VertexMapping.ValvePressLossNominalAttribute --> L0.String <R L0.HasProperty
313
314     // valve
315     >-- DN.Mapping.VertexMapping.OpeningTimeAttribute --> L0.String <R L0.HasProperty
316     
317 DN.Mapping.EdgeMapping <T DN.Mapping.Base
318     >-- DN.Mapping.EdgeMapping.LengthAttribute --> L0.String <R L0.HasProperty
319     >-- DN.Mapping.EdgeMapping.DiameterAttribute --> L0.String <R L0.HasProperty
320     >-- DN.Mapping.EdgeMapping.OuterDiameterAttribute --> L0.String <R L0.HasProperty
321     >-- DN.Mapping.EdgeMapping.NominalMassFlowAttribute --> L0.String <R L0.HasProperty
322     >-- DN.Mapping.EdgeMapping.FlowAreaAttribute --> L0.String <R L0.HasProperty
323     >-- DN.Mapping.EdgeMapping.KReturnAttribute --> L0.String <R L0.HasProperty
324     >-- DN.Mapping.EdgeMapping.KSupplyAttribute --> L0.String <R L0.HasProperty
325     >-- DN.Mapping.EdgeMapping.TGroundAttribute --> L0.String <R L0.HasProperty
326     >-- DN.Mapping.EdgeMapping.ElevationAttribute --> L0.String <R L0.HasProperty
327
328
329 // Allowed connection types
330 DN.SupplyConnectionType <T STR.ConnectionType
331
332 DN.SupplyInConnectionType : DN.SupplyConnectionType : STR.InputDirection
333     STR.SupportsDirection DN.SupplyOutConnectionType
334     STR.ConnectionType.isUserSelectable true
335
336 DN.SupplyOutConnectionType : DN.SupplyConnectionType : STR.OutputDirection
337     STR.SupportsDirection DN.SupplyInConnectionType
338     STR.ConnectionType.isUserSelectable true
339
340 DN.ReturnConnectionType <T STR.ConnectionType
341
342 DN.ReturnInConnectionType : DN.ReturnConnectionType : STR.InputDirection
343     STR.SupportsDirection DN.ReturnOutConnectionType
344     STR.ConnectionType.isUserSelectable true
345
346 DN.ReturnOutConnectionType : DN.ReturnConnectionType : STR.OutputDirection
347     STR.SupportsDirection DN.ReturnInConnectionType
348     STR.ConnectionType.isUserSelectable true