Layer0 l0 = Layer0.getInstance(g);
Layer0X l0x = Layer0X.getInstance(g);
ModelingResources m = ModelingResources.getInstance(g);
+ DiagramResource dia = DiagramResource.getInstance(g);
// create composite
Resource composite = g.newResource();
// This would cause problems because a diagram is a structural composite/component also.
g.claimLiteral(diagram, l0.HasName, name, Bindings.STRING);
Resource container = g.newResource();
- g.claim(container, l0.InstanceOf, null, l0.Library);
+ g.claim(container, l0.InstanceOf, null, dia.DiagramContainer);
g.addLiteral(container, l0.HasName, l0.NameOf, l0.String, "__CONTAINER__", Bindings.STRING);
g.claim(container, l0.ConsistsOf, diagram);
g.claim(composite, l0.ConsistsOf, container);
// Relation from element1 to connector1
Resource isConnected1 = getDiagramConnectionRelation(g, element, componentConRel1);
-
+ Resource connectorRel1 = g.getPossibleObject(componentConRel1, s.HasAttachmentRelation);
+ if (connectorRel1 == null)
+ connectorRel1 = d.HasPlainConnector;
+
// connector1
Resource connector1 = g.newResource();
g.claim(connector1, b.InstanceOf, d.Connector);
g.claim(element, isConnected1, connector1);
- g.claim(diagramConnection, d.HasPlainConnector, connector1);
+ g.claim(diagramConnection, connectorRel1, connector1);
// Relation from element2 to connector2
Resource isConnected2 = getDiagramConnectionRelation(g, symbolConf2.element, componentConRel2);
-
+ Resource connectorRel2 = g.getPossibleObject(componentConRel2, s.HasAttachmentRelation);
+ if (connectorRel2 == null)
+ connectorRel2 = d.HasArrowConnector;
// connector2
Resource connector2 = g.newResource();
g.claim(connector2, b.InstanceOf, d.Connector);
g.claim(symbolConf2.element, isConnected2, connector2);
- g.claim(diagramConnection, d.HasArrowConnector, connector2);
+ g.claim(diagramConnection, connectorRel2, connector2);
// connect connectors
g.claim(connector1, d.AreConnected, connector2);