]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.district.network.ontology/graph/DistrictNetwork.pgraph
Some more added functionality to simantics district editor etc
[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
10 DN = <http://www.simantics.org/DistrictNetwork-1.0> : L0.Ontology
11     @L0.new
12     L0.Ontology.global true
13     L0.HasResourceClass "org.simantics.district.network.ontology.DistrictNetworkResource"
14
15 DN.Layer <T DIA.Layer
16
17 DN.Edge <T DIA.Element : L0.Type
18     @L0.assert DN.HasMapping DN.Mapping.Dummy
19     @L0.assert DN.Bidirectional false
20     @L0.assert DN.Edge.HasDiameter 1
21
22 DN.Vertex <T DIA.Element : L0.Type
23     @L0.assert DN.HasMapping DN.Mapping.Dummy
24     @L0.assert DN.Bidirectional false
25
26 DN.Bidirectional <R L0.HasProperty : SEL.GenericParameterType
27     L0.HasLabel "Is network bidirectional"
28     L0.HasRange L0.Boolean
29     L0.readOnly false
30
31 DN.EdgeDefaultMapping <R L0.HasProperty : DN.EdgeMappingParameterType
32     L0.HasLabel "Default Edge mapping"
33
34 DN.VertexDefaultMapping <R L0.HasProperty : DN.VertexMappingParameterType
35     L0.HasLabel "Default Vertex mapping"
36
37 DN.Functions : L0.Library
38
39 DN.VertexMappingParameterType <T SEL.GenericParameterType
40   @L0.assert SEL.HasDisplayValue
41     _ : SEL.DisplayValue
42       SEL.HasEnumerationValues DN.Functions.enumerationValues : L0.Function
43       SEL.HasCustomModifier DN.Functions.defaultVertexMappingModifier : L0.Function
44
45 DN.EdgeMappingParameterType <T SEL.GenericParameterType
46   @L0.assert SEL.HasDisplayValue
47     _ : SEL.DisplayValue
48       SEL.HasEnumerationValues DN.Functions.enumerationValues
49       SEL.HasCustomModifier DN.Functions.defaultEdgeMappingModifier : L0.Function
50
51 DN.MappingParameterType <T SEL.GenericParameterType
52   @L0.assert SEL.HasDisplayValue
53     _ : SEL.DisplayValue
54       SEL.HasEnumerationValues DN.Functions.enumerationValues
55       SEL.HasCustomModifier DN.Functions.mappingModifier : L0.Function
56
57 DN.HasMapping <R L0.HasProperty : DN.MappingParameterType
58     L0.HasLabel "Mapping"
59
60 DN.Edge.HasDiameter <R L0.HasProperty : SEL.GenericParameterType
61     L0.HasLabel "Diameter"
62     L0.HasRange L0.Double
63     L0.readOnly false
64
65 DN.InLayer
66     @L0.defTag 
67     @L0.tag L0.Abstract
68
69 DN.HasInLayerTag <R L0.HasProperty
70     L0.HasRange L0.Tag
71
72 DN.Connection <T DIA.Connection
73
74 DN.Mapping.Dummy : DN.Mapping.Base
75
76 DN.Diagram <T DIA.Diagram
77     @L0.assert DN.VertexDefaultMapping DN.Mapping.Dummy
78     @L0.assert DN.EdgeDefaultMapping DN.Mapping.Dummy
79
80 DN.AddLayerToDNDiagramTemplate <T L0.Template
81
82 DN.EPSG_4326 <T DN.SpatialRefSystem
83     DN.HasSRID 4326
84     DN.HasSRTEXT _ : L0.String
85         @L0.loadString "epsg/EPSG_4326"
86
87 DN.SpatialRefSystem <T L0.Entity
88
89 DN.HasSpatialRefSystem <R L0.HasProperty
90     L0.HasRange DN.SpatialRefSystem
91
92 DN.HasSRID <R L0.HasProperty
93     L0.HasRange L0.Integer
94
95 DN.HasSRTEXT <R L0.HasProperty
96     L0.HasRange L0.String
97
98 DN.Functions.compositeInstantiator : L0.ExternalValue
99
100 DN.Composite <T STR.Composite
101     STR.Composite.instantiationFunction DN.Functions.compositeInstantiator
102     @L0.assert MOD.HasModelingTemplate
103         _ : MOD.DiagramTemplate
104             MOD.HasDiagramType DN.Diagram
105     @L0.assert MOD.HasModelingTemplate
106         _ : DN.AddLayerToDNDiagramTemplate
107
108 DN.HasStartVertex <R L0.DependsOn
109     L0.HasDomain DN.Edge
110     L0.HasRange DN.Vertex
111     L0.InverseOf DN.HasStartVertex_Inverse <R L0.IsRelatedTo
112
113 DN.HasEndVertex <R L0.DependsOn
114     L0.HasDomain DN.Edge
115     L0.HasRange DN.Vertex
116     L0.InverseOf DN.HasEndVertex_Inverse <R L0.IsRelatedTo
117
118 MBC = MOD.ModelingBrowseContext
119
120 DNAC.newDiagramContribution : L0.Template
121     @template %actionContext %label %image %action
122         %actionContext
123             VP.BrowseContext.HasActionContribution _ : VP.ActionContribution
124                 L0.HasLabel %label
125                 VP.ActionContribution.HasImage %image
126                 VP.ActionContribution.HasCategory VP.NewActionCategory
127                 VP.ActionContribution.HasNodeType MBC.Configuration
128                 VP.ActionContribution.HasAction %action
129
130 DNAC = DN.ActionContext : VP.BrowseContext
131     VP.BrowseContext.IsIncludedIn MOD.ModelingActionContext
132     @DNAC.newDiagramContribution "DN Diagram" IMAGES.ConfigurationFolder ACTIONS.NewDNDiagram
133
134 DNBC = DN.BrowseContext : VP.BrowseContext
135     VP.BrowseContext.IsIncludedIn MOD.ModelingBrowseContext
136     VP.BrowseContext.Includes SEL_UI.StandardPropertiesBase.BrowseContext
137     
138     @VP.customModifierRule    DN.Edge    VP.ResourceLabelModifierRule
139
140
141 ACTIONS = DN.Actions : L0.Library
142
143 ACTIONS.NewDNDiagram : MOD.NewComposite
144     MOD.NewComposite.HasCompositeType DN.Composite
145     MOD.NewComposite.HasDefaultName "NewDNComposite"
146
147 IMAGES = DN.Images : L0.Library
148
149 IMAGES.ConfigurationFolder : IMAGE.PngImage
150     @L0.loadBytes "images/Configuration.png"
151
152 // Component MAPPING
153 DN.Mapping <T L0.Library
154
155 DN.Functions.convertToValue : L0.ExternalValue
156
157 DN.Mapping.Base <T L0.Value
158   @L0.assert L0.ConvertsToValueWith DN.Functions.convertToValue
159
160 DN.Mapping.Terminal <T L0.Entity
161
162 DN.Mapping.TerminalPair <T L0.Entity
163     >-- DN.Mapping.InputTerminal --> DN.Mapping.Terminal <R L0.HasProperty
164     >-- DN.Mapping.OutputTerminal --> DN.Mapping.Terminal <R L0.HasProperty
165
166 DN.Mapping.VertexMapping <T DN.Mapping.Base
167     >-- DN.Mapping.ComponentType --> STR.ComponentType <R L0.DependsOn
168     >-- DN.Mapping.VertexMapping.ElevationAttribute --> L0.String <R L0.HasProperty
169     >-- DN.Mapping.Terminals --> DN.Mapping.TerminalPair <R L0.HasProperty
170
171 DN.Mapping.EdgeMapping <T DN.Mapping.Base
172     >-- DN.Mapping.ComponentType
173     >-- DN.Mapping.EdgeMapping.Bidirectional --> L0.Boolean <R L0.HasProperty
174     >-- DN.Mapping.EdgeMapping.LengthAttribute --> L0.String <R L0.HasProperty
175     >-- DN.Mapping.EdgeMapping.DiameterAttribute --> L0.String <R L0.HasProperty
176     >-- DN.Mapping.Terminals