-
Notifications
You must be signed in to change notification settings - Fork 1
RefAtoms
Elements stored in HyperGraph are unified into the general concept of an atom. Every atom holds some data and has an associated type to assist the interpretation of that data. Atoms are either nodes or links. Nodes can be seen as links with outgoing set cardinality of 0. The run-time representation of atoms is constrained only by the capabilities of the host language and by its corresponding type. Links, on the other, are represented by a HyperGraph defined data structure. A link is an atom pointing to a set of other atoms – its target (or outgoing) set. Unlike in regular graphs, links can point to more than two other atoms. And unlike in regular mathematical hyper-graphs, links can also be the targets of other links.
Links are represented by the HGLink interface. The HGLink interface must be implemented by all HyperGraph links. The HGPlainLink class provides a default implementation with no data payload and it can be extended by applications. The HGValueLink is one such extension that allows an arbitrary object to be stored as link data, thus allowing application specific link representations to be decoupled from the HyperGraph API.
Every atom has an associated incidence set, which is the set of all links whose target is that particular atom. While in principle the incidence set of a given atom can be computed from the set of target sets of all atoms in the graph, HyperGraph maintains that set explicitly for every atom and makes it readily available to applications. The management of the incidence set is performed “behind the scenes” by monitoring creation and removal of links. Changing a link’s target set is possible, but a relatively expensive operation.
The database storage of atoms (nodes or links) is managed by HyperGraph. The storage of their associated data payload is managed by their types as described in detail in the Types section below.