--- /dev/null
+L0 = <http://www.simantics.org/Layer0-1.1>
+STR = <http://www.simantics.org/Structural-1.2>
+DOC = <http://www.simantics.org/Documentation-1.2>
+RELATIONS = <http://www.simantics.org/Documentation-1.2/Relations>
+G2D = <http://www.simantics.org/G2D-1.1>
+DIA = <http://www.simantics.org/Diagram-2.2>
+MOD = <http://www.simantics.org/Modeling-1.2>
+
+
+/*** Structure connections ***/
+DOC.Document.ChildRelation <T STR.ConnectionRelation
+ >-- DOC.Document.ChildRelation.ordinal --> L0.String <R L0.HasProperty
+
+DOC.Document.IsConnectedToChild <R STR.IsConnectedTo : DOC.Document.ChildRelation
+
+DOC.ConnectionType : STR.ConnectionType
+ G2D.HasColor [0.8,0.64,0.0] : G2D.Color
+ G2D.HasStrokeType G2D.StrokeType.Scaling
+ G2D.HasStroke _ : G2D.Stroke
+ G2D.HasStrokeWidth 0.2 : L0.Float
+ G2D.HasLineCap G2D.LineCap.ButtCap
+ G2D.HasLineJoin G2D.LineJoin.MiterJoin
+ STR.HasConnectionConstraint
+ DOC.ParentToChildConstraint : DOC.RelationTypeConstraint
+ DOC.RelationTypeConstraint.Type1 RELATIONS.parentRelation
+ DOC.RelationTypeConstraint.Type2 RELATIONS.childRelation
+ DOC.NoSelfConnectionConstraint
+
+DOC.RelationTypeConstraint <T STR.ConnectionConstraint
+ L0.HasDescription """Ensures that connections are type1-type2 or type2-type1."""
+ >-- DOC.RelationTypeConstraint.Type1 --> STR.ConnectionRelation <R L0.HasProperty : L0.FunctionalRelation
+ >-- DOC.RelationTypeConstraint.Type2 --> STR.ConnectionRelation <R L0.HasProperty : L0.FunctionalRelation
+
+DOC.NoSelfConnectionConstraint : STR.ConnectionConstraint
+ L0.HasDescription """Ensures that elements cannot connect to themselves"""
+
+
+defChildConnectionPoint : L0.Template
+ @template %subject %ordinal
+ %subject <R DOC.Document.IsConnectedToChild
+ DOC.Document.ChildRelation.ordinal %ordinal
+
+RELATIONS.parentRelation <T L0.FunctionalRelation <T STR.ConnectionRelation
+ @L0.assert STR.AllowsConnectionType DOC.ConnectionType
+ @L0.assert MOD.ConnectionRelationToTerminal DOC.Terminals.ParentTerminal
+ @L0.assert STR.HasAttachmentRelation DIA.HasPlainConnector
+
+RELATIONS.childRelation <T STR.ConnectionRelation
+ @L0.assert STR.AllowsConnectionType DOC.ConnectionType
+ @L0.assert MOD.ConnectionRelationToTerminal DOC.Terminals.ChildTerminal
+ @L0.assert STR.HasAttachmentRelation DIA.HasArrowConnector
+
+RELATIONS.functionalChildRelation <T RELATIONS.childRelation <T L0.FunctionalRelation
+
+RELATIONS.parent : RELATIONS.parentRelation <R STR.IsConnectedTo
+
+RELATIONS.part1 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "1"
+RELATIONS.part2 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "2"
+RELATIONS.part3 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "3"
+RELATIONS.part4 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "4"
+RELATIONS.part5 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "5"
+RELATIONS.part6 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "6"
+RELATIONS.part7 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "7"
+RELATIONS.part8 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "8"
+RELATIONS.part9 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "9"
+RELATIONS.part10 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "10"
+
+RELATIONS.part11 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "11"
+RELATIONS.part12 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "12"
+RELATIONS.part13 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "13"
+RELATIONS.part14 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "14"
+RELATIONS.part15 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "15"
+RELATIONS.part16 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "16"
+RELATIONS.part17 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "17"
+RELATIONS.part18 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "18"
+RELATIONS.part19 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "19"
+RELATIONS.part20 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "20"
+RELATIONS.part21 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "21"
+RELATIONS.part22 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "22"
+RELATIONS.part23 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "23"
+RELATIONS.part24 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "24"
+RELATIONS.part25 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "25"
+RELATIONS.part26 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "26"
+RELATIONS.part27 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "27"
+RELATIONS.part28 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "28"
+RELATIONS.part29 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "29"
+RELATIONS.part30 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "30"
+RELATIONS.part31 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "31"
+RELATIONS.part32 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "32"
+RELATIONS.part33 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "33"
+RELATIONS.part34 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "34"
+RELATIONS.part35 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "35"
+RELATIONS.part36 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "36"
+RELATIONS.part37 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "37"
+RELATIONS.part38 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "38"
+RELATIONS.part39 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "39"
+RELATIONS.part40 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "40"
+RELATIONS.part41 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "41"
+RELATIONS.part42 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "42"
+RELATIONS.part43 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "43"
+RELATIONS.part44 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "44"
+RELATIONS.part45 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "45"
+RELATIONS.part46 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "46"
+RELATIONS.part47 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "47"
+RELATIONS.part48 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "48"
+RELATIONS.part49 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "49"
+RELATIONS.part50 : RELATIONS.functionalChildRelation
+ @defChildConnectionPoint "50"
+
+RELATIONS.partN <R STR.IsConnectedTo : RELATIONS.childRelation
+
+/*** Command connections ***/
+DOC.Document.CommandRelation <T STR.ConnectionRelation
+ >-- DOC.Document.CommandRelation.ordinal --> L0.String <R L0.HasProperty
+
+DOC.Document.IsConnectedToCommand <R STR.IsConnectedTo : DOC.Document.CommandRelation
+
+DOC.CommandConnectionType : STR.ConnectionType
+ G2D.HasColor [1.0,0.0,1.0] : G2D.Color
+ G2D.HasStrokeType G2D.StrokeType.Scaling
+ G2D.HasStroke _ : G2D.Stroke
+ G2D.HasStrokeWidth 0.2 : L0.Float
+ G2D.HasLineCap G2D.LineCap.ButtCap
+ G2D.HasLineJoin G2D.LineJoin.MiterJoin
+ STR.HasConnectionConstraint
+ DOC.CommandToCommandExecutorConstraint : DOC.RelationTypeConstraint
+ DOC.RelationTypeConstraint.Type1 RELATIONS.commandExecutorRelation
+ DOC.RelationTypeConstraint.Type2 RELATIONS.commandRelation
+ DOC.NoSelfConnectionConstraint
+
+defCommandExecutorConnectionPoint : L0.Template
+ @template %subject
+ %subject <R STR.IsConnectedTo
+
+defCommandConnectionPoint : L0.Template
+ @template %subject %ordinal
+ %subject <R DOC.Document.IsConnectedToCommand
+ DOC.Document.CommandRelation.ordinal %ordinal
+
+RELATIONS.commandExecutorRelation <T STR.ConnectionRelation
+ @L0.assert STR.AllowsConnectionType DOC.CommandConnectionType
+ @L0.assert MOD.ConnectionRelationToTerminal DOC.Terminals.CommandExecutorTerminal
+ @L0.assert STR.HasAttachmentRelation DIA.HasPlainConnector
+ >-- RELATIONS.commandExecutorRelation.propagate --> "Boolean" <R L0.HasProperty : L0.FunctionalRelation
+ @L0.assert RELATIONS.commandExecutorRelation.propagate false
+
+RELATIONS.commandRelation <T L0.FunctionalRelation <T STR.ConnectionRelation
+ @L0.assert STR.AllowsConnectionType DOC.CommandConnectionType
+ @L0.assert MOD.ConnectionRelationToTerminal DOC.Terminals.CommandTerminal
+ @L0.assert STR.HasAttachmentRelation DIA.HasArrowConnector
+
+RELATIONS.click : RELATIONS.commandRelation
+ @defCommandConnectionPoint "1"
+
+RELATIONS.edit : RELATIONS.commandRelation
+ @defCommandConnectionPoint "2"
+
+RELATIONS.load : RELATIONS.commandRelation
+ @defCommandConnectionPoint "3"
+
+RELATIONS.trigger : RELATIONS.commandRelation
+ @defCommandConnectionPoint "4"
+
+RELATIONS.select : RELATIONS.commandRelation
+ @defCommandConnectionPoint "5"
+
+RELATIONS.valueChanged : RELATIONS.commandRelation
+ @defCommandConnectionPoint "6"
+
+RELATIONS.triggerTrue : RELATIONS.commandRelation
+ @defCommandConnectionPoint "7"
+
+RELATIONS.triggerFalse : RELATIONS.commandRelation
+ @defCommandConnectionPoint "8"
+
+RELATIONS.uploaded : RELATIONS.commandRelation
+ @defCommandConnectionPoint "9"
+
+RELATIONS.closed : RELATIONS.commandRelation
+ @defCommandConnectionPoint "10"
+
+RELATIONS.enter : RELATIONS.commandRelation
+ @defCommandConnectionPoint "11"
+
+RELATIONS.submit : RELATIONS.commandExecutorRelation
+ @defCommandExecutorConnectionPoint
+
+RELATIONS.event : RELATIONS.commandExecutorRelation
+ @defCommandExecutorConnectionPoint
+
+RELATIONS.open : RELATIONS.commandExecutorRelation
+ @defCommandExecutorConnectionPoint
+
+RELATIONS.close : RELATIONS.commandExecutorRelation
+ @defCommandExecutorConnectionPoint
+
+RELATIONS.sequenceTrigger : RELATIONS.commandExecutorRelation
+ @defCommandExecutorConnectionPoint
+ RELATIONS.commandExecutorRelation.propagate true
+
+RELATIONS.broadcast : RELATIONS.commandExecutorRelation
+ @defCommandExecutorConnectionPoint
+
+RELATIONS.sequence1 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "1"
+
+RELATIONS.sequence2 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "2"
+
+RELATIONS.sequence3 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "3"
+
+RELATIONS.sequence4 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "4"
+
+RELATIONS.sequence5 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "5"
+
+RELATIONS.sequence6 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "6"
+
+RELATIONS.sequence7 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "7"
+
+RELATIONS.sequence8 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "8"
+
+RELATIONS.sequence9 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "9"
+
+RELATIONS.sequence10 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "10"
+
+RELATIONS.broadcasted : RELATIONS.commandRelation
+ @defCommandConnectionPoint "1"
+
+RELATIONS.eventIn : RELATIONS.commandExecutorRelation
+ @defCommandExecutorConnectionPoint
+
+RELATIONS.eventOut : RELATIONS.commandRelation
+ @defCommandConnectionPoint "1"
+
+/*** Data connections ***/
+DOC.Document.DataRelation <T STR.ConnectionRelation
+DOC.Document.IsConnectedToData <R STR.IsConnectedTo : DOC.Document.DataRelation
+
+DOC.DataStroke : G2D.Stroke
+ G2D.HasDashArray [1.0, 0.5] : L0.FloatArray
+ G2D.HasStrokeWidth 0.2 : L0.Float
+ G2D.HasLineCap G2D.LineCap.ButtCap
+ G2D.HasLineJoin G2D.LineJoin.MiterJoin
+
+DOC.DataConnectionType : STR.ConnectionType
+ G2D.HasColor [0,0.65,1.0] : G2D.Color
+ G2D.HasStrokeType G2D.StrokeType.Scaling
+ G2D.HasStroke DOC.DataStroke
+ STR.HasConnectionConstraint
+ DOC.DataProviderToDataConsumerConstraint : DOC.RelationTypeConstraint
+ DOC.RelationTypeConstraint.Type1 RELATIONS.dataProviderRelation
+ DOC.RelationTypeConstraint.Type2 RELATIONS.dataConsumerRelation
+ DOC.NoSelfConnectionConstraint
+
+defDataProviderConnectionPoint : L0.Template
+ @template %subject
+ %subject <R STR.IsConnectedTo
+
+defDataConsumerConnectionPoint : L0.Template
+ @template %subject
+ %subject <R DOC.Document.IsConnectedToData
+
+RELATIONS.dataProviderRelation <T STR.ConnectionRelation
+ @L0.assert STR.AllowsConnectionType DOC.DataConnectionType
+ @L0.assert MOD.ConnectionRelationToTerminal DOC.Terminals.DataProviderTerminal
+ @L0.assert STR.HasAttachmentRelation DIA.HasPlainConnector
+
+RELATIONS.dataConsumerRelation <T STR.ConnectionRelation
+ @L0.assert STR.AllowsConnectionType DOC.DataConnectionType
+ @L0.assert MOD.ConnectionRelationToTerminal DOC.Terminals.DataConsumerTerminal
+ @L0.assert STR.HasAttachmentRelation DIA.HasArrowConnector
+
+RELATIONS.singleDataConsumerRelation <T L0.FunctionalRelation <T RELATIONS.dataConsumerRelation
+
+RELATIONS.dataIn : RELATIONS.singleDataConsumerRelation
+ @defDataConsumerConnectionPoint
+
+RELATIONS.arrayDataIn : RELATIONS.dataConsumerRelation
+ @defDataConsumerConnectionPoint
+
+RELATIONS.dataOut : RELATIONS.dataProviderRelation
+ @defDataProviderConnectionPoint
+
+RELATIONS.dataIn1 : RELATIONS.singleDataConsumerRelation
+ @defDataConsumerConnectionPoint
+
+RELATIONS.dataIn2 : RELATIONS.singleDataConsumerRelation
+ @defDataConsumerConnectionPoint
+
+RELATIONS.dataIn3 : RELATIONS.singleDataConsumerRelation
+ @defDataConsumerConnectionPoint
+
+RELATIONS.dataIn4 : RELATIONS.singleDataConsumerRelation
+ @defDataConsumerConnectionPoint
+
+RELATIONS.dataIn5 : RELATIONS.singleDataConsumerRelation
+ @defDataConsumerConnectionPoint
+
+RELATIONS.dataIn6 : RELATIONS.singleDataConsumerRelation
+ @defDataConsumerConnectionPoint
+
+RELATIONS.dataIn7 : RELATIONS.singleDataConsumerRelation
+ @defDataConsumerConnectionPoint
+
+RELATIONS.dataIn8 : RELATIONS.singleDataConsumerRelation
+ @defDataConsumerConnectionPoint
+
+RELATIONS.dataIn9 : RELATIONS.singleDataConsumerRelation
+ @defDataConsumerConnectionPoint
+
+RELATIONS.dataIn10 : RELATIONS.singleDataConsumerRelation
+ @defDataConsumerConnectionPoint
+
+/*** Data definition connections ***/
+DOC.Document.DataDefinitionRelation <T STR.ConnectionRelation
+DOC.Document.IsConnectedToDataDefinition <R STR.IsConnectedTo : DOC.Document.DataDefinitionRelation
+
+DOC.DataDefinitionConnectionType : STR.ConnectionType
+ G2D.HasColor [0,0.65,1.0] : G2D.Color
+ G2D.HasStrokeType G2D.StrokeType.Scaling
+ G2D.HasStroke DOC.DataStroke
+ STR.HasConnectionConstraint
+ DOC.DataDefinitionToDataDefinitionConsumerConstraint : DOC.RelationTypeConstraint
+ DOC.RelationTypeConstraint.Type1 RELATIONS.dataDefinitionRelation
+ DOC.RelationTypeConstraint.Type2 RELATIONS.dataDefinitionConsumerRelation
+ DOC.NoSelfConnectionConstraint
+
+defDataDefinitionConnectionPoint : L0.Template
+ @template %subject
+ %subject <R STR.IsConnectedTo
+
+defDataDefinitionConsumerConnectionPoint : L0.Template
+ @template %subject
+ %subject <R DOC.Document.IsConnectedToDataDefinition
+
+RELATIONS.dataDefinitionRelation <T STR.ConnectionRelation
+ @L0.assert STR.AllowsConnectionType DOC.DataDefinitionConnectionType
+ @L0.assert MOD.ConnectionRelationToTerminal DOC.Terminals.DataProviderTerminal
+ @L0.assert STR.HasAttachmentRelation DIA.HasPlainConnector
+
+RELATIONS.singleDataDefinitionRelation <T RELATIONS.dataDefinitionRelation <T L0.FunctionalRelation
+
+RELATIONS.dataDefinitionConsumerRelation <T STR.ConnectionRelation
+ @L0.assert STR.AllowsConnectionType DOC.DataDefinitionConnectionType
+ @L0.assert MOD.ConnectionRelationToTerminal DOC.Terminals.DataConsumerTerminal
+ @L0.assert STR.HasAttachmentRelation DIA.HasArrowConnector
+
+RELATIONS.data1 : RELATIONS.dataDefinitionConsumerRelation
+ @defDataDefinitionConsumerConnectionPoint
+
+RELATIONS.data2 : RELATIONS.dataDefinitionConsumerRelation : L0.FunctionalRelation
+ @defDataDefinitionConsumerConnectionPoint
+
+RELATIONS.data3 : RELATIONS.dataDefinitionConsumerRelation : L0.FunctionalRelation
+ @defDataDefinitionConsumerConnectionPoint
+
+RELATIONS.data4 : RELATIONS.dataDefinitionConsumerRelation : L0.FunctionalRelation
+ @defDataDefinitionConsumerConnectionPoint
+
+RELATIONS.data5 : RELATIONS.dataDefinitionConsumerRelation : L0.FunctionalRelation
+ @defDataDefinitionConsumerConnectionPoint
+
+RELATIONS.data6 : RELATIONS.dataDefinitionConsumerRelation : L0.FunctionalRelation
+ @defDataDefinitionConsumerConnectionPoint
+
+RELATIONS.data7 : RELATIONS.dataDefinitionConsumerRelation : L0.FunctionalRelation
+ @defDataDefinitionConsumerConnectionPoint
+
+RELATIONS.data8 : RELATIONS.dataDefinitionConsumerRelation : L0.FunctionalRelation
+ @defDataDefinitionConsumerConnectionPoint
+
+RELATIONS.data9 : RELATIONS.dataDefinitionConsumerRelation : L0.FunctionalRelation
+ @defDataDefinitionConsumerConnectionPoint
+
+RELATIONS.data10 : RELATIONS.dataDefinitionConsumerRelation : L0.FunctionalRelation
+ @defDataDefinitionConsumerConnectionPoint
+
+RELATIONS.dataDefinition : RELATIONS.dataDefinitionRelation
+ @defDataDefinitionConnectionPoint
+