Hi,
Apologies for such a late response, it is inexcusable :(
The crucial part of your code below is the AL generator. In a structure like the generalized hypergraph we have in HGDB, pretty much anything goes really. In the sense that interpreting when two atoms are related is very much dependent on your application domain model. Is a link related to its targets? In some sense yes, but in another no because it’s the relationship. Depends on what you want. Oftentimes it is more performant to have the HyperGraphDB be polymorphic in a sense so that to represent a classical graph directed edge between two nodes A and B, instead of creating a link [A,B], you could represent A is the link [B]. So a tree for example could be represented with all its nodes being tuples of their children. In that case, for traversal purposes, the adacent nodes to a node will be its targets.
Back to your code, the SimpleALGenerator will treat links as edges in the classical sense and their targets as nodes. So your ‘root’ atom is not connected to anything at all. So you should implement the HGALGenerator interface to tell the traversal exactly what adjacent atoms are. There is a TargetSetALGenerator:
That you can use.
Hope this helps,
Boris