]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.structural.ontology/graph/Structural.pgraph
Sync git svn branch with SVN repository r33196.
[simantics/platform.git] / bundles / org.simantics.structural.ontology / graph / Structural.pgraph
1 L0 = <http://www.simantics.org/Layer0-1.1>
2 L0X = <http://www.simantics.org/Layer0X-1.1>
3 SIMU = <http://www.simantics.org/Simulation-1.1>
4 ISSUE = <http://www.simantics.org/Issue-1.2>
5 DATATYPE = <http://www.simantics.org/Datatypes-1.1>
6
7 STR = <http://www.simantics.org/Structural-1.2> : L0.Ontology
8     @L0.new
9     L0.HasResourceClass "org.simantics.structural.stubs.StructuralResource2"
10
11 //// Components and types
12
13 STR.Component <T L0.Entity : STR.ComponentType
14     @L0.tag L0.Abstract
15     @L0.property STR.IsConnectedTo
16     @L0.property STR.BelongsTo
17     @L0.property STR.GroupBelongsTo
18     L0.HasDescription "Defines a structure by instantiating some Type."
19
20 STR.ComponentType <T L0.Type    
21     //[IsDefinedBy card "0..1"]
22     L0.HasDescription "Parametric structure that can be instantiated."
23     >-- STR.ComponentType.HasDefaultPropertyRelationType <R L0.IsRelatedTo
24     >-- STR.ComponentType.HasDefaultPropertyValueType <R L0.IsRelatedTo
25     >-- STR.ComponentType.HasDefaultMonitorValueType --> STR.MonitorValueType <R L0.IsRelatedTo
26
27 STR.MonitorValueType <T L0.Entity
28 STR.MonitorValue <T L0.SCLValue : STR.MonitorValueType
29
30 STR.IsDefinedBy <R L0.IsComposedOf : L0.FunctionalRelation
31     L0.HasRange STR.Component
32     L0.InverseOf STR.Defines
33
34 STR.AbstractDefinedComponentType <T STR.ComponentType
35
36 STR.DefinedComponentType <T STR.AbstractDefinedComponentType
37
38 STR.ProceduralComponentType <T STR.AbstractDefinedComponentType
39     >-- STR.ProceduralComponentType.code --> STR.ProceduralComponentTypeCode <R L0.HasProperty : L0.TotalFunction
40     >-- STR.ProceduralComponentType.environment --> L0.SCLValue.Environment <R L0.IsRelatedTo : L0.FunctionalRelation
41
42 STR.ProceduralComponentTypeCode <T L0.String
43
44 //STR.proceduralConnectionPointPath --> L0.String <R L0.HasProperty : L0.FunctionalRelation
45
46 /*
47 STR.HasParameter <R L0.IsRelatedTo
48     L0.HasDomain STR.ComponentType
49     L0.HasRange STR.Variable
50     L0.HasDescription "Denotes that the given relation is a parameter to the Type."
51     L0.InverseOf STR.IsParameterOf <R L0.IsWeaklyRelatedTo
52
53 STR.ConnectionPointDefinition <T L0.PropertyDefinition
54 */
55 //// Specific structures
56
57 STR.Composite <T STR.Component
58 //    [L0.ConsistsOf all Component]
59     L0.HasDescription "A structure defined as a set of other structures."
60     >-- STR.Composite.namingFunction ==> "ComponentNamingStrategy" <R L0.HasProperty : L0.TotalFunction
61     >-- STR.Composite.instantiationFunction ==> "Resource -> String -> Resource -> Resource" <R L0.HasProperty : L0.FunctionalRelation
62         L0.HasDescription "Returns a function (Resource -> String -> Resource -> Resource) that takes the composite type, default name and target container as input and returns the created diagram."
63
64 STR.OrderedComposite <T STR.Component <T L0.OrderedSet
65     // Requirements are not currently expressible
66
67 //// Variables
68 /*
69 STR.Variable <T L0.Entity
70     @L0.tag L0.Abstract
71     @L0.singleProperty STR.Binds
72 */
73 STR.Binds <R L0.IsRelatedTo
74     L0.HasRange L0.Relation
75     L0.InverseOf STR.IsBoundBy <R L0.IsWeaklyRelatedTo
76
77 //// Literal properties
78
79 // Find better name!!!
80 /*
81 STR.LiteralVariable <T STR.Variable
82     //[Binds all VariableRelation]
83
84 STR.VariableRelation <T L0.Relation
85
86 STR.HasVariable <R L0.DependsOn : STR.VariableRelation
87     @L0.tag L0.Abstract
88     L0.InverseOf STR.VariableOf
89
90 STR.Expression <T L0.Entity
91     @L0.tag L0.Abstract
92     L0.HasDescription "Supertype of all value types that are not simple constant values or variables."
93
94 STR.ValueRelation <T L0.FunctionalRelation
95
96 STR.HasValue <R L0.HasProperty : STR.ValueRelation
97     @L0.tag L0.Abstract // can we use the tag for relations?
98     L0.HasDescription "Assigns a value to some parameter."
99 */
100 //// Connections
101
102 STR.Connection <T L0.Entity
103     @L0.property STR.Connects
104     @L0.property STR.IsJoinedBy
105 /*
106 STR.ConnectionVariable <T STR.Variable <T STR.Connection
107     //[STR.Binds all STR.ConnectionRelation]
108 */
109
110 STR.Functions.connectionValueAccessor : L0.ExternalValue
111     L0.HasValueType "ValueAccessor"
112
113 STR.ConnectionRelation <T L0.Relation
114     @L0.assert L0.SharedRange STR.ConnectionRelation
115     >-- STR.ConnectionRelation.connectionRequired --> L0.Boolean <R L0.HasProperty : L0.FunctionalRelation
116     >-- STR.ConnectionRelation.equivalentConnectionPoint --> STR.ConnectionRelation <R L0.IsRelatedTo
117         L0.InverseOf STR.ConnectionRelation.equivalentConnectionPoint
118     @L0.assert L0.valueAccessor STR.Functions.connectionValueAccessor
119     @L0.assert L0.domainProperties L0.Functions.standardPropertyDomainProperties
120     @L0.assert L0.domainChildren L0.Functions.standardPropertyDomainChildren            
121
122 STR.SynchronizedRelation <T L0.Relation
123 STR.SynchronizedConnectionRelation <T STR.ConnectionRelation
124 STR.ProvidingConnectionRelation <T STR.ConnectionRelation
125
126 STR.InComposite <R L0X.HasTemplate
127
128
129 // deprecated
130 //IsConnected <R L0.DependsOn : ConnectionRelation
131 //    @L0.tag L0.Abstract
132 //    L0.InverseOf IsConnected
133 /*
134 STR.DirectedConnectionRelation <T STR.ConnectionRelation
135     L0.Asserts _ : L0.Assertion
136       L0.HasPredicate L0.SharedRange
137       L0.HasObject STR.DirectedConnectionRelation
138 */
139 STR.IsConnectedTo <R L0.DependsOn : STR.ConnectionRelation
140     @L0.tag L0.Abstract 
141     L0.InverseOf STR.Connects
142     
143 //// Connection types
144
145 //deprecated
146 STR.SupportsConnectionType <R L0.IsRelatedTo
147     L0.HasRange STR.ConnectionType    
148
149 STR.HasConnectionType <R L0.IsRelatedTo : L0.FunctionalRelation
150     L0.HasRange STR.ConnectionType    
151     
152 STR.ConnectionType <T L0.Entity
153     >-- STR.ConnectionType.isUserSelectable --> "Boolean" <R L0.HasProperty : L0.FunctionalRelation
154     @L0.assert STR.ConnectionType.isUserSelectable false
155     //[STR.HasCardinalityRestriction all STR.CardinalityRestriction]   
156     
157 STR.SupportsDirection <R L0.IsRelatedTo
158     L0.HasRange STR.ConnectionDirection
159
160 STR.ConnectionDirection <T L0.Entity
161
162 STR.InputDirection : STR.ConnectionDirection
163 STR.OutputDirection : STR.ConnectionDirection
164     
165 STR.HasCardinalityRestriction <R L0.IsRelatedTo
166
167 STR.CardinalityRestriction <T L0.Entity
168     //[STR.HasLowerBound card "0..1"]
169     //[STR.HasUpperBound card "0..1"]
170     //[STR.HasConnectionDirection card "0..1"]
171     
172 STR.HasLowerBound <R L0.HasProperty
173 STR.HasUpperBound <R L0.HasProperty
174 STR.HasConnectionDirection <R L0.IsRelatedTo    
175
176 STR.ConnectionJoin <T L0.Entity
177     @L0.property STR.Joins
178 STR.Joins <R L0.DependsOn
179     L0.InverseOf STR.IsJoinedBy <R L0.DependsOn
180         L0.HasDomain STR.Connection
181         L0.HasRange STR.ConnectionJoin
182 STR.HasConnectionJoin <R L0.DependsOn
183     L0.HasDomain STR.Composite
184     L0.HasRange STR.ConnectionJoin
185     L0.InverseOf STR.JoinsComposite <R L0.IsWeaklyRelatedTo
186
187 //// Modeling rules
188
189 STR.ModelingRules <T L0.Entity
190     L0.HasDescription """Defines what can be populated to a composite 
191 and what can be connected. 
192 See <https://www.simantics.org/wiki/index.php/Diagram_ontology>."""
193
194 STR.HasModelingRules <R L0.IsRelatedTo : L0.FunctionalRelation
195     L0.HasDomain STR.Composite
196     L0.HasDomain STR.OrderedComposite
197     L0.HasRange STR.ModelingRules
198     
199 STR.SimpleModelingRules <T STR.ModelingRules
200     @L0.singleProperty STR.HasConnectionType
201     @L0.singleProperty STR.HasAttachmentRelation
202     L0.HasDescription """Modeling rules that allow all connections."""
203 STR.HasAttachmentRelation <R L0.IsRelatedTo : L0.FunctionalRelation
204     L0.HasRange L0.Relation    
205
206 STR.DefaultConnectionType : STR.ConnectionType   
207 STR.DefaultModelingRules : STR.SimpleModelingRules
208     STR.HasConnectionType STR.DefaultConnectionType
209 STR.StandardModelingRules : STR.ModelingRules
210 STR.AllowsConnectionType <R L0.DependsOn
211     L0.HasDomain L0.Relation
212     L0.HasRange STR.ConnectionType
213     L0.InverseOf STR.AllowsConnectionType.Inverse <R L0.IsWeaklyRelatedTo
214 STR.OverridesConnectionType <R L0.DependsOn
215     L0.HasDomain STR.ConnectionType
216     L0.HasRange STR.ConnectionType
217 STR.IsIncludedInConnectionType <R L0.DependsOn
218     L0.HasDomain STR.ConnectionType
219     L0.HasRange STR.ConnectionType
220 STR.DefaultsToConnectionType <R L0.DependsOn : L0.FunctionalRelation
221     <-- L0.Relation
222     --> STR.ConnectionType
223     L0.InverseOf STR.DefaultsToConnectionType.Inverse <R L0.IsWeaklyRelatedTo
224 STR.ConnectionConstraint <T L0.Entity
225 STR.HasConnectionConstraint <R L0.IsRelatedTo
226     L0.HasDomain STR.ConnectionType
227     L0.HasRange STR.ConnectionConstraint    
228
229 // Groups
230
231 STR.BelongsTo <R L0.IsRelatedTo
232     L0.HasRange STR.ComponentGroup
233     L0.InverseOf STR.BelongsToInverse <R L0.IsWeaklyRelatedTo
234 STR.GroupBelongsTo <R L0.IsRelatedTo
235     L0.HasRange STR.GroupSubsumption
236     L0.InverseOf STR.GroupBelongsToInverse <R L0.IsWeaklyRelatedTo
237 STR.ComponentGroup <T L0.Entity
238 STR.GroupSubsumption <T L0.Entity
239     @L0.property STR.HasSubgroup
240     @L0.property STR.BelongsTo
241 STR.HasSubgroup <R L0.IsRelatedTo
242     L0.HasRange STR.ComponentGroup
243
244 // Support for expressions
245 STR.HasExpression <R L0.HasProperty
246     >-- L0.Value 
247     ==> "String" 
248     L0.valueAccessor STR.Functions.expressionValueAccessor : L0.ExternalValue
249     
250 STR.Functions : L0.Library
251
252 STR.Run <T SIMU.Run
253
254 // Removed these changes after r25103 since they cause ManyObjectsForFunctionalRelationException: Functional relation has assertions from multiple inherited types.
255 // problems for domainProperties and possibly valueAccessor too when simply viewing the properties of an instance whose type uses multi-inheritance.
256 // Need a solution for this before enabling.
257 STR.Component
258   @L0.assert L0.domainProperties 
259     STR.Functions.structuralChildDomainProperties : L0.ExternalValue
260       L0.HasValueType "VariableMap"
261   @L0.assert L0.domainChildren 
262     STR.Functions.structuralChildDomainChildren : L0.ExternalValue
263       L0.HasValueType "VariableMap"
264
265 STR.Run
266   @L0.assert L0.domainChildren 
267     STR.Functions.structuralRunDomainChildren : L0.ExternalValue
268       L0.HasValueType "VariableMap"
269
270 STR.Connection
271   @L0.assert L0.domainProperties L0.Functions.standardPropertyDomainProperties
272   @L0.assert L0.domainChildren L0.Functions.standardPropertyDomainChildren
273   @L0.assert L0.valueAccessor STR.Functions.connectionValueAccessor
274
275 STR.SCLValue <T L0.SCLValue
276   @L0.assert L0.ConvertsToValueWith STR.Functions.computeExpression
277   @L0.assert L0.SCLValue.environment
278     _ : L0.SCLValue.Environment
279       L0.SCLValue.Environment.moduleName "Simantics/All"
280       L0.SCLValue.Environment.namespace ""
281
282 STR.scl : L0.Template
283     @template %subject %property %expression %valueType
284         %subject
285             %property _ : STR.SCLValue
286               L0.SCLValue.expression %expression
287               L0.HasValueType %valueType
288
289 STR.sclValue : L0.Template
290     @template %subject %expression %valueType
291         %subject : STR.SCLValue
292             L0.SCLValue.expression %expression
293             L0.HasValueType %valueType
294
295 STR.InvalidSCLExpressionIssue <T ISSUE.Issue
296
297 STR.Property <T L0.FunctionalRelation <T L0.PropertyRelation
298     @L0.assert STR.HasExpression 
299         _ /* dummy */ : L0.Value
300             L0.HasValueType "String"
301
302 STR.Component
303   L0.HasConstraint STR.ConnectionConstraint : L0.Constraint
304     L0.Constraint.Validator
305       STR.Functions.connectionValidator : L0.Function
306
307 STR.ConnectionConstraint.ErrorIssue
308   @ISSUE.issue ISSUE.Severity.Error
309     STR.Functions.connectionIssueDescription : L0.Function
310       L0.HasValueType "String" 
311   
312 STR.ConnectionConstraint.Source <T ISSUE.Sources.DependencyTracker
313   L0.HasLabel "Structural connection validity"
314   @L0.assert ISSUE.Sources.DependencyTracker.HasType STR.Component
315   @L0.assert ISSUE.Sources.DependencyTracker.HasSearchType STR.Connection
316   @L0.assert ISSUE.Sources.DependencyTracker.HasSearchType STR.ConnectionJoin
317   @L0.assert ISSUE.Sources.DependencyTracker.HasExtension STR.Functions.connectionExtension
318   @L0.assert ISSUE.Sources.DependencyTracker.HasConstraint STR.ConnectionConstraint
319
320 STR.HasJoinClusterSet <R L0.IsComposedOf
321   --> L0.ClusterSet
322   
323 STR.structuralRevision <R L0.HasProperty : L0.FunctionalRelation
324   --> DATATYPE.GUID
325   
326 STR.synchronizedRevision <R L0.HasProperty : L0.FunctionalRelation
327   ==> "Long"             
328   
329 STR.input <R L0.HasProperty : L0.FunctionalRelation
330   ==> "Variable"             
331
332 STR.UserDefinedProperty <T L0.Entity
333
334 STR.ComponentType
335     // This relation is inherited from L0.IsComposedOf because changes in the code
336     // need to be propagated to the component type
337     >-- STR.ComponentType.hasScript --> STR.ComponentTypeScript <R L0.IsComposedOf
338 STR.ComponentTypeScript <T L0.Entity
339     >-- STR.ComponentTypeScript.type --> L0.String <R L0.HasProperty : L0.FunctionalRelation
340     >-- STR.ComponentTypeScript.code --> L0.String <R L0.HasProperty : L0.FunctionalRelation
341
342 STR.ComponentType.Locked
343     @L0.defTag
344     L0.HasDomain STR.ComponentType
345     L0.HasDescription "Indicates that the component type is locked and cannot be opened for editing."