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