]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.district.network.ontology/graph/DistrictNetwork.pgraph
Added DN.Element as base type for DH diagram elements
[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 DN.Layer <T DIA.Layer
17
18 DN.Element <T DIA.Element : L0.Type
19
20 DN.Edge <T DN.Element
21     @L0.assert DN.Edge.HasDiameter 0.1
22     @L0.assert DN.Edge.HasOuterDiameter 0.11
23
24 DN.Vertex <T DN.Element
25     @L0.assert DN.Vertex.HasElevation 0.0
26
27 DN.EdgeDefaultMapping <R L0.HasProperty : DN.EdgeMappingParameterType
28     L0.HasLabel "Default Edge mapping"
29
30 DN.VertexDefaultMapping <R L0.HasProperty : DN.VertexMappingParameterType
31     L0.HasLabel "Default Vertex mapping"
32
33 DN.Functions : L0.Library
34
35 DN.VertexMappingParameterType <T SEL.GenericParameterType
36   @L0.assert SEL.HasDisplayValue
37     _ : SEL.DisplayValue
38       SEL.HasEnumerationValues DN.Functions.enumerationValues : L0.Function
39       SEL.HasCustomModifier DN.Functions.defaultVertexMappingModifier : L0.Function
40
41 DN.EdgeMappingParameterType <T SEL.GenericParameterType
42   @L0.assert SEL.HasDisplayValue
43     _ : SEL.DisplayValue
44       SEL.HasEnumerationValues DN.Functions.enumerationValues
45       SEL.HasCustomModifier DN.Functions.defaultEdgeMappingModifier : L0.Function
46
47 DN.MappingParameterType <T SEL.GenericParameterType
48   @L0.assert SEL.HasDisplayValue
49     _ : SEL.DisplayValue
50       SEL.HasEnumerationValues DN.Functions.enumerationValues
51       SEL.HasCustomModifier DN.Functions.mappingModifier : L0.Function
52
53 DN.HasMapping <R L0.HasProperty : DN.MappingParameterType
54     L0.HasLabel "Mapping"
55
56 DN.HasId <R L0.HasProperty : SEL.GenericParameterType
57     L0.HasLabel "Id"
58     L0.HasRange L0.String
59     L0.readOnly false
60
61 DN.Vertex.HasElevation <R L0.HasProperty : SEL.GenericParameterType
62     L0.HasLabel "Elevation"
63     L0.HasRange L0.Double
64     L0.readOnly false
65     
66 DN.Vertex.HasAddress <R L0.HasProperty : SEL.GenericParameterType
67     L0.HasLabel "Address"
68     L0.HasRange L0.String
69     L0.readOnly false
70
71 DN.Vertex.HasSupplyTemperature <R L0.HasProperty : SEL.GenericParameterType
72     L0.HasLabel "Supply Temperature"
73     L0.HasRange L0.Double
74     L0.readOnly false
75
76 DN.Vertex.HasReturnTemperature <R L0.HasProperty : SEL.GenericParameterType
77     L0.HasLabel "Return Temperature"
78     L0.HasRange L0.Double
79     L0.readOnly false
80
81 DN.Vertex.HasSupplyPressure <R L0.HasProperty : SEL.GenericParameterType
82     L0.HasLabel "Supply Pressure"
83     L0.HasRange L0.Double
84     L0.readOnly false
85
86 DN.Vertex.HasReturnPressure <R L0.HasProperty : SEL.GenericParameterType
87     L0.HasLabel "Return Pressure"
88     L0.HasRange L0.Double
89     L0.readOnly false
90
91 DN.Vertex.HasDeltaPressure <R L0.HasProperty : SEL.GenericParameterType
92     L0.HasLabel "Delta pressure"
93     L0.HasRange L0.Double
94     L0.readOnly false
95
96 DN.Vertex.HasDeltaTemperature <R L0.HasProperty : SEL.GenericParameterType
97     L0.HasLabel "Delta temperature"
98     L0.HasRange L0.Double
99     L0.readOnly false
100
101 DN.Vertex.HasHeatPower <R L0.HasProperty : SEL.GenericParameterType
102     L0.HasLabel "Heat Power"
103     L0.HasRange L0.Double
104     L0.readOnly false
105
106 DN.Vertex.HasNominalHeadM <R L0.HasProperty : SEL.GenericParameterType
107     L0.HasLabel "NominalHeadM"
108     L0.HasRange L0.Double
109     L0.readOnly false
110
111 DN.Vertex.HasNominalHeadB <R L0.HasProperty : SEL.GenericParameterType
112     L0.HasLabel "NominalHeadB"
113     L0.HasRange L0.Double
114     L0.readOnly false
115
116 DN.Vertex.HasNominalFlow <R L0.HasProperty : SEL.GenericParameterType
117     L0.HasLabel "Nominal Flow"
118     L0.HasRange L0.Double
119     L0.readOnly false
120
121 DN.Vertex.HasMaximumHeadM <R L0.HasProperty : SEL.GenericParameterType
122     L0.HasLabel "Maximum head M"
123     L0.HasRange L0.Double
124     L0.readOnly false
125
126 DN.Vertex.HasHeatLoadDs <R L0.HasProperty : SEL.GenericParameterType
127     L0.HasLabel "Heat Load ds"
128     L0.HasRange L0.Double
129     L0.readOnly false
130
131 DN.Vertex.HasMassFlow <R L0.HasProperty : SEL.GenericParameterType
132     L0.HasLabel "Mass Flow"
133     L0.HasRange L0.Double
134     L0.readOnly false
135
136 DN.Vertex.HasVolFlow <R L0.HasProperty : SEL.GenericParameterType
137     L0.HasLabel "Vol Flow"
138     L0.HasRange L0.Double
139     L0.readOnly false
140
141 DN.Vertex.HasVelocity <R L0.HasProperty : SEL.GenericParameterType
142     L0.HasLabel "Velocity"
143     L0.HasRange L0.Double
144     L0.readOnly false
145
146 DN.Vertex.HasFlowArea <R L0.HasProperty : SEL.GenericParameterType
147     L0.HasLabel "Flow Area"
148     L0.HasRange L0.Double
149     L0.readOnly false
150
151 DN.Vertex.HasValvePosition <R L0.HasProperty : SEL.GenericParameterType
152     L0.HasLabel "Valve position"
153     L0.HasRange L0.Double
154     L0.readOnly false
155
156 DN.Vertex.HasNominalPressureLoss <R L0.HasProperty : SEL.GenericParameterType
157     L0.HasLabel "Nominal Pressure Loss"
158     L0.HasRange L0.Double
159     L0.readOnly false
160
161 DN.Edge.HasLength <R L0.HasProperty : SEL.GenericParameterType
162     L0.HasLabel "Length"
163     L0.HasRange L0.Double
164     L0.readOnly true
165
166 DN.Edge.HasDiameter <R L0.HasProperty : SEL.GenericParameterType
167     L0.HasLabel "Diameter"
168     L0.HasRange L0.Double
169     L0.readOnly false
170
171 DN.Edge.HasOuterDiameter <R L0.HasProperty : SEL.GenericParameterType
172     L0.HasLabel "Outer Diameter"
173     L0.HasRange L0.Double
174     L0.readOnly false
175
176 DN.Edge.HasNominalMassFlow <R L0.HasProperty : SEL.GenericParameterType
177     L0.HasLabel "Nominal Mass Flow"
178     L0.HasRange L0.Double
179     L0.readOnly false
180
181 DN.Edge.HasFlowArea <R L0.HasProperty : SEL.GenericParameterType
182     L0.HasLabel "Flow Area"
183     L0.HasRange L0.Double
184     L0.readOnly false
185
186 DN.Edge.HasKReturn <R L0.HasProperty : SEL.GenericParameterType
187     L0.HasLabel "K Return"
188     L0.HasRange L0.Double
189     L0.readOnly false
190
191 DN.Edge.HasKSupply <R L0.HasProperty : SEL.GenericParameterType
192     L0.HasLabel "K Supply"
193     L0.HasRange L0.Double
194     L0.readOnly false
195
196 DN.Edge.HasTGround <R L0.HasProperty : SEL.GenericParameterType
197     L0.HasLabel "T Ground"
198     L0.HasRange L0.Double
199     L0.readOnly false
200
201 DN.InLayer
202     @L0.defTag 
203     @L0.tag L0.Abstract
204
205 DN.HasInLayerTag <R L0.HasProperty
206     L0.HasRange L0.Tag
207
208 DN.Connection <T DIA.Connection
209
210 // For associating typical diagram source and instance structures with each other
211 DN.Diagram.MappedDiagram <R L0.IsWeaklyRelatedTo
212     L0.InverseOf DN.Diagram.MappedFromDiagram <R L0.IsWeaklyRelatedTo
213 DN.MappedComponent <R L0.IsWeaklyRelatedTo
214     L0.InverseOf DN.MappedFromElement <R L0.IsWeaklyRelatedTo
215
216 DN.Diagram <T DIA.Diagram
217
218 DN.AddLayerToDNDiagramTemplate <T L0.Template
219
220 DN.EPSG_4326 : DN.SpatialRefSystem
221     L0.HasLabel "EPSG:4326"
222     DN.HasSRID 4326
223     DN.HasSRTEXT _ : L0.String
224         @L0.loadString "epsg/EPSG_4326"
225
226 DN.SpatialRefSystem <T L0.Entity
227
228 DN.HasSpatialRefSystem <R L0.HasProperty
229     L0.HasRange DN.SpatialRefSystem
230
231 DN.HasSRID <R L0.HasProperty
232     L0.HasRange L0.Integer
233
234 DN.HasSRTEXT <R L0.HasProperty
235     L0.HasRange L0.String
236
237 DN.Functions.compositeInstantiator : L0.ExternalValue
238
239 DN.Composite <T STR.Composite
240     STR.Composite.instantiationFunction DN.Functions.compositeInstantiator
241     @L0.assert MOD.HasModelingTemplate
242         _ : MOD.DiagramTemplate
243             MOD.HasDiagramType DN.Diagram
244     @L0.assert MOD.HasModelingTemplate
245         _ : DN.AddLayerToDNDiagramTemplate
246
247 DN.HasStartVertex <R L0.DependsOn
248     L0.HasDomain DN.Edge
249     L0.HasRange DN.Vertex
250     L0.InverseOf DN.HasStartVertex_Inverse <R L0.IsRelatedTo
251
252 DN.HasEndVertex <R L0.DependsOn
253     L0.HasDomain DN.Edge
254     L0.HasRange DN.Vertex
255     L0.InverseOf DN.HasEndVertex_Inverse <R L0.IsRelatedTo
256
257 MBC = MOD.ModelingBrowseContext
258
259 DNAC.newDiagramContribution : L0.Template
260     @template %actionContext %label %image %action
261         %actionContext
262             VP.BrowseContext.HasActionContribution _ : VP.ActionContribution
263                 L0.HasLabel %label
264                 VP.ActionContribution.HasImage %image
265                 VP.ActionContribution.HasCategory VP.NewActionCategory
266                 VP.ActionContribution.HasNodeType MBC.Configuration
267                 VP.ActionContribution.HasAction %action
268
269 DNAC = DN.ActionContext : VP.BrowseContext
270     VP.BrowseContext.IsIncludedIn MOD.ModelingActionContext
271     @DNAC.newDiagramContribution "Network Diagram" IMAGES.MapImage ACTIONS.NewDNDiagram
272
273 DNBC = DN.BrowseContext : VP.BrowseContext
274     VP.BrowseContext.IsIncludedIn MOD.ModelingBrowseContext
275     VP.BrowseContext.Includes SEL_UI.StandardPropertiesBase.BrowseContext
276     
277     @VP.customModifierRule    DN.Edge    VP.ResourceLabelModifierRule
278     @VP.constantImageRule     DN.Composite   IMAGES.MapImage
279
280
281 ACTIONS = DN.Actions : L0.Library
282
283 ACTIONS.NewDNDiagram : MOD.NewComposite
284     MOD.NewComposite.HasCompositeType DN.Composite
285     MOD.NewComposite.HasDefaultName "NewNetworkDiagram"
286
287 IMAGES = DN.Images : L0.Library
288
289 IMAGES.MapImage : IMAGE.PngImage
290     @L0.loadBytes "images/map.png"
291
292 // Component MAPPING
293 DN.Mapping <T L0.Library
294
295 DN.Functions.convertToValue : L0.ExternalValue
296
297 DN.Mapping.Base <T L0.Value
298   @L0.assert L0.ConvertsToValueWith DN.Functions.convertToValue
299
300 DN.Mapping.Terminal <T L0.Entity
301
302 DN.Mapping.TerminalPair <T L0.Entity
303     >-- DN.Mapping.InputTerminal --> DN.Mapping.Terminal <R L0.HasProperty
304     >-- DN.Mapping.OutputTerminal --> DN.Mapping.Terminal <R L0.HasProperty
305
306 DN.Mapping.VertexMapping <T DN.Mapping.Base
307     // Common
308     >-- DN.Mapping.Id --> L0.String <R L0.HasProperty
309     >-- DN.Mapping.ComponentType --> STR.ComponentType <R L0.DependsOn
310     >-- DN.Mapping.VertexMapping.ElevationAttribute --> L0.String <R L0.HasProperty
311     >-- DN.Mapping.VertexMapping.SupplyTemperatureAttribute --> L0.String <R L0.HasProperty
312     >-- DN.Mapping.VertexMapping.ReturnTemperatureAttribute --> L0.String <R L0.HasProperty
313     >-- DN.Mapping.VertexMapping.SupplyPressureAttribute --> L0.String <R L0.HasProperty
314     >-- DN.Mapping.VertexMapping.ReturnPressureAttribute --> L0.String <R L0.HasProperty
315     >-- DN.Mapping.VertexMapping.DeltaPressureAttribute --> L0.String <R L0.HasProperty
316     >-- DN.Mapping.VertexMapping.DeltaTemperatureAttribute --> L0.String <R L0.HasProperty
317     >-- DN.Mapping.Terminals --> DN.Mapping.TerminalPair <R L0.HasProperty
318     // Production
319     >-- DN.Mapping.VertexMapping.dpAttribute --> L0.String <R L0.HasProperty
320     >-- DN.Mapping.VertexMapping.dtAttribute --> L0.String <R L0.HasProperty
321     >-- DN.Mapping.VertexMapping.HeatPowerAttribute --> L0.String <R L0.HasProperty
322     >-- DN.Mapping.VertexMapping.NominalHeadMAttribute --> L0.String <R L0.HasProperty
323     >-- DN.Mapping.VertexMapping.NominalHeadBAttribute --> L0.String <R L0.HasProperty
324     >-- DN.Mapping.VertexMapping.NominalFlowAttribute --> L0.String <R L0.HasProperty
325     >-- DN.Mapping.VertexMapping.MaximumHeadMAttribute --> L0.String <R L0.HasProperty
326     // Consumers
327     >-- DN.Mapping.VertexMapping.HeatLoadDsAttribute --> L0.String <R L0.HasProperty
328     >-- DN.Mapping.VertexMapping.AddressAttribute --> L0.String <R L0.HasProperty
329     >-- DN.Mapping.VertexMapping.MassFlowAttribute --> L0.String <R L0.HasProperty
330     >-- DN.Mapping.VertexMapping.VolFlowAttribute --> L0.String <R L0.HasProperty
331     >-- DN.Mapping.VertexMapping.VelocityAttribute --> L0.String <R L0.HasProperty
332     >-- DN.Mapping.VertexMapping.FlowAreaAttribute --> L0.String <R L0.HasProperty
333     >-- DN.Mapping.VertexMapping.ValvePositionAttribute --> L0.String <R L0.HasProperty
334     >-- DN.Mapping.VertexMapping.NominalPressureLossAttribute --> L0.String <R L0.HasProperty
335     >-- DN.Mapping.VertexMapping.NominalMassFlowAttribute --> L0.String <R L0.HasProperty
336
337 DN.Mapping.EdgeMapping <T DN.Mapping.Base
338     >-- DN.Mapping.Id
339     >-- DN.Mapping.ComponentType
340     >-- DN.Mapping.EdgeMapping.LengthAttribute --> L0.String <R L0.HasProperty
341     >-- DN.Mapping.EdgeMapping.DiameterAttribute --> L0.String <R L0.HasProperty
342     >-- DN.Mapping.EdgeMapping.OuterDiameterAttribute --> L0.String <R L0.HasProperty
343     >-- DN.Mapping.EdgeMapping.NominalMassFlowAttribute --> L0.String <R L0.HasProperty
344     >-- DN.Mapping.EdgeMapping.FlowAreaAttribute --> L0.String <R L0.HasProperty
345     >-- DN.Mapping.EdgeMapping.KReturnAttribute --> L0.String <R L0.HasProperty
346     >-- DN.Mapping.EdgeMapping.KSupplyAttribute --> L0.String <R L0.HasProperty
347     >-- DN.Mapping.EdgeMapping.TGroundAttribute --> L0.String <R L0.HasProperty
348     >-- DN.Mapping.Terminals
349
350 DN.SCLMain : L0.SCLModule
351     L0.SCLModule.definition
352         """
353         include "Simantics/District/SCLMain"
354         """
355
356 DN.DistrictProfile : DIA.Profile
357     L0.HasLabel "District Network Profile"
358     DIA.Profile.priority 0.0
359     DIA.HasEntries
360       _ : DIA.Profile
361         @L0.list
362           DN.DistrictProfile.entry
363             L0.HasLabel "Component names"
364             @DIA.groupStyleProfileEntry DN.ComponentNameStyle DN.Groups.ElementGroup
365           DN.DistrictProfile.entry1
366             L0.HasLabel "Id"
367             @DIA.groupStyleProfileEntry DN.ComponentIdStyle DN.Groups.ElementGroup
368           DN.DistrictProfile.entry2
369             L0.HasLabel "Edge Node Styling"
370             @DIA.groupStyleProfileEntry DN.EdgeNodeStyle DN.Groups.ElementGroup
371
372 DN.Groups : L0.Library
373
374 DN.Groups.ElementGroup : DIA.TypeGroup
375   DIA.TypeGroup.HasType DN.Element
376
377 DN.ComponentNameStyle : DIA.ResourceSCLTextGridStyle
378     @MOD.scl DIA.ResourceSCLTextGridStyle.texts 
379         """
380         districtNetworkProfileStyle "http://www.simantics.org/Layer0-1.1/HasName"
381         """
382         "String -> Variable -> <ReadGraph> (String, String, String)"
383     @G2D.fontProperty DIA.TextElement.font "Arial" 30 G2D.FontStyle.normal_font_style
384
385 DN.ComponentIdStyle : DIA.ResourceSCLTextGridStyle
386     @MOD.scl DIA.ResourceSCLTextGridStyle.texts 
387         """
388         districtNetworkProfileStyle "http://www.simantics.org/Layer0-1.1/HasName" 
389         """
390         "String -> Variable -> <ReadGraph> (String, String, String)"
391     @G2D.fontProperty DIA.TextElement.font "Arial" 30 G2D.FontStyle.normal_font_style
392
393 //DN.EdgeNodeGroup : DIA.Group
394
395 //DN.Profiles : L0.Library
396
397 DN.EdgeNodeStyle : DIA.Style
398
399 // Templates
400
401 //groupStyleEntry : L0.Template
402 //    @template %subject %style %group
403 //        %subject : DIA.GroupStyleProfileEntry
404 //            DIA.ProfileEntry.HasStyle %style
405 //            DIA.ProfileEntry.HasGroup %group
406
407
408 //DN.Profiles.EdgeNodeStyle
409 //    L0.HasLabel "Edge Node Style"
410 //    @groupStyleEntry DN.EdgeNodeStyle DN.EdgeNodeGroup