]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.diagram.ontology/graph/Diagram.pgraph
b26bfc698ee214ac9040b7228d2fe0a13c59b334
[simantics/platform.git] / bundles / org.simantics.diagram.ontology / graph / Diagram.pgraph
1 L0 = <http://www.simantics.org/Layer0-1.1>
2 L0X = <http://www.simantics.org/Layer0X-1.1>
3 G2D = <http://www.simantics.org/G2D-1.1>
4 STR = <http://www.simantics.org/Structural-1.2>
5 DATA = <http://www.simantics.org/Datatypes-1.1>
6 SEL = <http://www.simantics.org/SelectionView-1.2>
7
8 DIA = <http://www.simantics.org/Diagram-2.2> : L0.Ontology
9     @L0.new
10     L0.HasResourceClass "org.simantics.diagram.stubs.DiagramResource"
11
12 DIA.SCLMain : L0.SCLModule
13     L0.SCLModule.definition """
14         include "Simantics/Diagram/Internal/DiagramOntologyEntryPoint"
15         """
16
17 //// Import / Export
18
19 DIA.DiagramSubgraphExtent : L0X.SubgraphExtent
20
21 //// Objects and types
22
23 DIA.ElementClass <T STR.ComponentType
24     L0.HasDescription """Abstract element that has a position on diagram"""
25     @L0.tag L0.Abstract
26     //TODO [STR.IsDefinedBy all Element]
27
28 DIA.Element <T STR.Component : DIA.ElementClass
29     @L0.property L0.HasNext
30     @L0.property L0.HasPrevious
31     @L0.tag L0.Abstract 
32     >-- DIA.HasTransform
33     @L0.assert DIA.HasDynamicTransform
34         DIA.Functions.modelledTransform : L0.Function
35     @L0.assert DIA.Element.profileMonitorOffset
36         (0.0,0.0) : DATA.Vec2d
37     @L0.assert DIA.Element.profileMonitorSpacing 0.0
38     @L0.assert DIA.Element.hideProfileMonitors false
39     @L0.assert DIA.Element.upProfileMonitors true
40     >-- DIA.Element.profileMonitorOffset --> DATA.Vec2d <R L0.HasProperty : L0.FunctionalRelation  : SEL.GenericParameterType
41       L0.HasLabel "Profile Monitor Offset"
42       SEL.HasDisplayValue ""
43     >-- DIA.Element.profileMonitorSpacing --> L0.Double <R L0.HasProperty : L0.FunctionalRelation  : SEL.GenericParameterType
44       L0.HasLabel "Profile Monitor Spacing"
45     >-- DIA.Element.hideProfileMonitors --> L0.Boolean <R L0.HasProperty : L0.FunctionalRelation  : SEL.GenericParameterType
46       L0.HasLabel "Hide Profile Monitors?"
47     >-- DIA.Element.upProfileMonitors --> L0.Boolean <R L0.HasProperty : L0.FunctionalRelation : SEL.GenericParameterType
48       L0.HasLabel "Grow Profile Monitors Upward?"
49     
50 DIA.symbolFunction <R L0.HasProperty : L0.FunctionalRelation
51
52 DIA.DiagramContainer <T L0.Entity
53     @L0.singleProperty L0.HasName
54     @L0.property L0.ConsistsOf
55
56 DIA.Composite <T STR.OrderedComposite <T DIA.Element
57     L0.HasDescription """A diagram composite is z-ordered. First elements in the list are drawn first."""
58     //TODO [L0.OrderedSetElements all Element]
59
60 DIA.IOTableRename <T L0.Entity
61     >-- DIA.IOTableRename.From --> L0.String <R L0.HasProperty : L0.FunctionalRelation
62     >-- DIA.IOTableRename.To --> L0.String <R L0.HasProperty : L0.FunctionalRelation
63     @L0.assert DIA.IOTableRename.From
64         "" : L0.String
65     @L0.assert DIA.IOTableRename.To
66         "" : L0.String
67
68 DIA.Diagram <T DIA.Composite
69     >-- DIA.Diagram.IOTableRenaming --> DIA.IOTableRename <T L0.DependsOn 
70     @L0.optionalProperty DIA.HasModCount
71
72 DIA.HasModCount <R L0.HasProperty : L0.FunctionalRelation
73     L0.HasLabel "Modification Counter"
74     L0.HasDescription "A counter for modifications performed on the property owner resource. Used for naming elements with running number IDs."
75     L0.HasDomain DIA.Composite
76     L0.HasRange L0.Long
77
78 DIA.Terminal <T DIA.Element
79     @L0.singleProperty DIA.HasConnectionPoint
80     @L0.tag L0.Abstract
81     >-- DIA.Terminal.AllowedDirections --> L0.Integer <R L0.HasProperty : L0.FunctionalRelation
82         L0.HasDescription """Used to describe allowed terminal exit/enter directions for incoming/outgoing connections.
83 The integer value is a bit mask with the following meanings:
84 bit  meaning
85 0    right (1,0)
86 1    down  (0,1)
87 2    left  (-1,0)
88 3    up    (0,-1)
89 """
90
91 DIA.DefinedElement <T DIA.Element
92     @L0.tag L0.Abstract
93     @L0.singleProperty STR.IsDefinedBy
94
95 DIA.HasTransform <R G2D.HasTransform   : SEL.GenericParameterType
96     L0.HasLabel "Transform"
97     L0.InverseOf DIA.IsTransformOf
98     L0.HasDomain DIA.Element
99     L0.HasRange G2D.Transform
100     L0.HasRange L0.DoubleArray
101     ==> "Vector Double"
102     SEL.HasDisplayValue ""
103
104 DIA.HasDynamicTransform <R L0.HasProperty : L0.FunctionalRelation
105     L0.HasDomain DIA.Element
106     L0.HasRange L0.Value
107
108 DIA.HasConnectionPoint <R L0.DependsOn
109     L0.HasDomain DIA.Element
110     L0.HasRange STR.ConnectionRelation
111
112 DIA.Functions : L0.Library
113
114 DIA.Functions.availableProfiles : L0.Function
115     L0.HasValueType "[(String, Resource)]"
116 DIA.Functions.selectedProfile : L0.Function
117     L0.HasValueType "String"
118 DIA.Functions.activeProfileModifier : L0.Function
119     L0.HasValueType "String -> String"
120 DIA.Functions.diagramElementIssuePath : L0.Function
121
122 DIA.DefinedElement.Parameter <T L0.PropertyRelation <T L0.FunctionalRelation
123
124 DIA.DefinedElement
125   // RequiresValueType ]is omitted during transition period.
126   // Used to be ==> "[String]" but DIA.symbolCode now returns either "[String]" or "[G2DNodeModification]" directly
127   >-- DIA.symbolCode <R L0.HasProperty : L0.FunctionalRelation
128   >-- DIA.symbolDropHandler ==> "[WorkbenchSelectionElement] -> <WriteGraph,Proc> ()" <R L0.HasProperty : L0.FunctionalRelation
129   // Parameters are id of edited element and new text.
130   >-- DIA.DefinedElement.textEditor ==> "SVGMeasurementContext -> String -> String -> <Proc> ()" <R L0.HasProperty : DIA.DefinedElement.Parameter
131   // This function gives initial text for the text editor. Parameter is the id of the edited element.
132   >-- DIA.DefinedElement.textEditorFullText ==> "String -> <Proc> String" <R L0.HasProperty : DIA.DefinedElement.Parameter 
133
134 DIA.DiagramActivityCondition <T L0.Entity
135   --> DIA.DiagramActivityCondition.test ==> "Resource -> <ReadGraph> String" <R L0.HasProperty : L0.FunctionalRelation 
136
137 DIA.diagramActivityCondition : L0.Template
138     @template %subject %expression
139         %subject : DIA.DiagramActivityCondition
140             DIA.DiagramActivityCondition.test _ : STR.SCLValue
141                 L0.SCLValue.expression %expression
142                 L0.HasValueType "Resource -> <ReadGraph> String"
143
144 DIA.ProfileEntryContribution <T L0.Entity
145   --> DIA.ProfileEntryContribution.HasEntry --> DIA.ProfileEntry <R L0.IsRelatedTo  
146