As far as I know the "precise" definition of a graph is just this:
An ordered pair $G = (V, E)$ comprising a set $V$ of nodes together with a set $E$ of edges.
I am pretty sure, but would like confirmation, that this means that both the elements of the set containing the edges and the set containing the edges can be complex entities (I guess as long as they can be indexed?). For example, they could be functions of a parameter $t$, and thus I would have a graph $G(t)$, that would still technically speaking, be just a graph (although a somewhat special case)?
If you think of the analogy of sets with graphs, then just as the elements of a set can be anything, including sets themselves, then the nodes and edges can be anything also, except that edges have to correspond to pairs of nodes, even though they don't have be pairs of nodes. Some definitions of simple graph and hypergraph require that edges literally have to be pairs or sets of vertices, but this seems too strict to me. In any case, no definition of graph or hypergraph restricts what the nodes can be. They can be anything. Read the Wikipedia article Vertex (graph theory) referring to semantic networks.
You can also look at the example of Category theory where a category consists of objects and arrows between them and the underlying directed graph. Here no restrictions are on the objects and arrows. "However, the objects of a category need not be sets, and the arrows need not be functions."