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