Nasdanika graph model provides base classes (building blocks) for graph-like models such as process/flow and architecture models.
The model can also be used AS-IS. Living Beings (source) demonstrated mapping of a Drawio diagram to this model and generation of HTML documentation. The mapping process is explained in the Beyond Diagrams book.
The below diagram shows some of the model classes:
Graph is a container of graph elements:
Node is both connection source and connection target. I.e. it may have both outgoing and incoming connections.
Then there are Composite
flavors of connection source, connection target and node - they are also sub-graphs, i.e. may contain other graph elements. There is an aggregate connection - Tunnel.
Not shown on the diagram are Documented Named
flavors of the above classes, including Documented Named Composite
flavors.
Graph model elements can be adapted to Graph interfaces with org.nasdanika.graph.model.adapters.GraphAdapterFactory
as shown below:
GraphAdapterFactory graphAdapterFactory = new GraphAdapterFactory();
Transformer<EObject,ElementAdapter<?>> graphFactory = new Transformer<>(graphAdapterFactory); // Reflective creation
ProgressMonitor progressMonitor = new PrintStreamProgressMonitor();
Map<EObject, ElementAdapter<?>> registry = graphFactory.transform(Collections.singleton(graph), false, progressMonitor);
Once you have a graph you may create processors on top of it.