]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.structural.ontology/graph/Structural.pgraph
0393439f6c89781c09b891e83f1b0239122d8451
[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 STR.ConnectionRelation <T L0.Relation
110     @L0.assert L0.SharedRange STR.ConnectionRelation
111     >-- STR.ConnectionRelation.connectionRequired --> L0.Boolean <R L0.HasProperty : L0.FunctionalRelation
112     >-- STR.ConnectionRelation.equivalentConnectionPoint --> STR.ConnectionRelation <R L0.IsRelatedTo
113         L0.InverseOf STR.ConnectionRelation.equivalentConnectionPoint
114     @L0.assert L0.valueAccessor 
115         STR.Functions.connectionValueAccessor : L0.ExternalValue
116             L0.HasValueType "ValueAccessor"
117     @L0.assert L0.domainProperties L0.Functions.standardPropertyDomainProperties
118     @L0.assert L0.domainChildren L0.Functions.standardPropertyDomainChildren            
119
120 STR.SynchronizedRelation <T L0.Relation
121 STR.SynchronizedConnectionRelation <T STR.ConnectionRelation
122 STR.ProvidingConnectionRelation <T STR.ConnectionRelation
123
124 STR.InComposite <R L0X.HasTemplate
125
126
127 // deprecated
128 //IsConnected <R L0.DependsOn : ConnectionRelation
129 //    @L0.tag L0.Abstract
130 //    L0.InverseOf IsConnected
131 /*
132 STR.DirectedConnectionRelation <T STR.ConnectionRelation
133     L0.Asserts _ : L0.Assertion
134       L0.HasPredicate L0.SharedRange
135       L0.HasObject STR.DirectedConnectionRelation
136 */
137 STR.IsConnectedTo <R L0.DependsOn : STR.ConnectionRelation
138     @L0.tag L0.Abstract 
139     L0.InverseOf STR.Connects
140     
141 //// Connection types
142
143 //deprecated
144 STR.SupportsConnectionType <R L0.IsRelatedTo
145     L0.HasRange STR.ConnectionType    
146
147 STR.HasConnectionType <R L0.IsRelatedTo : L0.FunctionalRelation
148     L0.HasRange STR.ConnectionType    
149     
150 STR.ConnectionType <T L0.Entity
151     >-- STR.ConnectionType.isUserSelectable --> "Boolean" <R L0.HasProperty : L0.FunctionalRelation
152     @L0.assert STR.ConnectionType.isUserSelectable false
153     //[STR.HasCardinalityRestriction all STR.CardinalityRestriction]   
154     
155 STR.SupportsDirection <R L0.IsRelatedTo
156     L0.HasRange STR.ConnectionDirection
157
158 STR.ConnectionDirection <T L0.Entity
159
160 STR.InputDirection : STR.ConnectionDirection
161 STR.OutputDirection : STR.ConnectionDirection
162     
163 STR.HasCardinalityRestriction <R L0.IsRelatedTo
164
165 STR.CardinalityRestriction <T L0.Entity
166     //[STR.HasLowerBound card "0..1"]
167     //[STR.HasUpperBound card "0..1"]
168     //[STR.HasConnectionDirection card "0..1"]
169     
170 STR.HasLowerBound <R L0.HasProperty
171 STR.HasUpperBound <R L0.HasProperty
172 STR.HasConnectionDirection <R L0.IsRelatedTo    
173
174 STR.ConnectionJoin <T L0.Entity
175     @L0.property STR.Joins
176 STR.Joins <R L0.DependsOn
177     L0.InverseOf STR.IsJoinedBy <R L0.DependsOn
178         L0.HasDomain STR.Connection
179         L0.HasRange STR.ConnectionJoin
180 STR.HasConnectionJoin <R L0.DependsOn
181     L0.HasDomain STR.Composite
182     L0.HasRange STR.ConnectionJoin
183     L0.InverseOf STR.JoinsComposite <R L0.IsWeaklyRelatedTo
184
185 //// Modeling rules
186
187 STR.ModelingRules <T L0.Entity
188     L0.HasDescription """Defines what can be populated to a composite 
189 and what can be connected. 
190 See <https://www.simantics.org/wiki/index.php/Diagram_ontology>."""
191
192 STR.HasModelingRules <R L0.IsRelatedTo : L0.FunctionalRelation
193     L0.HasDomain STR.Composite
194     L0.HasDomain STR.OrderedComposite
195     L0.HasRange STR.ModelingRules
196     
197 STR.SimpleModelingRules <T STR.ModelingRules
198     @L0.singleProperty STR.HasConnectionType
199     @L0.singleProperty STR.HasAttachmentRelation
200     L0.HasDescription """Modeling rules that allow all connections."""
201 STR.HasAttachmentRelation <R L0.IsRelatedTo : L0.FunctionalRelation
202     L0.HasRange L0.Relation    
203
204 STR.DefaultConnectionType : STR.ConnectionType   
205 STR.DefaultModelingRules : STR.SimpleModelingRules
206     STR.HasConnectionType STR.DefaultConnectionType
207 STR.StandardModelingRules : STR.ModelingRules
208 STR.AllowsConnectionType <R L0.DependsOn
209     L0.HasDomain L0.Relation
210     L0.HasRange STR.ConnectionType
211     L0.InverseOf STR.AllowsConnectionType.Inverse <R L0.IsWeaklyRelatedTo
212 STR.OverridesConnectionType <R L0.DependsOn
213     L0.HasDomain STR.ConnectionType
214     L0.HasRange STR.ConnectionType
215 STR.IsIncludedInConnectionType <R L0.DependsOn
216     L0.HasDomain STR.ConnectionType
217     L0.HasRange STR.ConnectionType
218 STR.DefaultsToConnectionType <R L0.DependsOn : L0.FunctionalRelation
219     <-- L0.Relation
220     --> STR.ConnectionType
221     L0.InverseOf STR.DefaultsToConnectionType.Inverse <R L0.IsWeaklyRelatedTo
222 STR.ConnectionConstraint <T L0.Entity
223 STR.HasConnectionConstraint <R L0.IsRelatedTo
224     L0.HasDomain STR.ConnectionType
225     L0.HasRange STR.ConnectionConstraint    
226
227 // Groups
228
229 STR.BelongsTo <R L0.IsRelatedTo
230     L0.HasRange STR.ComponentGroup
231     L0.InverseOf STR.BelongsToInverse <R L0.IsWeaklyRelatedTo
232 STR.GroupBelongsTo <R L0.IsRelatedTo
233     L0.HasRange STR.GroupSubsumption
234     L0.InverseOf STR.GroupBelongsToInverse <R L0.IsWeaklyRelatedTo
235 STR.ComponentGroup <T L0.Entity
236 STR.GroupSubsumption <T L0.Entity
237     @L0.property STR.HasSubgroup
238     @L0.property STR.BelongsTo
239 STR.HasSubgroup <R L0.IsRelatedTo
240     L0.HasRange STR.ComponentGroup
241
242 // Support for expressions
243 STR.HasExpression <R L0.HasProperty
244     >-- L0.Value 
245     ==> "String" 
246     L0.valueAccessor STR.Functions.expressionValueAccessor : L0.ExternalValue
247     
248 STR.Functions : L0.Library
249
250 STR.Run <T SIMU.Run
251
252 // Removed these changes after r25103 since they cause ManyObjectsForFunctionalRelationException: Functional relation has assertions from multiple inherited types.
253 // problems for domainProperties and possibly valueAccessor too when simply viewing the properties of an instance whose type uses multi-inheritance.
254 // Need a solution for this before enabling.
255 STR.Component
256   @L0.assert L0.domainProperties 
257     STR.Functions.structuralChildDomainProperties : L0.ExternalValue
258       L0.HasValueType "VariableMap"
259   @L0.assert L0.domainChildren 
260     STR.Functions.structuralChildDomainChildren : L0.ExternalValue
261       L0.HasValueType "VariableMap"
262
263 STR.Run
264   @L0.assert L0.domainChildren 
265     STR.Functions.structuralRunDomainChildren : L0.ExternalValue
266       L0.HasValueType "VariableMap"
267
268 STR.Connection
269   @L0.assert L0.domainProperties L0.Functions.standardPropertyDomainProperties
270   @L0.assert L0.domainChildren L0.Functions.standardPropertyDomainChildren
271   @L0.assert L0.valueAccessor 
272     STR.Functions.connectionValueAccessor : L0.ExternalValue
273       L0.HasValueType "ValueAccessor"
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."