public static Resource createEdge(WriteGraph graph, Resource composite) throws DatabaseException {
return createEdge(graph, composite, graph.getPossibleObject(composite, DistrictNetworkResource.getInstance(graph).EdgeDefaultMapping));
}
-
+
public static Resource createEdge(WriteGraph graph, Resource composite, Resource mapping) throws DatabaseException {
Layer0 L0 = Layer0.getInstance(graph);
DistrictNetworkResource DN = DistrictNetworkResource.getInstance(graph);
graph.claim(composite, L0.ConsistsOf, L0.PartOf, edge);
claimFreshElementName(graph, composite, edge);
+
+ // We need to put GraphLayer to newLayers so...
+ for (Resource layer : graph.getObjects(composite, DiagramResource.getInstance(graph).HasLayer)) {
+ IGraphLayerUtil layerUtil = graph.adapt(graph.getSingleObject(layer, Layer0.getInstance(graph).InstanceOf), IGraphLayerUtil.class);
+
+ GraphLayer gl = layerUtil.loadLayer(graph, layer);
+ gl.forEachTag(tag -> {
+ DiagramGraphUtil.tag(graph, edge, tag, true);
+ });
+ }
+
return edge;
}
-
+
public static Resource createVertex(WriteGraph graph, Resource composite, double[] coords) throws DatabaseException {
Resource defaultVertexMapping = graph.getPossibleObject(composite, DistrictNetworkResource.getInstance(graph).VertexDefaultMapping);
return createVertex(graph, composite, coords, defaultVertexMapping);
}
-
+
public static Resource createVertex(WriteGraph graph, Resource composite, double[] coords, Resource mapping) throws DatabaseException {
Layer0 L0 = Layer0.getInstance(graph);
DistrictNetworkResource DN = DistrictNetworkResource.getInstance(graph);